diff --git a/netbox/client/circuits/circuits_choices_list_parameters.go b/netbox/client/circuits/circuits_choices_list_parameters.go index b8a5a7b0d6df8b7517ad01d87277cd4c58f3b9e6..0a106b052a3cedb91e2151231b5aa6a7e8ea3476 100644 --- a/netbox/client/circuits/circuits_choices_list_parameters.go +++ b/netbox/client/circuits/circuits_choices_list_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_choices_read_parameters.go b/netbox/client/circuits/circuits_choices_read_parameters.go index 170d8b97a950a1bcfeaa66e5977ad39d6e97ef8b..85f99867881efa5126127ccb3198cb09d5d793fd 100644 --- a/netbox/client/circuits/circuits_choices_read_parameters.go +++ b/netbox/client/circuits/circuits_choices_read_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go index d5e65540515470e5464c39c5aaa5573d59b140df..6b779dccfec1bb1c641a4bdeb0fb8bda642edfd0 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go +++ b/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go @@ -20,18 +20,17 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitTerminationsCreateParams creates a new CircuitsCircuitTerminationsCreateParams object diff --git a/netbox/client/circuits/circuits_circuit_terminations_create_responses.go b/netbox/client/circuits/circuits_circuit_terminations_create_responses.go index fd0bee5c09aef2a73c2a78e2b942d0430dc97692..ceb2eb5d7540fdef131e8d8659ab1b3646264252 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_create_responses.go +++ b/netbox/client/circuits/circuits_circuit_terminations_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTerminationsCreateReader is a Reader for the CircuitsCircuitTerminationsCreate structure. @@ -61,7 +61,7 @@ func NewCircuitsCircuitTerminationsCreateCreated() *CircuitsCircuitTerminationsC CircuitsCircuitTerminationsCreateCreated circuits circuit terminations create created */ type CircuitsCircuitTerminationsCreateCreated struct { - Payload *models.WritableCircuitTermination + Payload *models.CircuitTermination } func (o *CircuitsCircuitTerminationsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsCircuitTerminationsCreateCreated) Error() string { func (o *CircuitsCircuitTerminationsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCircuitTermination) + o.Payload = new(models.CircuitTermination) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go index 04fc84f0f6ef91b561c3825b6848db81812e1251..cf8e2ea2fe51ff0f4bd959988316060fdb709fa8 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go +++ b/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go index c25cbe11d6b53b0390caaa811d71dd28d8f32220..5c0f6a570e89ab5503416b6602a99214c5a7db42 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go +++ b/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -90,7 +89,7 @@ type CircuitsCircuitTerminationsListParams struct { */ Offset *int64 /*PortSpeed*/ - PortSpeed *float64 + PortSpeed *string /*Q*/ Q *string /*Site*/ @@ -100,7 +99,7 @@ type CircuitsCircuitTerminationsListParams struct { /*TermSide*/ TermSide *string /*UpstreamSpeed*/ - UpstreamSpeed *float64 + UpstreamSpeed *string /*XconnectID*/ XconnectID *string @@ -176,13 +175,13 @@ func (o *CircuitsCircuitTerminationsListParams) SetOffset(offset *int64) { } // WithPortSpeed adds the portSpeed to the circuits circuit terminations list params -func (o *CircuitsCircuitTerminationsListParams) WithPortSpeed(portSpeed *float64) *CircuitsCircuitTerminationsListParams { +func (o *CircuitsCircuitTerminationsListParams) WithPortSpeed(portSpeed *string) *CircuitsCircuitTerminationsListParams { o.SetPortSpeed(portSpeed) return o } // SetPortSpeed adds the portSpeed to the circuits circuit terminations list params -func (o *CircuitsCircuitTerminationsListParams) SetPortSpeed(portSpeed *float64) { +func (o *CircuitsCircuitTerminationsListParams) SetPortSpeed(portSpeed *string) { o.PortSpeed = portSpeed } @@ -231,13 +230,13 @@ func (o *CircuitsCircuitTerminationsListParams) SetTermSide(termSide *string) { } // WithUpstreamSpeed adds the upstreamSpeed to the circuits circuit terminations list params -func (o *CircuitsCircuitTerminationsListParams) WithUpstreamSpeed(upstreamSpeed *float64) *CircuitsCircuitTerminationsListParams { +func (o *CircuitsCircuitTerminationsListParams) WithUpstreamSpeed(upstreamSpeed *string) *CircuitsCircuitTerminationsListParams { o.SetUpstreamSpeed(upstreamSpeed) return o } // SetUpstreamSpeed adds the upstreamSpeed to the circuits circuit terminations list params -func (o *CircuitsCircuitTerminationsListParams) SetUpstreamSpeed(upstreamSpeed *float64) { +func (o *CircuitsCircuitTerminationsListParams) SetUpstreamSpeed(upstreamSpeed *string) { o.UpstreamSpeed = upstreamSpeed } @@ -311,11 +310,11 @@ func (o *CircuitsCircuitTerminationsListParams) WriteToRequest(r runtime.ClientR if o.PortSpeed != nil { // query param port_speed - var qrPortSpeed float64 + var qrPortSpeed string if o.PortSpeed != nil { qrPortSpeed = *o.PortSpeed } - qPortSpeed := swag.FormatFloat64(qrPortSpeed) + qPortSpeed := qrPortSpeed if qPortSpeed != "" { if err := r.SetQueryParam("port_speed", qPortSpeed); err != nil { return err @@ -391,11 +390,11 @@ func (o *CircuitsCircuitTerminationsListParams) WriteToRequest(r runtime.ClientR if o.UpstreamSpeed != nil { // query param upstream_speed - var qrUpstreamSpeed float64 + var qrUpstreamSpeed string if o.UpstreamSpeed != nil { qrUpstreamSpeed = *o.UpstreamSpeed } - qUpstreamSpeed := swag.FormatFloat64(qrUpstreamSpeed) + qUpstreamSpeed := qrUpstreamSpeed if qUpstreamSpeed != "" { if err := r.SetQueryParam("upstream_speed", qUpstreamSpeed); err != nil { return err diff --git a/netbox/client/circuits/circuits_circuit_terminations_list_responses.go b/netbox/client/circuits/circuits_circuit_terminations_list_responses.go index 29be56dc3197e86a8f2a0781d6bc8ea37075472f..63d36575322b459d3f2c7ae927840085c1178053 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_list_responses.go +++ b/netbox/client/circuits/circuits_circuit_terminations_list_responses.go @@ -22,12 +22,16 @@ package circuits import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTerminationsListReader is a Reader for the CircuitsCircuitTerminationsList structure. @@ -61,7 +65,7 @@ func NewCircuitsCircuitTerminationsListOK() *CircuitsCircuitTerminationsListOK { CircuitsCircuitTerminationsListOK circuits circuit terminations list o k */ type CircuitsCircuitTerminationsListOK struct { - Payload *models.CircuitsCircuitTerminationsListOKBody + Payload *CircuitsCircuitTerminationsListOKBody } func (o *CircuitsCircuitTerminationsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *CircuitsCircuitTerminationsListOK) Error() string { func (o *CircuitsCircuitTerminationsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.CircuitsCircuitTerminationsListOKBody) + o.Payload = new(CircuitsCircuitTerminationsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *CircuitsCircuitTerminationsListOK) readResponse(response runtime.Client return nil } + +/*CircuitsCircuitTerminationsListOKBody circuits circuit terminations list o k body +swagger:model CircuitsCircuitTerminationsListOKBody +*/ +type CircuitsCircuitTerminationsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.CircuitTermination `json:"results"` +} + +// Validate validates this circuits circuit terminations list o k body +func (o *CircuitsCircuitTerminationsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CircuitsCircuitTerminationsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("circuitsCircuitTerminationsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitTerminationsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("circuitsCircuitTerminationsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitTerminationsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("circuitsCircuitTerminationsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitTerminationsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("circuitsCircuitTerminationsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuitsCircuitTerminationsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *CircuitsCircuitTerminationsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CircuitsCircuitTerminationsListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitTerminationsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go index 294471aa1e6a20efff18d2defed9b08b66e8ca6a..6cb529817103c9a3e0b6f29e6a35118100f0a6ee 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go +++ b/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitTerminationsPartialUpdateParams creates a new CircuitsCircuitTerminationsPartialUpdateParams object diff --git a/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go b/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go index 4ad26a952372f603d61a586f6e4f7ae05cd3bded..f91fa104bacd821f2c5e1519eef07d8e8d48d403 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go +++ b/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTerminationsPartialUpdateReader is a Reader for the CircuitsCircuitTerminationsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewCircuitsCircuitTerminationsPartialUpdateOK() *CircuitsCircuitTermination CircuitsCircuitTerminationsPartialUpdateOK circuits circuit terminations partial update o k */ type CircuitsCircuitTerminationsPartialUpdateOK struct { - Payload *models.WritableCircuitTermination + Payload *models.CircuitTermination } func (o *CircuitsCircuitTerminationsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsCircuitTerminationsPartialUpdateOK) Error() string { func (o *CircuitsCircuitTerminationsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCircuitTermination) + o.Payload = new(models.CircuitTermination) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go index 9751e38146ae22db30a3a431e6817d84e6a9a3bd..1b5c0a9ed3479567b4ff952937da7518e23194b9 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go +++ b/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_circuit_terminations_read_responses.go b/netbox/client/circuits/circuits_circuit_terminations_read_responses.go index 18d3308142e0bc8db8d06aece67ee08bcf286330..5a630cc501c6a9ca954173fa180e0277e91d6b6d 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_read_responses.go +++ b/netbox/client/circuits/circuits_circuit_terminations_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTerminationsReadReader is a Reader for the CircuitsCircuitTerminationsRead structure. diff --git a/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go index 4c793efe74f393d314fb84b581cd569d5088c23e..c1caf26b16ce3cbff0995bff440572bbace00010 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go +++ b/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitTerminationsUpdateParams creates a new CircuitsCircuitTerminationsUpdateParams object diff --git a/netbox/client/circuits/circuits_circuit_terminations_update_responses.go b/netbox/client/circuits/circuits_circuit_terminations_update_responses.go index a69b94e6afc150050487dbcf2ecbd7990ae32932..0e94bc534dee6a63317425894178ff8775c2aec6 100644 --- a/netbox/client/circuits/circuits_circuit_terminations_update_responses.go +++ b/netbox/client/circuits/circuits_circuit_terminations_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTerminationsUpdateReader is a Reader for the CircuitsCircuitTerminationsUpdate structure. @@ -61,7 +61,7 @@ func NewCircuitsCircuitTerminationsUpdateOK() *CircuitsCircuitTerminationsUpdate CircuitsCircuitTerminationsUpdateOK circuits circuit terminations update o k */ type CircuitsCircuitTerminationsUpdateOK struct { - Payload *models.WritableCircuitTermination + Payload *models.CircuitTermination } func (o *CircuitsCircuitTerminationsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsCircuitTerminationsUpdateOK) Error() string { func (o *CircuitsCircuitTerminationsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCircuitTermination) + o.Payload = new(models.CircuitTermination) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/circuits/circuits_circuit_types_create_parameters.go b/netbox/client/circuits/circuits_circuit_types_create_parameters.go index 0c20aace407b804dd880b3bb85501335675fd3a5..ff0047d71f360ec14dbbc9bbe0eaa5426b71b3af 100644 --- a/netbox/client/circuits/circuits_circuit_types_create_parameters.go +++ b/netbox/client/circuits/circuits_circuit_types_create_parameters.go @@ -20,18 +20,17 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitTypesCreateParams creates a new CircuitsCircuitTypesCreateParams object diff --git a/netbox/client/circuits/circuits_circuit_types_create_responses.go b/netbox/client/circuits/circuits_circuit_types_create_responses.go index 042fd2f42bc37272d36cad937ac8534e55f8a2be..7ee19f7ce66599c931c7659460234ac7c09a1cb7 100644 --- a/netbox/client/circuits/circuits_circuit_types_create_responses.go +++ b/netbox/client/circuits/circuits_circuit_types_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTypesCreateReader is a Reader for the CircuitsCircuitTypesCreate structure. diff --git a/netbox/client/circuits/circuits_circuit_types_delete_parameters.go b/netbox/client/circuits/circuits_circuit_types_delete_parameters.go index 7e9eb16e83b3f0c838c2ebf3ecc9c1ee4175b953..db7e0ef558e1672815b0fb3b9804552c0e75d230 100644 --- a/netbox/client/circuits/circuits_circuit_types_delete_parameters.go +++ b/netbox/client/circuits/circuits_circuit_types_delete_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_circuit_types_list_parameters.go b/netbox/client/circuits/circuits_circuit_types_list_parameters.go index 00c01d9d6a66d405eb48c5b505e2e9a8304e4ef1..aea2e67063311a819aa661920ce9949045c0a773 100644 --- a/netbox/client/circuits/circuits_circuit_types_list_parameters.go +++ b/netbox/client/circuits/circuits_circuit_types_list_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the circuits circuit types list operation typically these are written to a h */ type CircuitsCircuitTypesListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type CircuitsCircuitTypesListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -130,6 +133,17 @@ func (o *CircuitsCircuitTypesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithID(id *string) *CircuitsCircuitTypesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the circuits circuit types list params func (o *CircuitsCircuitTypesListParams) WithLimit(limit *int64) *CircuitsCircuitTypesListParams { o.SetLimit(limit) @@ -163,6 +177,17 @@ func (o *CircuitsCircuitTypesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithQ(q *string) *CircuitsCircuitTypesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the circuits circuit types list params func (o *CircuitsCircuitTypesListParams) WithSlug(slug *string) *CircuitsCircuitTypesListParams { o.SetSlug(slug) @@ -182,6 +207,22 @@ func (o *CircuitsCircuitTypesListParams) WriteToRequest(r runtime.ClientRequest, } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -230,6 +271,22 @@ func (o *CircuitsCircuitTypesListParams) WriteToRequest(r runtime.ClientRequest, } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/circuits/circuits_circuit_types_list_responses.go b/netbox/client/circuits/circuits_circuit_types_list_responses.go index 5d13ece4aa7974adc9a23e515e1239a9a6fb717c..e63602c02caf3618ed27f548d535f6bff78eb3d9 100644 --- a/netbox/client/circuits/circuits_circuit_types_list_responses.go +++ b/netbox/client/circuits/circuits_circuit_types_list_responses.go @@ -22,12 +22,16 @@ package circuits import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTypesListReader is a Reader for the CircuitsCircuitTypesList structure. @@ -61,7 +65,7 @@ func NewCircuitsCircuitTypesListOK() *CircuitsCircuitTypesListOK { CircuitsCircuitTypesListOK circuits circuit types list o k */ type CircuitsCircuitTypesListOK struct { - Payload *models.CircuitsCircuitTypesListOKBody + Payload *CircuitsCircuitTypesListOKBody } func (o *CircuitsCircuitTypesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *CircuitsCircuitTypesListOK) Error() string { func (o *CircuitsCircuitTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.CircuitsCircuitTypesListOKBody) + o.Payload = new(CircuitsCircuitTypesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *CircuitsCircuitTypesListOK) readResponse(response runtime.ClientRespons return nil } + +/*CircuitsCircuitTypesListOKBody circuits circuit types list o k body +swagger:model CircuitsCircuitTypesListOKBody +*/ +type CircuitsCircuitTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.CircuitType `json:"results"` +} + +// Validate validates this circuits circuit types list o k body +func (o *CircuitsCircuitTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CircuitsCircuitTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("circuitsCircuitTypesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitTypesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("circuitsCircuitTypesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitTypesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("circuitsCircuitTypesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("circuitsCircuitTypesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuitsCircuitTypesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *CircuitsCircuitTypesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CircuitsCircuitTypesListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go b/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go index 2bd833aa0f8af03042fc75246b4b00336f348b0a..e5ab3fa2de5192cbe6cd92c9e931ce44486919d7 100644 --- a/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go +++ b/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitTypesPartialUpdateParams creates a new CircuitsCircuitTypesPartialUpdateParams object diff --git a/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go b/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go index 1e8ff2dceba92cc10bed07d249e18c0b83f4c8b6..9c0fbd448d2a36f112e42b75ea99104bb6232a93 100644 --- a/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go +++ b/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTypesPartialUpdateReader is a Reader for the CircuitsCircuitTypesPartialUpdate structure. diff --git a/netbox/client/circuits/circuits_circuit_types_read_parameters.go b/netbox/client/circuits/circuits_circuit_types_read_parameters.go index a36b410ec68159c8065d73aff9f4d4f5adf6e16b..e8c02da9b1adc83d4b7624f47c24bc13ee2ff62e 100644 --- a/netbox/client/circuits/circuits_circuit_types_read_parameters.go +++ b/netbox/client/circuits/circuits_circuit_types_read_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_circuit_types_read_responses.go b/netbox/client/circuits/circuits_circuit_types_read_responses.go index 32c6448e152a624ba5779d89b46b27f06c0fe7e8..c9fd9ff152da81a702060569710cb7ebb8627f70 100644 --- a/netbox/client/circuits/circuits_circuit_types_read_responses.go +++ b/netbox/client/circuits/circuits_circuit_types_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTypesReadReader is a Reader for the CircuitsCircuitTypesRead structure. diff --git a/netbox/client/circuits/circuits_circuit_types_update_parameters.go b/netbox/client/circuits/circuits_circuit_types_update_parameters.go index 3fa62cdb86eda66685d76481dc3db8d8e62cc6e2..ba492353215c2a9e8177d9a9a894a1c7604d0232 100644 --- a/netbox/client/circuits/circuits_circuit_types_update_parameters.go +++ b/netbox/client/circuits/circuits_circuit_types_update_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitTypesUpdateParams creates a new CircuitsCircuitTypesUpdateParams object diff --git a/netbox/client/circuits/circuits_circuit_types_update_responses.go b/netbox/client/circuits/circuits_circuit_types_update_responses.go index 425e912050dd669189e0b2c89dcb18f75680bedb..de96dcb1b2513d51522c0db7a359a29ce9fb2511 100644 --- a/netbox/client/circuits/circuits_circuit_types_update_responses.go +++ b/netbox/client/circuits/circuits_circuit_types_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitTypesUpdateReader is a Reader for the CircuitsCircuitTypesUpdate structure. diff --git a/netbox/client/circuits/circuits_circuits_create_parameters.go b/netbox/client/circuits/circuits_circuits_create_parameters.go index 8ef8373174244bbbe17334dd3b55e22c7e6709f4..62c89b9c3381228440474be619eb82c0cb841f9b 100644 --- a/netbox/client/circuits/circuits_circuits_create_parameters.go +++ b/netbox/client/circuits/circuits_circuits_create_parameters.go @@ -20,18 +20,17 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitsCreateParams creates a new CircuitsCircuitsCreateParams object diff --git a/netbox/client/circuits/circuits_circuits_create_responses.go b/netbox/client/circuits/circuits_circuits_create_responses.go index 9f70763517442ad811a7955f70b772a9bd669728..8331547b4401bb0a88c7c3ebee26231f418bd4fb 100644 --- a/netbox/client/circuits/circuits_circuits_create_responses.go +++ b/netbox/client/circuits/circuits_circuits_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitsCreateReader is a Reader for the CircuitsCircuitsCreate structure. @@ -61,7 +61,7 @@ func NewCircuitsCircuitsCreateCreated() *CircuitsCircuitsCreateCreated { CircuitsCircuitsCreateCreated circuits circuits create created */ type CircuitsCircuitsCreateCreated struct { - Payload *models.WritableCircuit + Payload *models.Circuit } func (o *CircuitsCircuitsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsCircuitsCreateCreated) Error() string { func (o *CircuitsCircuitsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCircuit) + o.Payload = new(models.Circuit) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/circuits/circuits_circuits_delete_parameters.go b/netbox/client/circuits/circuits_circuits_delete_parameters.go index bc227a0f31dc119f78abfc4aefc61019897f8986..1c4a7b652fdca29506c06ea212cabd5b27ae4688 100644 --- a/netbox/client/circuits/circuits_circuits_delete_parameters.go +++ b/netbox/client/circuits/circuits_circuits_delete_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_circuits_list_parameters.go b/netbox/client/circuits/circuits_circuits_list_parameters.go index 01e99ad00265706171f17ed787832c49a80b8bfe..6d3b86fb8261a612f4a5e2b0769702078e29b067 100644 --- a/netbox/client/circuits/circuits_circuits_list_parameters.go +++ b/netbox/client/circuits/circuits_circuits_list_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -80,7 +79,7 @@ type CircuitsCircuitsListParams struct { /*Cid*/ Cid *string /*CommitRate*/ - CommitRate *float64 + CommitRate *string /*IDIn Multiple values may be separated by commas. @@ -110,8 +109,14 @@ type CircuitsCircuitsListParams struct { SiteID *string /*Status*/ Status *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string /*Type*/ @@ -169,13 +174,13 @@ func (o *CircuitsCircuitsListParams) SetCid(cid *string) { } // WithCommitRate adds the commitRate to the circuits circuits list params -func (o *CircuitsCircuitsListParams) WithCommitRate(commitRate *float64) *CircuitsCircuitsListParams { +func (o *CircuitsCircuitsListParams) WithCommitRate(commitRate *string) *CircuitsCircuitsListParams { o.SetCommitRate(commitRate) return o } // SetCommitRate adds the commitRate to the circuits circuits list params -func (o *CircuitsCircuitsListParams) SetCommitRate(commitRate *float64) { +func (o *CircuitsCircuitsListParams) SetCommitRate(commitRate *string) { o.CommitRate = commitRate } @@ -289,6 +294,17 @@ func (o *CircuitsCircuitsListParams) SetStatus(status *string) { o.Status = status } +// WithTag adds the tag to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTag(tag *string) *CircuitsCircuitsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the circuits circuits list params func (o *CircuitsCircuitsListParams) WithTenant(tenant *string) *CircuitsCircuitsListParams { o.SetTenant(tenant) @@ -300,6 +316,28 @@ func (o *CircuitsCircuitsListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTenantGroup(tenantGroup *string) *CircuitsCircuitsListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTenantGroupID(tenantGroupID *string) *CircuitsCircuitsListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the circuits circuits list params func (o *CircuitsCircuitsListParams) WithTenantID(tenantID *string) *CircuitsCircuitsListParams { o.SetTenantID(tenantID) @@ -360,11 +398,11 @@ func (o *CircuitsCircuitsListParams) WriteToRequest(r runtime.ClientRequest, reg if o.CommitRate != nil { // query param commit_rate - var qrCommitRate float64 + var qrCommitRate string if o.CommitRate != nil { qrCommitRate = *o.CommitRate } - qCommitRate := swag.FormatFloat64(qrCommitRate) + qCommitRate := qrCommitRate if qCommitRate != "" { if err := r.SetQueryParam("commit_rate", qCommitRate); err != nil { return err @@ -533,6 +571,22 @@ func (o *CircuitsCircuitsListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -549,6 +603,38 @@ func (o *CircuitsCircuitsListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id diff --git a/netbox/client/circuits/circuits_circuits_list_responses.go b/netbox/client/circuits/circuits_circuits_list_responses.go index fdd3e779d462e7bcbef96378ca806638d3e45aa6..b5a267446e910924d2fa59fd5f5b2536d819722c 100644 --- a/netbox/client/circuits/circuits_circuits_list_responses.go +++ b/netbox/client/circuits/circuits_circuits_list_responses.go @@ -22,12 +22,16 @@ package circuits import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitsListReader is a Reader for the CircuitsCircuitsList structure. @@ -61,7 +65,7 @@ func NewCircuitsCircuitsListOK() *CircuitsCircuitsListOK { CircuitsCircuitsListOK circuits circuits list o k */ type CircuitsCircuitsListOK struct { - Payload *models.CircuitsCircuitsListOKBody + Payload *CircuitsCircuitsListOKBody } func (o *CircuitsCircuitsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *CircuitsCircuitsListOK) Error() string { func (o *CircuitsCircuitsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.CircuitsCircuitsListOKBody) + o.Payload = new(CircuitsCircuitsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *CircuitsCircuitsListOK) readResponse(response runtime.ClientResponse, c return nil } + +/*CircuitsCircuitsListOKBody circuits circuits list o k body +swagger:model CircuitsCircuitsListOKBody +*/ +type CircuitsCircuitsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Circuit `json:"results"` +} + +// Validate validates this circuits circuits list o k body +func (o *CircuitsCircuitsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CircuitsCircuitsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("circuitsCircuitsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("circuitsCircuitsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("circuitsCircuitsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *CircuitsCircuitsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("circuitsCircuitsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuitsCircuitsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *CircuitsCircuitsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CircuitsCircuitsListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/circuits/circuits_circuits_partial_update_parameters.go b/netbox/client/circuits/circuits_circuits_partial_update_parameters.go index 263ab7ecc8ddf55cab3e3187f150621ff25a91f7..f99b8f936721520b0069b75760f9cfa343bb3443 100644 --- a/netbox/client/circuits/circuits_circuits_partial_update_parameters.go +++ b/netbox/client/circuits/circuits_circuits_partial_update_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitsPartialUpdateParams creates a new CircuitsCircuitsPartialUpdateParams object diff --git a/netbox/client/circuits/circuits_circuits_partial_update_responses.go b/netbox/client/circuits/circuits_circuits_partial_update_responses.go index 0080e4747e04a56706c0b0f94b9274a3d412a97e..20f59f1d8be7b7aa9c359f32b541cc8c54b306db 100644 --- a/netbox/client/circuits/circuits_circuits_partial_update_responses.go +++ b/netbox/client/circuits/circuits_circuits_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitsPartialUpdateReader is a Reader for the CircuitsCircuitsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewCircuitsCircuitsPartialUpdateOK() *CircuitsCircuitsPartialUpdateOK { CircuitsCircuitsPartialUpdateOK circuits circuits partial update o k */ type CircuitsCircuitsPartialUpdateOK struct { - Payload *models.WritableCircuit + Payload *models.Circuit } func (o *CircuitsCircuitsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsCircuitsPartialUpdateOK) Error() string { func (o *CircuitsCircuitsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCircuit) + o.Payload = new(models.Circuit) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/circuits/circuits_circuits_read_parameters.go b/netbox/client/circuits/circuits_circuits_read_parameters.go index 855a9ba01857388f8b8cfe8de0a034382eeb880b..da68e152d8bcaeff1a7ff7c8bfe8ab381e910b4b 100644 --- a/netbox/client/circuits/circuits_circuits_read_parameters.go +++ b/netbox/client/circuits/circuits_circuits_read_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_circuits_read_responses.go b/netbox/client/circuits/circuits_circuits_read_responses.go index d907a3d60e7e8dd3faa71e6e2e1911c5648838cf..8b31efb4702f4e6c5f30e35b00fcb3e9305fe3ce 100644 --- a/netbox/client/circuits/circuits_circuits_read_responses.go +++ b/netbox/client/circuits/circuits_circuits_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitsReadReader is a Reader for the CircuitsCircuitsRead structure. diff --git a/netbox/client/circuits/circuits_circuits_update_parameters.go b/netbox/client/circuits/circuits_circuits_update_parameters.go index ac26c68a29ce92b26f2b6fadb58d3b5028be5973..6275a847765df79fec66cd4a299cf56a596716e7 100644 --- a/netbox/client/circuits/circuits_circuits_update_parameters.go +++ b/netbox/client/circuits/circuits_circuits_update_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsCircuitsUpdateParams creates a new CircuitsCircuitsUpdateParams object diff --git a/netbox/client/circuits/circuits_circuits_update_responses.go b/netbox/client/circuits/circuits_circuits_update_responses.go index 11a3ebf9d2f01e2f7870426802e4b6dd33fe9325..77d4e0db2ebf3120dd595a52f69d6dbd7f3a21d0 100644 --- a/netbox/client/circuits/circuits_circuits_update_responses.go +++ b/netbox/client/circuits/circuits_circuits_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsCircuitsUpdateReader is a Reader for the CircuitsCircuitsUpdate structure. @@ -61,7 +61,7 @@ func NewCircuitsCircuitsUpdateOK() *CircuitsCircuitsUpdateOK { CircuitsCircuitsUpdateOK circuits circuits update o k */ type CircuitsCircuitsUpdateOK struct { - Payload *models.WritableCircuit + Payload *models.Circuit } func (o *CircuitsCircuitsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsCircuitsUpdateOK) Error() string { func (o *CircuitsCircuitsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCircuit) + o.Payload = new(models.Circuit) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/circuits/circuits_client.go b/netbox/client/circuits/circuits_client.go index 9f1b9599fa6d50e311413145eb2904e171060540..2d5f59247f544839854fcbd763f56478bf0f9009 100644 --- a/netbox/client/circuits/circuits_client.go +++ b/netbox/client/circuits/circuits_client.go @@ -155,7 +155,7 @@ func (a *Client) CircuitsCircuitTerminationsDelete(params *CircuitsCircuitTermin } /* -CircuitsCircuitTerminationsList circuits circuit terminations list API +CircuitsCircuitTerminationsList Call to super to allow for caching */ func (a *Client) CircuitsCircuitTerminationsList(params *CircuitsCircuitTerminationsListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsListOK, error) { // TODO: Validate the params before sending @@ -213,7 +213,7 @@ func (a *Client) CircuitsCircuitTerminationsPartialUpdate(params *CircuitsCircui } /* -CircuitsCircuitTerminationsRead circuits circuit terminations read API +CircuitsCircuitTerminationsRead Call to super to allow for caching */ func (a *Client) CircuitsCircuitTerminationsRead(params *CircuitsCircuitTerminationsReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsReadOK, error) { // TODO: Validate the params before sending @@ -329,7 +329,7 @@ func (a *Client) CircuitsCircuitTypesDelete(params *CircuitsCircuitTypesDeletePa } /* -CircuitsCircuitTypesList circuits circuit types list API +CircuitsCircuitTypesList Call to super to allow for caching */ func (a *Client) CircuitsCircuitTypesList(params *CircuitsCircuitTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesListOK, error) { // TODO: Validate the params before sending @@ -387,7 +387,7 @@ func (a *Client) CircuitsCircuitTypesPartialUpdate(params *CircuitsCircuitTypesP } /* -CircuitsCircuitTypesRead circuits circuit types read API +CircuitsCircuitTypesRead Call to super to allow for caching */ func (a *Client) CircuitsCircuitTypesRead(params *CircuitsCircuitTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesReadOK, error) { // TODO: Validate the params before sending @@ -503,7 +503,7 @@ func (a *Client) CircuitsCircuitsDelete(params *CircuitsCircuitsDeleteParams, au } /* -CircuitsCircuitsList circuits circuits list API +CircuitsCircuitsList Call to super to allow for caching */ func (a *Client) CircuitsCircuitsList(params *CircuitsCircuitsListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsListOK, error) { // TODO: Validate the params before sending @@ -561,7 +561,7 @@ func (a *Client) CircuitsCircuitsPartialUpdate(params *CircuitsCircuitsPartialUp } /* -CircuitsCircuitsRead circuits circuits read API +CircuitsCircuitsRead Call to super to allow for caching */ func (a *Client) CircuitsCircuitsRead(params *CircuitsCircuitsReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsReadOK, error) { // TODO: Validate the params before sending @@ -706,7 +706,7 @@ func (a *Client) CircuitsProvidersGraphs(params *CircuitsProvidersGraphsParams, } /* -CircuitsProvidersList circuits providers list API +CircuitsProvidersList Call to super to allow for caching */ func (a *Client) CircuitsProvidersList(params *CircuitsProvidersListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersListOK, error) { // TODO: Validate the params before sending @@ -764,7 +764,7 @@ func (a *Client) CircuitsProvidersPartialUpdate(params *CircuitsProvidersPartial } /* -CircuitsProvidersRead circuits providers read API +CircuitsProvidersRead Call to super to allow for caching */ func (a *Client) CircuitsProvidersRead(params *CircuitsProvidersReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersReadOK, error) { // TODO: Validate the params before sending diff --git a/netbox/client/circuits/circuits_providers_create_parameters.go b/netbox/client/circuits/circuits_providers_create_parameters.go index 4faebe3ce36f49c7ebcd47e439d3e5040c05f382..b33eab22f8a83bbad963948085f0161869895c33 100644 --- a/netbox/client/circuits/circuits_providers_create_parameters.go +++ b/netbox/client/circuits/circuits_providers_create_parameters.go @@ -20,18 +20,17 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsProvidersCreateParams creates a new CircuitsProvidersCreateParams object @@ -79,7 +78,7 @@ for the circuits providers create operation typically these are written to a htt type CircuitsProvidersCreateParams struct { /*Data*/ - Data *models.WritableProvider + Data *models.Provider timeout time.Duration Context context.Context @@ -120,13 +119,13 @@ func (o *CircuitsProvidersCreateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the circuits providers create params -func (o *CircuitsProvidersCreateParams) WithData(data *models.WritableProvider) *CircuitsProvidersCreateParams { +func (o *CircuitsProvidersCreateParams) WithData(data *models.Provider) *CircuitsProvidersCreateParams { o.SetData(data) return o } // SetData adds the data to the circuits providers create params -func (o *CircuitsProvidersCreateParams) SetData(data *models.WritableProvider) { +func (o *CircuitsProvidersCreateParams) SetData(data *models.Provider) { o.Data = data } diff --git a/netbox/client/circuits/circuits_providers_create_responses.go b/netbox/client/circuits/circuits_providers_create_responses.go index e1bcea788f0c525f9099222afc170ac13510bb89..6df2f07d7c9f388b3620ace844672c680ea42883 100644 --- a/netbox/client/circuits/circuits_providers_create_responses.go +++ b/netbox/client/circuits/circuits_providers_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsProvidersCreateReader is a Reader for the CircuitsProvidersCreate structure. @@ -61,7 +61,7 @@ func NewCircuitsProvidersCreateCreated() *CircuitsProvidersCreateCreated { CircuitsProvidersCreateCreated circuits providers create created */ type CircuitsProvidersCreateCreated struct { - Payload *models.WritableProvider + Payload *models.Provider } func (o *CircuitsProvidersCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsProvidersCreateCreated) Error() string { func (o *CircuitsProvidersCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableProvider) + o.Payload = new(models.Provider) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/circuits/circuits_providers_delete_parameters.go b/netbox/client/circuits/circuits_providers_delete_parameters.go index f07ad0b772750b02205b09e376417baeb963f276..accb20846e733ce2d315e352902f57c1f599a177 100644 --- a/netbox/client/circuits/circuits_providers_delete_parameters.go +++ b/netbox/client/circuits/circuits_providers_delete_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_providers_graphs_parameters.go b/netbox/client/circuits/circuits_providers_graphs_parameters.go index a3123fba38ba824e23783eb42bc17ee06b1d45c9..3c7316335a4d01c80a14c0d4533264112ae8e1dc 100644 --- a/netbox/client/circuits/circuits_providers_graphs_parameters.go +++ b/netbox/client/circuits/circuits_providers_graphs_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_providers_graphs_responses.go b/netbox/client/circuits/circuits_providers_graphs_responses.go index e57279fb4f0fb6edcc1c9ac10244cf12ffd3baf5..7fd363b88493673a3a90b5461465a5c6322bb057 100644 --- a/netbox/client/circuits/circuits_providers_graphs_responses.go +++ b/netbox/client/circuits/circuits_providers_graphs_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsProvidersGraphsReader is a Reader for the CircuitsProvidersGraphs structure. diff --git a/netbox/client/circuits/circuits_providers_list_parameters.go b/netbox/client/circuits/circuits_providers_list_parameters.go index e7a40c046a5a0951d9acc5063dc849a731e2f3dd..51b9dc1017316ddef56e23ab44a3ca3da0c6b8c4 100644 --- a/netbox/client/circuits/circuits_providers_list_parameters.go +++ b/netbox/client/circuits/circuits_providers_list_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -80,7 +79,7 @@ type CircuitsProvidersListParams struct { /*Account*/ Account *string /*Asn*/ - Asn *float64 + Asn *string /*IDIn Multiple values may be separated by commas. @@ -106,6 +105,8 @@ type CircuitsProvidersListParams struct { SiteID *string /*Slug*/ Slug *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -157,13 +158,13 @@ func (o *CircuitsProvidersListParams) SetAccount(account *string) { } // WithAsn adds the asn to the circuits providers list params -func (o *CircuitsProvidersListParams) WithAsn(asn *float64) *CircuitsProvidersListParams { +func (o *CircuitsProvidersListParams) WithAsn(asn *string) *CircuitsProvidersListParams { o.SetAsn(asn) return o } // SetAsn adds the asn to the circuits providers list params -func (o *CircuitsProvidersListParams) SetAsn(asn *float64) { +func (o *CircuitsProvidersListParams) SetAsn(asn *string) { o.Asn = asn } @@ -255,6 +256,17 @@ func (o *CircuitsProvidersListParams) SetSlug(slug *string) { o.Slug = slug } +// WithTag adds the tag to the circuits providers list params +func (o *CircuitsProvidersListParams) WithTag(tag *string) *CircuitsProvidersListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the circuits providers list params +func (o *CircuitsProvidersListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *CircuitsProvidersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -282,11 +294,11 @@ func (o *CircuitsProvidersListParams) WriteToRequest(r runtime.ClientRequest, re if o.Asn != nil { // query param asn - var qrAsn float64 + var qrAsn string if o.Asn != nil { qrAsn = *o.Asn } - qAsn := swag.FormatFloat64(qrAsn) + qAsn := qrAsn if qAsn != "" { if err := r.SetQueryParam("asn", qAsn); err != nil { return err @@ -423,6 +435,22 @@ func (o *CircuitsProvidersListParams) WriteToRequest(r runtime.ClientRequest, re } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/circuits/circuits_providers_list_responses.go b/netbox/client/circuits/circuits_providers_list_responses.go index 838465f8564104e73dbd7166fa2c836c452945f4..b8f012e64aabe664ce7bd34f01b648b466d90e0d 100644 --- a/netbox/client/circuits/circuits_providers_list_responses.go +++ b/netbox/client/circuits/circuits_providers_list_responses.go @@ -22,12 +22,16 @@ package circuits import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsProvidersListReader is a Reader for the CircuitsProvidersList structure. @@ -61,7 +65,7 @@ func NewCircuitsProvidersListOK() *CircuitsProvidersListOK { CircuitsProvidersListOK circuits providers list o k */ type CircuitsProvidersListOK struct { - Payload *models.CircuitsProvidersListOKBody + Payload *CircuitsProvidersListOKBody } func (o *CircuitsProvidersListOK) Error() string { @@ -70,7 +74,7 @@ func (o *CircuitsProvidersListOK) Error() string { func (o *CircuitsProvidersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.CircuitsProvidersListOKBody) + o.Payload = new(CircuitsProvidersListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *CircuitsProvidersListOK) readResponse(response runtime.ClientResponse, return nil } + +/*CircuitsProvidersListOKBody circuits providers list o k body +swagger:model CircuitsProvidersListOKBody +*/ +type CircuitsProvidersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Provider `json:"results"` +} + +// Validate validates this circuits providers list o k body +func (o *CircuitsProvidersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *CircuitsProvidersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("circuitsProvidersListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *CircuitsProvidersListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("circuitsProvidersListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *CircuitsProvidersListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("circuitsProvidersListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *CircuitsProvidersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("circuitsProvidersListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuitsProvidersListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *CircuitsProvidersListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CircuitsProvidersListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsProvidersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/circuits/circuits_providers_partial_update_parameters.go b/netbox/client/circuits/circuits_providers_partial_update_parameters.go index c1d3d908a8ade60c7f4b99270f4749421052c4ca..0b276f5f0e3d2a2e0adc32ca950fde81adfa16f7 100644 --- a/netbox/client/circuits/circuits_providers_partial_update_parameters.go +++ b/netbox/client/circuits/circuits_providers_partial_update_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsProvidersPartialUpdateParams creates a new CircuitsProvidersPartialUpdateParams object @@ -80,7 +79,7 @@ for the circuits providers partial update operation typically these are written type CircuitsProvidersPartialUpdateParams struct { /*Data*/ - Data *models.WritableProvider + Data *models.Provider /*ID A unique integer value identifying this provider. @@ -126,13 +125,13 @@ func (o *CircuitsProvidersPartialUpdateParams) SetHTTPClient(client *http.Client } // WithData adds the data to the circuits providers partial update params -func (o *CircuitsProvidersPartialUpdateParams) WithData(data *models.WritableProvider) *CircuitsProvidersPartialUpdateParams { +func (o *CircuitsProvidersPartialUpdateParams) WithData(data *models.Provider) *CircuitsProvidersPartialUpdateParams { o.SetData(data) return o } // SetData adds the data to the circuits providers partial update params -func (o *CircuitsProvidersPartialUpdateParams) SetData(data *models.WritableProvider) { +func (o *CircuitsProvidersPartialUpdateParams) SetData(data *models.Provider) { o.Data = data } diff --git a/netbox/client/circuits/circuits_providers_partial_update_responses.go b/netbox/client/circuits/circuits_providers_partial_update_responses.go index 55ca2899c7db8bf54af6bd9f9170b0adf2302ca5..17502f35fc474da928d09809e8a35e5e0befba3a 100644 --- a/netbox/client/circuits/circuits_providers_partial_update_responses.go +++ b/netbox/client/circuits/circuits_providers_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsProvidersPartialUpdateReader is a Reader for the CircuitsProvidersPartialUpdate structure. @@ -61,7 +61,7 @@ func NewCircuitsProvidersPartialUpdateOK() *CircuitsProvidersPartialUpdateOK { CircuitsProvidersPartialUpdateOK circuits providers partial update o k */ type CircuitsProvidersPartialUpdateOK struct { - Payload *models.WritableProvider + Payload *models.Provider } func (o *CircuitsProvidersPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsProvidersPartialUpdateOK) Error() string { func (o *CircuitsProvidersPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableProvider) + o.Payload = new(models.Provider) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/circuits/circuits_providers_read_parameters.go b/netbox/client/circuits/circuits_providers_read_parameters.go index 4fa0f3b049fcd685e9a34918d8b339853e21007c..ce9ce728f0ce08eef46e3ed7abf03680e907ad69 100644 --- a/netbox/client/circuits/circuits_providers_read_parameters.go +++ b/netbox/client/circuits/circuits_providers_read_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/circuits/circuits_providers_read_responses.go b/netbox/client/circuits/circuits_providers_read_responses.go index d62098f8a1cf1f6a4c8e8c02d030850f114545d5..1f0564f61736c3edab5b16c2151ad3b028d45d24 100644 --- a/netbox/client/circuits/circuits_providers_read_responses.go +++ b/netbox/client/circuits/circuits_providers_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsProvidersReadReader is a Reader for the CircuitsProvidersRead structure. diff --git a/netbox/client/circuits/circuits_providers_update_parameters.go b/netbox/client/circuits/circuits_providers_update_parameters.go index 671c5fdeda5bacf84bcbf4ccb6441b589af4eb16..83c8133031f05e3d65522de3cfe923c68b20ec36 100644 --- a/netbox/client/circuits/circuits_providers_update_parameters.go +++ b/netbox/client/circuits/circuits_providers_update_parameters.go @@ -20,11 +20,10 @@ package circuits // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewCircuitsProvidersUpdateParams creates a new CircuitsProvidersUpdateParams object @@ -80,7 +79,7 @@ for the circuits providers update operation typically these are written to a htt type CircuitsProvidersUpdateParams struct { /*Data*/ - Data *models.WritableProvider + Data *models.Provider /*ID A unique integer value identifying this provider. @@ -126,13 +125,13 @@ func (o *CircuitsProvidersUpdateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the circuits providers update params -func (o *CircuitsProvidersUpdateParams) WithData(data *models.WritableProvider) *CircuitsProvidersUpdateParams { +func (o *CircuitsProvidersUpdateParams) WithData(data *models.Provider) *CircuitsProvidersUpdateParams { o.SetData(data) return o } // SetData adds the data to the circuits providers update params -func (o *CircuitsProvidersUpdateParams) SetData(data *models.WritableProvider) { +func (o *CircuitsProvidersUpdateParams) SetData(data *models.Provider) { o.Data = data } diff --git a/netbox/client/circuits/circuits_providers_update_responses.go b/netbox/client/circuits/circuits_providers_update_responses.go index befd105d2e4701b8b1309f5282fb89e46f992623..3fda18cdc008de1f165cce9e5181c2cc46ea5e8c 100644 --- a/netbox/client/circuits/circuits_providers_update_responses.go +++ b/netbox/client/circuits/circuits_providers_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // CircuitsProvidersUpdateReader is a Reader for the CircuitsProvidersUpdate structure. @@ -61,7 +61,7 @@ func NewCircuitsProvidersUpdateOK() *CircuitsProvidersUpdateOK { CircuitsProvidersUpdateOK circuits providers update o k */ type CircuitsProvidersUpdateOK struct { - Payload *models.WritableProvider + Payload *models.Provider } func (o *CircuitsProvidersUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *CircuitsProvidersUpdateOK) Error() string { func (o *CircuitsProvidersUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableProvider) + o.Payload = new(models.Provider) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_cables_create_parameters.go b/netbox/client/dcim/dcim_cables_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e9c6e765fd22fb63afd9e1f13ae5a80dc81524ff --- /dev/null +++ b/netbox/client/dcim/dcim_cables_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimCablesCreateParams creates a new DcimCablesCreateParams object +// with the default values initialized. +func NewDcimCablesCreateParams() *DcimCablesCreateParams { + var () + return &DcimCablesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimCablesCreateParamsWithTimeout creates a new DcimCablesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimCablesCreateParamsWithTimeout(timeout time.Duration) *DcimCablesCreateParams { + var () + return &DcimCablesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimCablesCreateParamsWithContext creates a new DcimCablesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimCablesCreateParamsWithContext(ctx context.Context) *DcimCablesCreateParams { + var () + return &DcimCablesCreateParams{ + + Context: ctx, + } +} + +// NewDcimCablesCreateParamsWithHTTPClient creates a new DcimCablesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimCablesCreateParamsWithHTTPClient(client *http.Client) *DcimCablesCreateParams { + var () + return &DcimCablesCreateParams{ + HTTPClient: client, + } +} + +/*DcimCablesCreateParams contains all the parameters to send to the API endpoint +for the dcim cables create operation typically these are written to a http.Request +*/ +type DcimCablesCreateParams struct { + + /*Data*/ + Data *models.WritableCable + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim cables create params +func (o *DcimCablesCreateParams) WithTimeout(timeout time.Duration) *DcimCablesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim cables create params +func (o *DcimCablesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim cables create params +func (o *DcimCablesCreateParams) WithContext(ctx context.Context) *DcimCablesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim cables create params +func (o *DcimCablesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim cables create params +func (o *DcimCablesCreateParams) WithHTTPClient(client *http.Client) *DcimCablesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim cables create params +func (o *DcimCablesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim cables create params +func (o *DcimCablesCreateParams) WithData(data *models.WritableCable) *DcimCablesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim cables create params +func (o *DcimCablesCreateParams) SetData(data *models.WritableCable) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimCablesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_cables_create_responses.go b/netbox/client/dcim/dcim_cables_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d99173b07eab572d298a4bdd76f87906eb8de924 --- /dev/null +++ b/netbox/client/dcim/dcim_cables_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimCablesCreateReader is a Reader for the DcimCablesCreate structure. +type DcimCablesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimCablesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimCablesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimCablesCreateCreated creates a DcimCablesCreateCreated with default headers values +func NewDcimCablesCreateCreated() *DcimCablesCreateCreated { + return &DcimCablesCreateCreated{} +} + +/*DcimCablesCreateCreated handles this case with default header values. + +DcimCablesCreateCreated dcim cables create created +*/ +type DcimCablesCreateCreated struct { + Payload *models.Cable +} + +func (o *DcimCablesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/cables/][%d] dcimCablesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimCablesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Cable) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_cables_delete_parameters.go b/netbox/client/dcim/dcim_cables_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0558d0cba4801ec4a125758edbcbf7547f8f0be1 --- /dev/null +++ b/netbox/client/dcim/dcim_cables_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimCablesDeleteParams creates a new DcimCablesDeleteParams object +// with the default values initialized. +func NewDcimCablesDeleteParams() *DcimCablesDeleteParams { + var () + return &DcimCablesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimCablesDeleteParamsWithTimeout creates a new DcimCablesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimCablesDeleteParamsWithTimeout(timeout time.Duration) *DcimCablesDeleteParams { + var () + return &DcimCablesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimCablesDeleteParamsWithContext creates a new DcimCablesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimCablesDeleteParamsWithContext(ctx context.Context) *DcimCablesDeleteParams { + var () + return &DcimCablesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimCablesDeleteParamsWithHTTPClient creates a new DcimCablesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimCablesDeleteParamsWithHTTPClient(client *http.Client) *DcimCablesDeleteParams { + var () + return &DcimCablesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimCablesDeleteParams contains all the parameters to send to the API endpoint +for the dcim cables delete operation typically these are written to a http.Request +*/ +type DcimCablesDeleteParams struct { + + /*ID + A unique integer value identifying this cable. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim cables delete params +func (o *DcimCablesDeleteParams) WithTimeout(timeout time.Duration) *DcimCablesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim cables delete params +func (o *DcimCablesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim cables delete params +func (o *DcimCablesDeleteParams) WithContext(ctx context.Context) *DcimCablesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim cables delete params +func (o *DcimCablesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim cables delete params +func (o *DcimCablesDeleteParams) WithHTTPClient(client *http.Client) *DcimCablesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim cables delete params +func (o *DcimCablesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim cables delete params +func (o *DcimCablesDeleteParams) WithID(id int64) *DcimCablesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim cables delete params +func (o *DcimCablesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimCablesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_cables_delete_responses.go b/netbox/client/dcim/dcim_cables_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a068a51f222de59cc56c4595d9f6892ec2a369f3 --- /dev/null +++ b/netbox/client/dcim/dcim_cables_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimCablesDeleteReader is a Reader for the DcimCablesDelete structure. +type DcimCablesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimCablesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimCablesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimCablesDeleteNoContent creates a DcimCablesDeleteNoContent with default headers values +func NewDcimCablesDeleteNoContent() *DcimCablesDeleteNoContent { + return &DcimCablesDeleteNoContent{} +} + +/*DcimCablesDeleteNoContent handles this case with default header values. + +DcimCablesDeleteNoContent dcim cables delete no content +*/ +type DcimCablesDeleteNoContent struct { +} + +func (o *DcimCablesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/cables/{id}/][%d] dcimCablesDeleteNoContent ", 204) +} + +func (o *DcimCablesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_cables_list_parameters.go b/netbox/client/dcim/dcim_cables_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..31d2b38b7a9d88ae21f85a07cc847c1576b5d14e --- /dev/null +++ b/netbox/client/dcim/dcim_cables_list_parameters.go @@ -0,0 +1,484 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimCablesListParams creates a new DcimCablesListParams object +// with the default values initialized. +func NewDcimCablesListParams() *DcimCablesListParams { + var () + return &DcimCablesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimCablesListParamsWithTimeout creates a new DcimCablesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimCablesListParamsWithTimeout(timeout time.Duration) *DcimCablesListParams { + var () + return &DcimCablesListParams{ + + timeout: timeout, + } +} + +// NewDcimCablesListParamsWithContext creates a new DcimCablesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimCablesListParamsWithContext(ctx context.Context) *DcimCablesListParams { + var () + return &DcimCablesListParams{ + + Context: ctx, + } +} + +// NewDcimCablesListParamsWithHTTPClient creates a new DcimCablesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimCablesListParamsWithHTTPClient(client *http.Client) *DcimCablesListParams { + var () + return &DcimCablesListParams{ + HTTPClient: client, + } +} + +/*DcimCablesListParams contains all the parameters to send to the API endpoint +for the dcim cables list operation typically these are written to a http.Request +*/ +type DcimCablesListParams struct { + + /*Color*/ + Color *string + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*ID*/ + ID *string + /*Label*/ + Label *string + /*Length*/ + Length *string + /*LengthUnit*/ + LengthUnit *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Status*/ + Status *string + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim cables list params +func (o *DcimCablesListParams) WithTimeout(timeout time.Duration) *DcimCablesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim cables list params +func (o *DcimCablesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim cables list params +func (o *DcimCablesListParams) WithContext(ctx context.Context) *DcimCablesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim cables list params +func (o *DcimCablesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim cables list params +func (o *DcimCablesListParams) WithHTTPClient(client *http.Client) *DcimCablesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim cables list params +func (o *DcimCablesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColor adds the color to the dcim cables list params +func (o *DcimCablesListParams) WithColor(color *string) *DcimCablesListParams { + o.SetColor(color) + return o +} + +// SetColor adds the color to the dcim cables list params +func (o *DcimCablesListParams) SetColor(color *string) { + o.Color = color +} + +// WithDevice adds the device to the dcim cables list params +func (o *DcimCablesListParams) WithDevice(device *string) *DcimCablesListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim cables list params +func (o *DcimCablesListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim cables list params +func (o *DcimCablesListParams) WithDeviceID(deviceID *string) *DcimCablesListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim cables list params +func (o *DcimCablesListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithID adds the id to the dcim cables list params +func (o *DcimCablesListParams) WithID(id *string) *DcimCablesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim cables list params +func (o *DcimCablesListParams) SetID(id *string) { + o.ID = id +} + +// WithLabel adds the label to the dcim cables list params +func (o *DcimCablesListParams) WithLabel(label *string) *DcimCablesListParams { + o.SetLabel(label) + return o +} + +// SetLabel adds the label to the dcim cables list params +func (o *DcimCablesListParams) SetLabel(label *string) { + o.Label = label +} + +// WithLength adds the length to the dcim cables list params +func (o *DcimCablesListParams) WithLength(length *string) *DcimCablesListParams { + o.SetLength(length) + return o +} + +// SetLength adds the length to the dcim cables list params +func (o *DcimCablesListParams) SetLength(length *string) { + o.Length = length +} + +// WithLengthUnit adds the lengthUnit to the dcim cables list params +func (o *DcimCablesListParams) WithLengthUnit(lengthUnit *string) *DcimCablesListParams { + o.SetLengthUnit(lengthUnit) + return o +} + +// SetLengthUnit adds the lengthUnit to the dcim cables list params +func (o *DcimCablesListParams) SetLengthUnit(lengthUnit *string) { + o.LengthUnit = lengthUnit +} + +// WithLimit adds the limit to the dcim cables list params +func (o *DcimCablesListParams) WithLimit(limit *int64) *DcimCablesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim cables list params +func (o *DcimCablesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the dcim cables list params +func (o *DcimCablesListParams) WithOffset(offset *int64) *DcimCablesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim cables list params +func (o *DcimCablesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim cables list params +func (o *DcimCablesListParams) WithQ(q *string) *DcimCablesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim cables list params +func (o *DcimCablesListParams) SetQ(q *string) { + o.Q = q +} + +// WithStatus adds the status to the dcim cables list params +func (o *DcimCablesListParams) WithStatus(status *string) *DcimCablesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the dcim cables list params +func (o *DcimCablesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithType adds the typeVar to the dcim cables list params +func (o *DcimCablesListParams) WithType(typeVar *string) *DcimCablesListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim cables list params +func (o *DcimCablesListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimCablesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Color != nil { + + // query param color + var qrColor string + if o.Color != nil { + qrColor = *o.Color + } + qColor := qrColor + if qColor != "" { + if err := r.SetQueryParam("color", qColor); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Label != nil { + + // query param label + var qrLabel string + if o.Label != nil { + qrLabel = *o.Label + } + qLabel := qrLabel + if qLabel != "" { + if err := r.SetQueryParam("label", qLabel); err != nil { + return err + } + } + + } + + if o.Length != nil { + + // query param length + var qrLength string + if o.Length != nil { + qrLength = *o.Length + } + qLength := qrLength + if qLength != "" { + if err := r.SetQueryParam("length", qLength); err != nil { + return err + } + } + + } + + if o.LengthUnit != nil { + + // query param length_unit + var qrLengthUnit string + if o.LengthUnit != nil { + qrLengthUnit = *o.LengthUnit + } + qLengthUnit := qrLengthUnit + if qLengthUnit != "" { + if err := r.SetQueryParam("length_unit", qLengthUnit); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Status != nil { + + // query param status + var qrStatus string + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_cables_list_responses.go b/netbox/client/dcim/dcim_cables_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a2c0bf249571ba46df36e0c949bd122f792dc183 --- /dev/null +++ b/netbox/client/dcim/dcim_cables_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimCablesListReader is a Reader for the DcimCablesList structure. +type DcimCablesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimCablesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimCablesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimCablesListOK creates a DcimCablesListOK with default headers values +func NewDcimCablesListOK() *DcimCablesListOK { + return &DcimCablesListOK{} +} + +/*DcimCablesListOK handles this case with default header values. + +DcimCablesListOK dcim cables list o k +*/ +type DcimCablesListOK struct { + Payload *DcimCablesListOKBody +} + +func (o *DcimCablesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/cables/][%d] dcimCablesListOK %+v", 200, o.Payload) +} + +func (o *DcimCablesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(DcimCablesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*DcimCablesListOKBody dcim cables list o k body +swagger:model DcimCablesListOKBody +*/ +type DcimCablesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Cable `json:"results"` +} + +// Validate validates this dcim cables list o k body +func (o *DcimCablesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimCablesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimCablesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimCablesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimCablesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimCablesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimCablesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimCablesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimCablesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimCablesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimCablesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimCablesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimCablesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_cables_partial_update_parameters.go b/netbox/client/dcim/dcim_cables_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f925f88cfc19e9e3986bed3b7b89413b539ebada --- /dev/null +++ b/netbox/client/dcim/dcim_cables_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimCablesPartialUpdateParams creates a new DcimCablesPartialUpdateParams object +// with the default values initialized. +func NewDcimCablesPartialUpdateParams() *DcimCablesPartialUpdateParams { + var () + return &DcimCablesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimCablesPartialUpdateParamsWithTimeout creates a new DcimCablesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimCablesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimCablesPartialUpdateParams { + var () + return &DcimCablesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimCablesPartialUpdateParamsWithContext creates a new DcimCablesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimCablesPartialUpdateParamsWithContext(ctx context.Context) *DcimCablesPartialUpdateParams { + var () + return &DcimCablesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimCablesPartialUpdateParamsWithHTTPClient creates a new DcimCablesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimCablesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimCablesPartialUpdateParams { + var () + return &DcimCablesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimCablesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim cables partial update operation typically these are written to a http.Request +*/ +type DcimCablesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableCable + /*ID + A unique integer value identifying this cable. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimCablesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) WithContext(ctx context.Context) *DcimCablesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimCablesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) WithData(data *models.WritableCable) *DcimCablesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) SetData(data *models.WritableCable) { + o.Data = data +} + +// WithID adds the id to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) WithID(id int64) *DcimCablesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim cables partial update params +func (o *DcimCablesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimCablesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_cables_partial_update_responses.go b/netbox/client/dcim/dcim_cables_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7f997c9368999788282ae3c33a2dc7cc0547d09e --- /dev/null +++ b/netbox/client/dcim/dcim_cables_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimCablesPartialUpdateReader is a Reader for the DcimCablesPartialUpdate structure. +type DcimCablesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimCablesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimCablesPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimCablesPartialUpdateOK creates a DcimCablesPartialUpdateOK with default headers values +func NewDcimCablesPartialUpdateOK() *DcimCablesPartialUpdateOK { + return &DcimCablesPartialUpdateOK{} +} + +/*DcimCablesPartialUpdateOK handles this case with default header values. + +DcimCablesPartialUpdateOK dcim cables partial update o k +*/ +type DcimCablesPartialUpdateOK struct { + Payload *models.Cable +} + +func (o *DcimCablesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/cables/{id}/][%d] dcimCablesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimCablesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Cable) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_cables_read_parameters.go b/netbox/client/dcim/dcim_cables_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6abdbd289b4ee7a09f91735db30b9c3b7b11c144 --- /dev/null +++ b/netbox/client/dcim/dcim_cables_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimCablesReadParams creates a new DcimCablesReadParams object +// with the default values initialized. +func NewDcimCablesReadParams() *DcimCablesReadParams { + var () + return &DcimCablesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimCablesReadParamsWithTimeout creates a new DcimCablesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimCablesReadParamsWithTimeout(timeout time.Duration) *DcimCablesReadParams { + var () + return &DcimCablesReadParams{ + + timeout: timeout, + } +} + +// NewDcimCablesReadParamsWithContext creates a new DcimCablesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimCablesReadParamsWithContext(ctx context.Context) *DcimCablesReadParams { + var () + return &DcimCablesReadParams{ + + Context: ctx, + } +} + +// NewDcimCablesReadParamsWithHTTPClient creates a new DcimCablesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimCablesReadParamsWithHTTPClient(client *http.Client) *DcimCablesReadParams { + var () + return &DcimCablesReadParams{ + HTTPClient: client, + } +} + +/*DcimCablesReadParams contains all the parameters to send to the API endpoint +for the dcim cables read operation typically these are written to a http.Request +*/ +type DcimCablesReadParams struct { + + /*ID + A unique integer value identifying this cable. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim cables read params +func (o *DcimCablesReadParams) WithTimeout(timeout time.Duration) *DcimCablesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim cables read params +func (o *DcimCablesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim cables read params +func (o *DcimCablesReadParams) WithContext(ctx context.Context) *DcimCablesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim cables read params +func (o *DcimCablesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim cables read params +func (o *DcimCablesReadParams) WithHTTPClient(client *http.Client) *DcimCablesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim cables read params +func (o *DcimCablesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim cables read params +func (o *DcimCablesReadParams) WithID(id int64) *DcimCablesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim cables read params +func (o *DcimCablesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimCablesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_cables_read_responses.go b/netbox/client/dcim/dcim_cables_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..078b280295d1ec6745dd39c22a357f5fe9af5563 --- /dev/null +++ b/netbox/client/dcim/dcim_cables_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimCablesReadReader is a Reader for the DcimCablesRead structure. +type DcimCablesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimCablesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimCablesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimCablesReadOK creates a DcimCablesReadOK with default headers values +func NewDcimCablesReadOK() *DcimCablesReadOK { + return &DcimCablesReadOK{} +} + +/*DcimCablesReadOK handles this case with default header values. + +DcimCablesReadOK dcim cables read o k +*/ +type DcimCablesReadOK struct { + Payload *models.Cable +} + +func (o *DcimCablesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/cables/{id}/][%d] dcimCablesReadOK %+v", 200, o.Payload) +} + +func (o *DcimCablesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Cable) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_cables_update_parameters.go b/netbox/client/dcim/dcim_cables_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..476d218f62e4d064b6eb28a2de112dfcbf24082f --- /dev/null +++ b/netbox/client/dcim/dcim_cables_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimCablesUpdateParams creates a new DcimCablesUpdateParams object +// with the default values initialized. +func NewDcimCablesUpdateParams() *DcimCablesUpdateParams { + var () + return &DcimCablesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimCablesUpdateParamsWithTimeout creates a new DcimCablesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimCablesUpdateParamsWithTimeout(timeout time.Duration) *DcimCablesUpdateParams { + var () + return &DcimCablesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimCablesUpdateParamsWithContext creates a new DcimCablesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimCablesUpdateParamsWithContext(ctx context.Context) *DcimCablesUpdateParams { + var () + return &DcimCablesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimCablesUpdateParamsWithHTTPClient creates a new DcimCablesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimCablesUpdateParamsWithHTTPClient(client *http.Client) *DcimCablesUpdateParams { + var () + return &DcimCablesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimCablesUpdateParams contains all the parameters to send to the API endpoint +for the dcim cables update operation typically these are written to a http.Request +*/ +type DcimCablesUpdateParams struct { + + /*Data*/ + Data *models.WritableCable + /*ID + A unique integer value identifying this cable. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim cables update params +func (o *DcimCablesUpdateParams) WithTimeout(timeout time.Duration) *DcimCablesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim cables update params +func (o *DcimCablesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim cables update params +func (o *DcimCablesUpdateParams) WithContext(ctx context.Context) *DcimCablesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim cables update params +func (o *DcimCablesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim cables update params +func (o *DcimCablesUpdateParams) WithHTTPClient(client *http.Client) *DcimCablesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim cables update params +func (o *DcimCablesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim cables update params +func (o *DcimCablesUpdateParams) WithData(data *models.WritableCable) *DcimCablesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim cables update params +func (o *DcimCablesUpdateParams) SetData(data *models.WritableCable) { + o.Data = data +} + +// WithID adds the id to the dcim cables update params +func (o *DcimCablesUpdateParams) WithID(id int64) *DcimCablesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim cables update params +func (o *DcimCablesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimCablesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amservices_list_responses.go b/netbox/client/dcim/dcim_cables_update_responses.go similarity index 64% rename from netbox/client/ipam/ip_amservices_list_responses.go rename to netbox/client/dcim/dcim_cables_update_responses.go index 22ec9b480a65662811abdb358d77a8e2ba8ab012..379bfb15a71406bdbd08c050d207d2b90d1d8656 100644 --- a/netbox/client/ipam/ip_amservices_list_responses.go +++ b/netbox/client/dcim/dcim_cables_update_responses.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package ipam +package dcim // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// IPAMServicesListReader is a Reader for the IPAMServicesList structure. -type IPAMServicesListReader struct { +// DcimCablesUpdateReader is a Reader for the DcimCablesUpdate structure. +type DcimCablesUpdateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IPAMServicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimCablesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIPAMServicesListOK() + result := NewDcimCablesUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *IPAMServicesListReader) ReadResponse(response runtime.ClientResponse, c } } -// NewIPAMServicesListOK creates a IPAMServicesListOK with default headers values -func NewIPAMServicesListOK() *IPAMServicesListOK { - return &IPAMServicesListOK{} +// NewDcimCablesUpdateOK creates a DcimCablesUpdateOK with default headers values +func NewDcimCablesUpdateOK() *DcimCablesUpdateOK { + return &DcimCablesUpdateOK{} } -/*IPAMServicesListOK handles this case with default header values. +/*DcimCablesUpdateOK handles this case with default header values. -IPAMServicesListOK ipam services list o k +DcimCablesUpdateOK dcim cables update o k */ -type IPAMServicesListOK struct { - Payload *models.IPAMServicesListOKBody +type DcimCablesUpdateOK struct { + Payload *models.Cable } -func (o *IPAMServicesListOK) Error() string { - return fmt.Sprintf("[GET /ipam/services/][%d] ipamServicesListOK %+v", 200, o.Payload) +func (o *DcimCablesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/cables/{id}/][%d] dcimCablesUpdateOK %+v", 200, o.Payload) } -func (o *IPAMServicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimCablesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.IPAMServicesListOKBody) + o.Payload = new(models.Cable) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_choices_list_parameters.go b/netbox/client/dcim/dcim_choices_list_parameters.go index 675a84370df67a7423d9294770ecc5f770c0199e..43b8eb9d9efe4d4d9ee1f40fe873ad6b7033c673 100644 --- a/netbox/client/dcim/dcim_choices_list_parameters.go +++ b/netbox/client/dcim/dcim_choices_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_choices_read_parameters.go b/netbox/client/dcim/dcim_choices_read_parameters.go index f0757bd50d5105f991aeddf6e72f530f1e006e06..d178f4d07e3ffc3af1fd9ecb95a2cc33140b6af4 100644 --- a/netbox/client/dcim/dcim_choices_read_parameters.go +++ b/netbox/client/dcim/dcim_choices_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_client.go b/netbox/client/dcim/dcim_client.go index 4f088b891404f889d6d1a82d3b5b503153c8e39c..b59c2066c528f4b062e86350ba6e5f2f4172c342 100644 --- a/netbox/client/dcim/dcim_client.go +++ b/netbox/client/dcim/dcim_client.go @@ -96,13 +96,187 @@ func (a *Client) DcimChoicesRead(params *DcimChoicesReadParams, authInfo runtime } +/* +DcimCablesCreate dcim cables create API +*/ +func (a *Client) DcimCablesCreate(params *DcimCablesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimCablesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimCablesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_cables_create", + Method: "POST", + PathPattern: "/dcim/cables/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimCablesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimCablesCreateCreated), nil + +} + +/* +DcimCablesDelete dcim cables delete API +*/ +func (a *Client) DcimCablesDelete(params *DcimCablesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimCablesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimCablesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_cables_delete", + Method: "DELETE", + PathPattern: "/dcim/cables/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimCablesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimCablesDeleteNoContent), nil + +} + +/* +DcimCablesList Call to super to allow for caching +*/ +func (a *Client) DcimCablesList(params *DcimCablesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimCablesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimCablesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_cables_list", + Method: "GET", + PathPattern: "/dcim/cables/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimCablesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimCablesListOK), nil + +} + +/* +DcimCablesPartialUpdate dcim cables partial update API +*/ +func (a *Client) DcimCablesPartialUpdate(params *DcimCablesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimCablesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimCablesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_cables_partial_update", + Method: "PATCH", + PathPattern: "/dcim/cables/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimCablesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimCablesPartialUpdateOK), nil + +} + +/* +DcimCablesRead Call to super to allow for caching +*/ +func (a *Client) DcimCablesRead(params *DcimCablesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimCablesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimCablesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_cables_read", + Method: "GET", + PathPattern: "/dcim/cables/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimCablesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimCablesReadOK), nil + +} + +/* +DcimCablesUpdate dcim cables update API +*/ +func (a *Client) DcimCablesUpdate(params *DcimCablesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimCablesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimCablesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_cables_update", + Method: "PUT", + PathPattern: "/dcim/cables/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimCablesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimCablesUpdateOK), nil + +} + /* DcimConnectedDeviceList This endpoint allows a user to determine what device (if any) is connected to a given peer device and peer interface. This is useful in a situation where a device boots with no configuration, but can detect its neighbors via a protocol such as LLDP. Two query parameters must be included in the request: -* `peer-device`: The name of the peer device -* `peer-interface`: The name of the peer interface +* `peer_device`: The name of the peer device +* `peer_interface`: The name of the peer interface */ func (a *Client) DcimConnectedDeviceList(params *DcimConnectedDeviceListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConnectedDeviceListOK, error) { // TODO: Validate the params before sending @@ -218,7 +392,7 @@ func (a *Client) DcimConsolePortTemplatesDelete(params *DcimConsolePortTemplates } /* -DcimConsolePortTemplatesList dcim console port templates list API +DcimConsolePortTemplatesList Call to super to allow for caching */ func (a *Client) DcimConsolePortTemplatesList(params *DcimConsolePortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesListOK, error) { // TODO: Validate the params before sending @@ -276,7 +450,7 @@ func (a *Client) DcimConsolePortTemplatesPartialUpdate(params *DcimConsolePortTe } /* -DcimConsolePortTemplatesRead dcim console port templates read API +DcimConsolePortTemplatesRead Call to super to allow for caching */ func (a *Client) DcimConsolePortTemplatesRead(params *DcimConsolePortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesReadOK, error) { // TODO: Validate the params before sending @@ -392,7 +566,7 @@ func (a *Client) DcimConsolePortsDelete(params *DcimConsolePortsDeleteParams, au } /* -DcimConsolePortsList dcim console ports list API +DcimConsolePortsList Call to super to allow for caching */ func (a *Client) DcimConsolePortsList(params *DcimConsolePortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsListOK, error) { // TODO: Validate the params before sending @@ -450,7 +624,7 @@ func (a *Client) DcimConsolePortsPartialUpdate(params *DcimConsolePortsPartialUp } /* -DcimConsolePortsRead dcim console ports read API +DcimConsolePortsRead Call to super to allow for caching */ func (a *Client) DcimConsolePortsRead(params *DcimConsolePortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsReadOK, error) { // TODO: Validate the params before sending @@ -478,6 +652,35 @@ func (a *Client) DcimConsolePortsRead(params *DcimConsolePortsReadParams, authIn } +/* +DcimConsolePortsTrace Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). +*/ +func (a *Client) DcimConsolePortsTrace(params *DcimConsolePortsTraceParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsTraceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsTraceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_trace", + Method: "GET", + PathPattern: "/dcim/console-ports/{id}/trace/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsTraceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsTraceOK), nil + +} + /* DcimConsolePortsUpdate dcim console ports update API */ @@ -566,7 +769,7 @@ func (a *Client) DcimConsoleServerPortTemplatesDelete(params *DcimConsoleServerP } /* -DcimConsoleServerPortTemplatesList dcim console server port templates list API +DcimConsoleServerPortTemplatesList Call to super to allow for caching */ func (a *Client) DcimConsoleServerPortTemplatesList(params *DcimConsoleServerPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesListOK, error) { // TODO: Validate the params before sending @@ -624,7 +827,7 @@ func (a *Client) DcimConsoleServerPortTemplatesPartialUpdate(params *DcimConsole } /* -DcimConsoleServerPortTemplatesRead dcim console server port templates read API +DcimConsoleServerPortTemplatesRead Call to super to allow for caching */ func (a *Client) DcimConsoleServerPortTemplatesRead(params *DcimConsoleServerPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesReadOK, error) { // TODO: Validate the params before sending @@ -740,7 +943,7 @@ func (a *Client) DcimConsoleServerPortsDelete(params *DcimConsoleServerPortsDele } /* -DcimConsoleServerPortsList dcim console server ports list API +DcimConsoleServerPortsList Call to super to allow for caching */ func (a *Client) DcimConsoleServerPortsList(params *DcimConsoleServerPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsListOK, error) { // TODO: Validate the params before sending @@ -798,7 +1001,7 @@ func (a *Client) DcimConsoleServerPortsPartialUpdate(params *DcimConsoleServerPo } /* -DcimConsoleServerPortsRead dcim console server ports read API +DcimConsoleServerPortsRead Call to super to allow for caching */ func (a *Client) DcimConsoleServerPortsRead(params *DcimConsoleServerPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsReadOK, error) { // TODO: Validate the params before sending @@ -826,6 +1029,35 @@ func (a *Client) DcimConsoleServerPortsRead(params *DcimConsoleServerPortsReadPa } +/* +DcimConsoleServerPortsTrace Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). +*/ +func (a *Client) DcimConsoleServerPortsTrace(params *DcimConsoleServerPortsTraceParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsTraceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsTraceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_trace", + Method: "GET", + PathPattern: "/dcim/console-server-ports/{id}/trace/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsTraceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsTraceOK), nil + +} + /* DcimConsoleServerPortsUpdate dcim console server ports update API */ @@ -914,7 +1146,7 @@ func (a *Client) DcimDeviceBayTemplatesDelete(params *DcimDeviceBayTemplatesDele } /* -DcimDeviceBayTemplatesList dcim device bay templates list API +DcimDeviceBayTemplatesList Call to super to allow for caching */ func (a *Client) DcimDeviceBayTemplatesList(params *DcimDeviceBayTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesListOK, error) { // TODO: Validate the params before sending @@ -972,7 +1204,7 @@ func (a *Client) DcimDeviceBayTemplatesPartialUpdate(params *DcimDeviceBayTempla } /* -DcimDeviceBayTemplatesRead dcim device bay templates read API +DcimDeviceBayTemplatesRead Call to super to allow for caching */ func (a *Client) DcimDeviceBayTemplatesRead(params *DcimDeviceBayTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesReadOK, error) { // TODO: Validate the params before sending @@ -1088,7 +1320,7 @@ func (a *Client) DcimDeviceBaysDelete(params *DcimDeviceBaysDeleteParams, authIn } /* -DcimDeviceBaysList dcim device bays list API +DcimDeviceBaysList Call to super to allow for caching */ func (a *Client) DcimDeviceBaysList(params *DcimDeviceBaysListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysListOK, error) { // TODO: Validate the params before sending @@ -1146,7 +1378,7 @@ func (a *Client) DcimDeviceBaysPartialUpdate(params *DcimDeviceBaysPartialUpdate } /* -DcimDeviceBaysRead dcim device bays read API +DcimDeviceBaysRead Call to super to allow for caching */ func (a *Client) DcimDeviceBaysRead(params *DcimDeviceBaysReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysReadOK, error) { // TODO: Validate the params before sending @@ -1262,7 +1494,7 @@ func (a *Client) DcimDeviceRolesDelete(params *DcimDeviceRolesDeleteParams, auth } /* -DcimDeviceRolesList dcim device roles list API +DcimDeviceRolesList Call to super to allow for caching */ func (a *Client) DcimDeviceRolesList(params *DcimDeviceRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesListOK, error) { // TODO: Validate the params before sending @@ -1320,7 +1552,7 @@ func (a *Client) DcimDeviceRolesPartialUpdate(params *DcimDeviceRolesPartialUpda } /* -DcimDeviceRolesRead dcim device roles read API +DcimDeviceRolesRead Call to super to allow for caching */ func (a *Client) DcimDeviceRolesRead(params *DcimDeviceRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesReadOK, error) { // TODO: Validate the params before sending @@ -1436,7 +1668,7 @@ func (a *Client) DcimDeviceTypesDelete(params *DcimDeviceTypesDeleteParams, auth } /* -DcimDeviceTypesList dcim device types list API +DcimDeviceTypesList Call to super to allow for caching */ func (a *Client) DcimDeviceTypesList(params *DcimDeviceTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesListOK, error) { // TODO: Validate the params before sending @@ -1494,7 +1726,7 @@ func (a *Client) DcimDeviceTypesPartialUpdate(params *DcimDeviceTypesPartialUpda } /* -DcimDeviceTypesRead dcim device types read API +DcimDeviceTypesRead Call to super to allow for caching */ func (a *Client) DcimDeviceTypesRead(params *DcimDeviceTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesReadOK, error) { // TODO: Validate the params before sending @@ -1610,7 +1842,7 @@ func (a *Client) DcimDevicesDelete(params *DcimDevicesDeleteParams, authInfo run } /* -DcimDevicesList dcim devices list API +DcimDevicesList Call to super to allow for caching */ func (a *Client) DcimDevicesList(params *DcimDevicesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesListOK, error) { // TODO: Validate the params before sending @@ -1697,7 +1929,7 @@ func (a *Client) DcimDevicesPartialUpdate(params *DcimDevicesPartialUpdateParams } /* -DcimDevicesRead dcim devices read API +DcimDevicesRead Call to super to allow for caching */ func (a *Client) DcimDevicesRead(params *DcimDevicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesReadOK, error) { // TODO: Validate the params before sending @@ -1755,23 +1987,23 @@ func (a *Client) DcimDevicesUpdate(params *DcimDevicesUpdateParams, authInfo run } /* -DcimInterfaceConnectionsCreate dcim interface connections create API +DcimFrontPortTemplatesCreate dcim front port templates create API */ -func (a *Client) DcimInterfaceConnectionsCreate(params *DcimInterfaceConnectionsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsCreateCreated, error) { +func (a *Client) DcimFrontPortTemplatesCreate(params *DcimFrontPortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortTemplatesCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceConnectionsCreateParams() + params = NewDcimFrontPortTemplatesCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-connections_create", + ID: "dcim_front-port-templates_create", Method: "POST", - PathPattern: "/dcim/interface-connections/", + PathPattern: "/dcim/front-port-templates/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceConnectionsCreateReader{formats: a.formats}, + Reader: &DcimFrontPortTemplatesCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1779,28 +2011,28 @@ func (a *Client) DcimInterfaceConnectionsCreate(params *DcimInterfaceConnections if err != nil { return nil, err } - return result.(*DcimInterfaceConnectionsCreateCreated), nil + return result.(*DcimFrontPortTemplatesCreateCreated), nil } /* -DcimInterfaceConnectionsDelete dcim interface connections delete API +DcimFrontPortTemplatesDelete dcim front port templates delete API */ -func (a *Client) DcimInterfaceConnectionsDelete(params *DcimInterfaceConnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsDeleteNoContent, error) { +func (a *Client) DcimFrontPortTemplatesDelete(params *DcimFrontPortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortTemplatesDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceConnectionsDeleteParams() + params = NewDcimFrontPortTemplatesDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-connections_delete", + ID: "dcim_front-port-templates_delete", Method: "DELETE", - PathPattern: "/dcim/interface-connections/{id}/", + PathPattern: "/dcim/front-port-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceConnectionsDeleteReader{formats: a.formats}, + Reader: &DcimFrontPortTemplatesDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1808,28 +2040,28 @@ func (a *Client) DcimInterfaceConnectionsDelete(params *DcimInterfaceConnections if err != nil { return nil, err } - return result.(*DcimInterfaceConnectionsDeleteNoContent), nil + return result.(*DcimFrontPortTemplatesDeleteNoContent), nil } /* -DcimInterfaceConnectionsList dcim interface connections list API +DcimFrontPortTemplatesList Call to super to allow for caching */ -func (a *Client) DcimInterfaceConnectionsList(params *DcimInterfaceConnectionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsListOK, error) { +func (a *Client) DcimFrontPortTemplatesList(params *DcimFrontPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortTemplatesListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceConnectionsListParams() + params = NewDcimFrontPortTemplatesListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-connections_list", + ID: "dcim_front-port-templates_list", Method: "GET", - PathPattern: "/dcim/interface-connections/", + PathPattern: "/dcim/front-port-templates/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceConnectionsListReader{formats: a.formats}, + Reader: &DcimFrontPortTemplatesListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1837,28 +2069,28 @@ func (a *Client) DcimInterfaceConnectionsList(params *DcimInterfaceConnectionsLi if err != nil { return nil, err } - return result.(*DcimInterfaceConnectionsListOK), nil + return result.(*DcimFrontPortTemplatesListOK), nil } /* -DcimInterfaceConnectionsPartialUpdate dcim interface connections partial update API +DcimFrontPortTemplatesPartialUpdate dcim front port templates partial update API */ -func (a *Client) DcimInterfaceConnectionsPartialUpdate(params *DcimInterfaceConnectionsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsPartialUpdateOK, error) { +func (a *Client) DcimFrontPortTemplatesPartialUpdate(params *DcimFrontPortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortTemplatesPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceConnectionsPartialUpdateParams() + params = NewDcimFrontPortTemplatesPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-connections_partial_update", + ID: "dcim_front-port-templates_partial_update", Method: "PATCH", - PathPattern: "/dcim/interface-connections/{id}/", + PathPattern: "/dcim/front-port-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceConnectionsPartialUpdateReader{formats: a.formats}, + Reader: &DcimFrontPortTemplatesPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1866,28 +2098,28 @@ func (a *Client) DcimInterfaceConnectionsPartialUpdate(params *DcimInterfaceConn if err != nil { return nil, err } - return result.(*DcimInterfaceConnectionsPartialUpdateOK), nil + return result.(*DcimFrontPortTemplatesPartialUpdateOK), nil } /* -DcimInterfaceConnectionsRead dcim interface connections read API +DcimFrontPortTemplatesRead Call to super to allow for caching */ -func (a *Client) DcimInterfaceConnectionsRead(params *DcimInterfaceConnectionsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsReadOK, error) { +func (a *Client) DcimFrontPortTemplatesRead(params *DcimFrontPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortTemplatesReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceConnectionsReadParams() + params = NewDcimFrontPortTemplatesReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-connections_read", + ID: "dcim_front-port-templates_read", Method: "GET", - PathPattern: "/dcim/interface-connections/{id}/", + PathPattern: "/dcim/front-port-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceConnectionsReadReader{formats: a.formats}, + Reader: &DcimFrontPortTemplatesReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1895,28 +2127,28 @@ func (a *Client) DcimInterfaceConnectionsRead(params *DcimInterfaceConnectionsRe if err != nil { return nil, err } - return result.(*DcimInterfaceConnectionsReadOK), nil + return result.(*DcimFrontPortTemplatesReadOK), nil } /* -DcimInterfaceConnectionsUpdate dcim interface connections update API +DcimFrontPortTemplatesUpdate dcim front port templates update API */ -func (a *Client) DcimInterfaceConnectionsUpdate(params *DcimInterfaceConnectionsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsUpdateOK, error) { +func (a *Client) DcimFrontPortTemplatesUpdate(params *DcimFrontPortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortTemplatesUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceConnectionsUpdateParams() + params = NewDcimFrontPortTemplatesUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-connections_update", + ID: "dcim_front-port-templates_update", Method: "PUT", - PathPattern: "/dcim/interface-connections/{id}/", + PathPattern: "/dcim/front-port-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceConnectionsUpdateReader{formats: a.formats}, + Reader: &DcimFrontPortTemplatesUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1924,28 +2156,28 @@ func (a *Client) DcimInterfaceConnectionsUpdate(params *DcimInterfaceConnections if err != nil { return nil, err } - return result.(*DcimInterfaceConnectionsUpdateOK), nil + return result.(*DcimFrontPortTemplatesUpdateOK), nil } /* -DcimInterfaceTemplatesCreate dcim interface templates create API +DcimFrontPortsCreate dcim front ports create API */ -func (a *Client) DcimInterfaceTemplatesCreate(params *DcimInterfaceTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesCreateCreated, error) { +func (a *Client) DcimFrontPortsCreate(params *DcimFrontPortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortsCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceTemplatesCreateParams() + params = NewDcimFrontPortsCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-templates_create", + ID: "dcim_front-ports_create", Method: "POST", - PathPattern: "/dcim/interface-templates/", + PathPattern: "/dcim/front-ports/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceTemplatesCreateReader{formats: a.formats}, + Reader: &DcimFrontPortsCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1953,28 +2185,28 @@ func (a *Client) DcimInterfaceTemplatesCreate(params *DcimInterfaceTemplatesCrea if err != nil { return nil, err } - return result.(*DcimInterfaceTemplatesCreateCreated), nil + return result.(*DcimFrontPortsCreateCreated), nil } /* -DcimInterfaceTemplatesDelete dcim interface templates delete API +DcimFrontPortsDelete dcim front ports delete API */ -func (a *Client) DcimInterfaceTemplatesDelete(params *DcimInterfaceTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesDeleteNoContent, error) { +func (a *Client) DcimFrontPortsDelete(params *DcimFrontPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortsDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceTemplatesDeleteParams() + params = NewDcimFrontPortsDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-templates_delete", + ID: "dcim_front-ports_delete", Method: "DELETE", - PathPattern: "/dcim/interface-templates/{id}/", + PathPattern: "/dcim/front-ports/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceTemplatesDeleteReader{formats: a.formats}, + Reader: &DcimFrontPortsDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -1982,28 +2214,28 @@ func (a *Client) DcimInterfaceTemplatesDelete(params *DcimInterfaceTemplatesDele if err != nil { return nil, err } - return result.(*DcimInterfaceTemplatesDeleteNoContent), nil + return result.(*DcimFrontPortsDeleteNoContent), nil } /* -DcimInterfaceTemplatesList dcim interface templates list API +DcimFrontPortsList Call to super to allow for caching */ -func (a *Client) DcimInterfaceTemplatesList(params *DcimInterfaceTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesListOK, error) { +func (a *Client) DcimFrontPortsList(params *DcimFrontPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceTemplatesListParams() + params = NewDcimFrontPortsListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-templates_list", + ID: "dcim_front-ports_list", Method: "GET", - PathPattern: "/dcim/interface-templates/", + PathPattern: "/dcim/front-ports/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceTemplatesListReader{formats: a.formats}, + Reader: &DcimFrontPortsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2011,28 +2243,28 @@ func (a *Client) DcimInterfaceTemplatesList(params *DcimInterfaceTemplatesListPa if err != nil { return nil, err } - return result.(*DcimInterfaceTemplatesListOK), nil + return result.(*DcimFrontPortsListOK), nil } /* -DcimInterfaceTemplatesPartialUpdate dcim interface templates partial update API +DcimFrontPortsPartialUpdate dcim front ports partial update API */ -func (a *Client) DcimInterfaceTemplatesPartialUpdate(params *DcimInterfaceTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesPartialUpdateOK, error) { +func (a *Client) DcimFrontPortsPartialUpdate(params *DcimFrontPortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortsPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceTemplatesPartialUpdateParams() + params = NewDcimFrontPortsPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-templates_partial_update", + ID: "dcim_front-ports_partial_update", Method: "PATCH", - PathPattern: "/dcim/interface-templates/{id}/", + PathPattern: "/dcim/front-ports/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceTemplatesPartialUpdateReader{formats: a.formats}, + Reader: &DcimFrontPortsPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2040,28 +2272,28 @@ func (a *Client) DcimInterfaceTemplatesPartialUpdate(params *DcimInterfaceTempla if err != nil { return nil, err } - return result.(*DcimInterfaceTemplatesPartialUpdateOK), nil + return result.(*DcimFrontPortsPartialUpdateOK), nil } /* -DcimInterfaceTemplatesRead dcim interface templates read API +DcimFrontPortsRead Call to super to allow for caching */ -func (a *Client) DcimInterfaceTemplatesRead(params *DcimInterfaceTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesReadOK, error) { +func (a *Client) DcimFrontPortsRead(params *DcimFrontPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortsReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceTemplatesReadParams() + params = NewDcimFrontPortsReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-templates_read", + ID: "dcim_front-ports_read", Method: "GET", - PathPattern: "/dcim/interface-templates/{id}/", + PathPattern: "/dcim/front-ports/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceTemplatesReadReader{formats: a.formats}, + Reader: &DcimFrontPortsReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2069,28 +2301,28 @@ func (a *Client) DcimInterfaceTemplatesRead(params *DcimInterfaceTemplatesReadPa if err != nil { return nil, err } - return result.(*DcimInterfaceTemplatesReadOK), nil + return result.(*DcimFrontPortsReadOK), nil } /* -DcimInterfaceTemplatesUpdate dcim interface templates update API +DcimFrontPortsUpdate dcim front ports update API */ -func (a *Client) DcimInterfaceTemplatesUpdate(params *DcimInterfaceTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesUpdateOK, error) { +func (a *Client) DcimFrontPortsUpdate(params *DcimFrontPortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimFrontPortsUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfaceTemplatesUpdateParams() + params = NewDcimFrontPortsUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interface-templates_update", + ID: "dcim_front-ports_update", Method: "PUT", - PathPattern: "/dcim/interface-templates/{id}/", + PathPattern: "/dcim/front-ports/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfaceTemplatesUpdateReader{formats: a.formats}, + Reader: &DcimFrontPortsUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2098,28 +2330,28 @@ func (a *Client) DcimInterfaceTemplatesUpdate(params *DcimInterfaceTemplatesUpda if err != nil { return nil, err } - return result.(*DcimInterfaceTemplatesUpdateOK), nil + return result.(*DcimFrontPortsUpdateOK), nil } /* -DcimInterfacesCreate dcim interfaces create API +DcimInterfaceConnectionsList dcim interface connections list API */ -func (a *Client) DcimInterfacesCreate(params *DcimInterfacesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesCreateCreated, error) { +func (a *Client) DcimInterfaceConnectionsList(params *DcimInterfaceConnectionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfacesCreateParams() + params = NewDcimInterfaceConnectionsListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interfaces_create", - Method: "POST", - PathPattern: "/dcim/interfaces/", + ID: "dcim_interface-connections_list", + Method: "GET", + PathPattern: "/dcim/interface-connections/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfacesCreateReader{formats: a.formats}, + Reader: &DcimInterfaceConnectionsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2127,28 +2359,28 @@ func (a *Client) DcimInterfacesCreate(params *DcimInterfacesCreateParams, authIn if err != nil { return nil, err } - return result.(*DcimInterfacesCreateCreated), nil + return result.(*DcimInterfaceConnectionsListOK), nil } /* -DcimInterfacesDelete dcim interfaces delete API +DcimInterfaceTemplatesCreate dcim interface templates create API */ -func (a *Client) DcimInterfacesDelete(params *DcimInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesDeleteNoContent, error) { +func (a *Client) DcimInterfaceTemplatesCreate(params *DcimInterfaceTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimInterfacesDeleteParams() + params = NewDcimInterfaceTemplatesCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_interfaces_delete", - Method: "DELETE", - PathPattern: "/dcim/interfaces/{id}/", + ID: "dcim_interface-templates_create", + Method: "POST", + PathPattern: "/dcim/interface-templates/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimInterfacesDeleteReader{formats: a.formats}, + Reader: &DcimInterfaceTemplatesCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2156,7 +2388,210 @@ func (a *Client) DcimInterfacesDelete(params *DcimInterfacesDeleteParams, authIn if err != nil { return nil, err } - return result.(*DcimInterfacesDeleteNoContent), nil + return result.(*DcimInterfaceTemplatesCreateCreated), nil + +} + +/* +DcimInterfaceTemplatesDelete dcim interface templates delete API +*/ +func (a *Client) DcimInterfaceTemplatesDelete(params *DcimInterfaceTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesDeleteNoContent), nil + +} + +/* +DcimInterfaceTemplatesList Call to super to allow for caching +*/ +func (a *Client) DcimInterfaceTemplatesList(params *DcimInterfaceTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_list", + Method: "GET", + PathPattern: "/dcim/interface-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesListOK), nil + +} + +/* +DcimInterfaceTemplatesPartialUpdate dcim interface templates partial update API +*/ +func (a *Client) DcimInterfaceTemplatesPartialUpdate(params *DcimInterfaceTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesPartialUpdateOK), nil + +} + +/* +DcimInterfaceTemplatesRead Call to super to allow for caching +*/ +func (a *Client) DcimInterfaceTemplatesRead(params *DcimInterfaceTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_read", + Method: "GET", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesReadOK), nil + +} + +/* +DcimInterfaceTemplatesUpdate dcim interface templates update API +*/ +func (a *Client) DcimInterfaceTemplatesUpdate(params *DcimInterfaceTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_update", + Method: "PUT", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesUpdateOK), nil + +} + +/* +DcimInterfacesCreate dcim interfaces create API +*/ +func (a *Client) DcimInterfacesCreate(params *DcimInterfacesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_create", + Method: "POST", + PathPattern: "/dcim/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesCreateCreated), nil + +} + +/* +DcimInterfacesDelete dcim interfaces delete API +*/ +func (a *Client) DcimInterfacesDelete(params *DcimInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_delete", + Method: "DELETE", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesDeleteNoContent), nil } @@ -2190,7 +2625,7 @@ func (a *Client) DcimInterfacesGraphs(params *DcimInterfacesGraphsParams, authIn } /* -DcimInterfacesList dcim interfaces list API +DcimInterfacesList Call to super to allow for caching */ func (a *Client) DcimInterfacesList(params *DcimInterfacesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesListOK, error) { // TODO: Validate the params before sending @@ -2248,7 +2683,7 @@ func (a *Client) DcimInterfacesPartialUpdate(params *DcimInterfacesPartialUpdate } /* -DcimInterfacesRead dcim interfaces read API +DcimInterfacesRead Call to super to allow for caching */ func (a *Client) DcimInterfacesRead(params *DcimInterfacesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesReadOK, error) { // TODO: Validate the params before sending @@ -2276,6 +2711,35 @@ func (a *Client) DcimInterfacesRead(params *DcimInterfacesReadParams, authInfo r } +/* +DcimInterfacesTrace Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). +*/ +func (a *Client) DcimInterfacesTrace(params *DcimInterfacesTraceParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesTraceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesTraceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_trace", + Method: "GET", + PathPattern: "/dcim/interfaces/{id}/trace/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesTraceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesTraceOK), nil + +} + /* DcimInterfacesUpdate dcim interfaces update API */ @@ -2364,7 +2828,7 @@ func (a *Client) DcimInventoryItemsDelete(params *DcimInventoryItemsDeleteParams } /* -DcimInventoryItemsList dcim inventory items list API +DcimInventoryItemsList Call to super to allow for caching */ func (a *Client) DcimInventoryItemsList(params *DcimInventoryItemsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsListOK, error) { // TODO: Validate the params before sending @@ -2422,7 +2886,7 @@ func (a *Client) DcimInventoryItemsPartialUpdate(params *DcimInventoryItemsParti } /* -DcimInventoryItemsRead dcim inventory items read API +DcimInventoryItemsRead Call to super to allow for caching */ func (a *Client) DcimInventoryItemsRead(params *DcimInventoryItemsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsReadOK, error) { // TODO: Validate the params before sending @@ -2538,7 +3002,7 @@ func (a *Client) DcimManufacturersDelete(params *DcimManufacturersDeleteParams, } /* -DcimManufacturersList dcim manufacturers list API +DcimManufacturersList Call to super to allow for caching */ func (a *Client) DcimManufacturersList(params *DcimManufacturersListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersListOK, error) { // TODO: Validate the params before sending @@ -2596,7 +3060,7 @@ func (a *Client) DcimManufacturersPartialUpdate(params *DcimManufacturersPartial } /* -DcimManufacturersRead dcim manufacturers read API +DcimManufacturersRead Call to super to allow for caching */ func (a *Client) DcimManufacturersRead(params *DcimManufacturersReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersReadOK, error) { // TODO: Validate the params before sending @@ -2712,7 +3176,7 @@ func (a *Client) DcimPlatformsDelete(params *DcimPlatformsDeleteParams, authInfo } /* -DcimPlatformsList dcim platforms list API +DcimPlatformsList Call to super to allow for caching */ func (a *Client) DcimPlatformsList(params *DcimPlatformsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsListOK, error) { // TODO: Validate the params before sending @@ -2770,7 +3234,7 @@ func (a *Client) DcimPlatformsPartialUpdate(params *DcimPlatformsPartialUpdatePa } /* -DcimPlatformsRead dcim platforms read API +DcimPlatformsRead Call to super to allow for caching */ func (a *Client) DcimPlatformsRead(params *DcimPlatformsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsReadOK, error) { // TODO: Validate the params before sending @@ -2857,23 +3321,23 @@ func (a *Client) DcimPowerConnectionsList(params *DcimPowerConnectionsListParams } /* -DcimPowerOutletTemplatesCreate dcim power outlet templates create API +DcimPowerFeedsCreate dcim power feeds create API */ -func (a *Client) DcimPowerOutletTemplatesCreate(params *DcimPowerOutletTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesCreateCreated, error) { +func (a *Client) DcimPowerFeedsCreate(params *DcimPowerFeedsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerFeedsCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletTemplatesCreateParams() + params = NewDcimPowerFeedsCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlet-templates_create", + ID: "dcim_power-feeds_create", Method: "POST", - PathPattern: "/dcim/power-outlet-templates/", + PathPattern: "/dcim/power-feeds/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletTemplatesCreateReader{formats: a.formats}, + Reader: &DcimPowerFeedsCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2881,28 +3345,28 @@ func (a *Client) DcimPowerOutletTemplatesCreate(params *DcimPowerOutletTemplates if err != nil { return nil, err } - return result.(*DcimPowerOutletTemplatesCreateCreated), nil + return result.(*DcimPowerFeedsCreateCreated), nil } /* -DcimPowerOutletTemplatesDelete dcim power outlet templates delete API +DcimPowerFeedsDelete dcim power feeds delete API */ -func (a *Client) DcimPowerOutletTemplatesDelete(params *DcimPowerOutletTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesDeleteNoContent, error) { +func (a *Client) DcimPowerFeedsDelete(params *DcimPowerFeedsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerFeedsDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletTemplatesDeleteParams() + params = NewDcimPowerFeedsDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlet-templates_delete", + ID: "dcim_power-feeds_delete", Method: "DELETE", - PathPattern: "/dcim/power-outlet-templates/{id}/", + PathPattern: "/dcim/power-feeds/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletTemplatesDeleteReader{formats: a.formats}, + Reader: &DcimPowerFeedsDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2910,28 +3374,28 @@ func (a *Client) DcimPowerOutletTemplatesDelete(params *DcimPowerOutletTemplates if err != nil { return nil, err } - return result.(*DcimPowerOutletTemplatesDeleteNoContent), nil + return result.(*DcimPowerFeedsDeleteNoContent), nil } /* -DcimPowerOutletTemplatesList dcim power outlet templates list API +DcimPowerFeedsList Call to super to allow for caching */ -func (a *Client) DcimPowerOutletTemplatesList(params *DcimPowerOutletTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesListOK, error) { +func (a *Client) DcimPowerFeedsList(params *DcimPowerFeedsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerFeedsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletTemplatesListParams() + params = NewDcimPowerFeedsListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlet-templates_list", + ID: "dcim_power-feeds_list", Method: "GET", - PathPattern: "/dcim/power-outlet-templates/", + PathPattern: "/dcim/power-feeds/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletTemplatesListReader{formats: a.formats}, + Reader: &DcimPowerFeedsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2939,28 +3403,28 @@ func (a *Client) DcimPowerOutletTemplatesList(params *DcimPowerOutletTemplatesLi if err != nil { return nil, err } - return result.(*DcimPowerOutletTemplatesListOK), nil + return result.(*DcimPowerFeedsListOK), nil } /* -DcimPowerOutletTemplatesPartialUpdate dcim power outlet templates partial update API +DcimPowerFeedsPartialUpdate dcim power feeds partial update API */ -func (a *Client) DcimPowerOutletTemplatesPartialUpdate(params *DcimPowerOutletTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesPartialUpdateOK, error) { +func (a *Client) DcimPowerFeedsPartialUpdate(params *DcimPowerFeedsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerFeedsPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletTemplatesPartialUpdateParams() + params = NewDcimPowerFeedsPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlet-templates_partial_update", + ID: "dcim_power-feeds_partial_update", Method: "PATCH", - PathPattern: "/dcim/power-outlet-templates/{id}/", + PathPattern: "/dcim/power-feeds/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletTemplatesPartialUpdateReader{formats: a.formats}, + Reader: &DcimPowerFeedsPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2968,28 +3432,28 @@ func (a *Client) DcimPowerOutletTemplatesPartialUpdate(params *DcimPowerOutletTe if err != nil { return nil, err } - return result.(*DcimPowerOutletTemplatesPartialUpdateOK), nil + return result.(*DcimPowerFeedsPartialUpdateOK), nil } /* -DcimPowerOutletTemplatesRead dcim power outlet templates read API +DcimPowerFeedsRead Call to super to allow for caching */ -func (a *Client) DcimPowerOutletTemplatesRead(params *DcimPowerOutletTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesReadOK, error) { +func (a *Client) DcimPowerFeedsRead(params *DcimPowerFeedsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerFeedsReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletTemplatesReadParams() + params = NewDcimPowerFeedsReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlet-templates_read", + ID: "dcim_power-feeds_read", Method: "GET", - PathPattern: "/dcim/power-outlet-templates/{id}/", + PathPattern: "/dcim/power-feeds/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletTemplatesReadReader{formats: a.formats}, + Reader: &DcimPowerFeedsReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -2997,28 +3461,28 @@ func (a *Client) DcimPowerOutletTemplatesRead(params *DcimPowerOutletTemplatesRe if err != nil { return nil, err } - return result.(*DcimPowerOutletTemplatesReadOK), nil + return result.(*DcimPowerFeedsReadOK), nil } /* -DcimPowerOutletTemplatesUpdate dcim power outlet templates update API +DcimPowerFeedsUpdate dcim power feeds update API */ -func (a *Client) DcimPowerOutletTemplatesUpdate(params *DcimPowerOutletTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesUpdateOK, error) { +func (a *Client) DcimPowerFeedsUpdate(params *DcimPowerFeedsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerFeedsUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletTemplatesUpdateParams() + params = NewDcimPowerFeedsUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlet-templates_update", + ID: "dcim_power-feeds_update", Method: "PUT", - PathPattern: "/dcim/power-outlet-templates/{id}/", + PathPattern: "/dcim/power-feeds/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletTemplatesUpdateReader{formats: a.formats}, + Reader: &DcimPowerFeedsUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3026,28 +3490,28 @@ func (a *Client) DcimPowerOutletTemplatesUpdate(params *DcimPowerOutletTemplates if err != nil { return nil, err } - return result.(*DcimPowerOutletTemplatesUpdateOK), nil + return result.(*DcimPowerFeedsUpdateOK), nil } /* -DcimPowerOutletsCreate dcim power outlets create API +DcimPowerOutletTemplatesCreate dcim power outlet templates create API */ -func (a *Client) DcimPowerOutletsCreate(params *DcimPowerOutletsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsCreateCreated, error) { +func (a *Client) DcimPowerOutletTemplatesCreate(params *DcimPowerOutletTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletsCreateParams() + params = NewDcimPowerOutletTemplatesCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlets_create", + ID: "dcim_power-outlet-templates_create", Method: "POST", - PathPattern: "/dcim/power-outlets/", + PathPattern: "/dcim/power-outlet-templates/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletsCreateReader{formats: a.formats}, + Reader: &DcimPowerOutletTemplatesCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3055,28 +3519,28 @@ func (a *Client) DcimPowerOutletsCreate(params *DcimPowerOutletsCreateParams, au if err != nil { return nil, err } - return result.(*DcimPowerOutletsCreateCreated), nil + return result.(*DcimPowerOutletTemplatesCreateCreated), nil } /* -DcimPowerOutletsDelete dcim power outlets delete API +DcimPowerOutletTemplatesDelete dcim power outlet templates delete API */ -func (a *Client) DcimPowerOutletsDelete(params *DcimPowerOutletsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsDeleteNoContent, error) { +func (a *Client) DcimPowerOutletTemplatesDelete(params *DcimPowerOutletTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletsDeleteParams() + params = NewDcimPowerOutletTemplatesDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlets_delete", + ID: "dcim_power-outlet-templates_delete", Method: "DELETE", - PathPattern: "/dcim/power-outlets/{id}/", + PathPattern: "/dcim/power-outlet-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletsDeleteReader{formats: a.formats}, + Reader: &DcimPowerOutletTemplatesDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3084,28 +3548,28 @@ func (a *Client) DcimPowerOutletsDelete(params *DcimPowerOutletsDeleteParams, au if err != nil { return nil, err } - return result.(*DcimPowerOutletsDeleteNoContent), nil + return result.(*DcimPowerOutletTemplatesDeleteNoContent), nil } /* -DcimPowerOutletsList dcim power outlets list API +DcimPowerOutletTemplatesList Call to super to allow for caching */ -func (a *Client) DcimPowerOutletsList(params *DcimPowerOutletsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsListOK, error) { +func (a *Client) DcimPowerOutletTemplatesList(params *DcimPowerOutletTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletsListParams() + params = NewDcimPowerOutletTemplatesListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlets_list", + ID: "dcim_power-outlet-templates_list", Method: "GET", - PathPattern: "/dcim/power-outlets/", + PathPattern: "/dcim/power-outlet-templates/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletsListReader{formats: a.formats}, + Reader: &DcimPowerOutletTemplatesListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3113,28 +3577,28 @@ func (a *Client) DcimPowerOutletsList(params *DcimPowerOutletsListParams, authIn if err != nil { return nil, err } - return result.(*DcimPowerOutletsListOK), nil + return result.(*DcimPowerOutletTemplatesListOK), nil } /* -DcimPowerOutletsPartialUpdate dcim power outlets partial update API +DcimPowerOutletTemplatesPartialUpdate dcim power outlet templates partial update API */ -func (a *Client) DcimPowerOutletsPartialUpdate(params *DcimPowerOutletsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsPartialUpdateOK, error) { +func (a *Client) DcimPowerOutletTemplatesPartialUpdate(params *DcimPowerOutletTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletsPartialUpdateParams() + params = NewDcimPowerOutletTemplatesPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlets_partial_update", + ID: "dcim_power-outlet-templates_partial_update", Method: "PATCH", - PathPattern: "/dcim/power-outlets/{id}/", + PathPattern: "/dcim/power-outlet-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletsPartialUpdateReader{formats: a.formats}, + Reader: &DcimPowerOutletTemplatesPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3142,28 +3606,28 @@ func (a *Client) DcimPowerOutletsPartialUpdate(params *DcimPowerOutletsPartialUp if err != nil { return nil, err } - return result.(*DcimPowerOutletsPartialUpdateOK), nil + return result.(*DcimPowerOutletTemplatesPartialUpdateOK), nil } /* -DcimPowerOutletsRead dcim power outlets read API +DcimPowerOutletTemplatesRead Call to super to allow for caching */ -func (a *Client) DcimPowerOutletsRead(params *DcimPowerOutletsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsReadOK, error) { +func (a *Client) DcimPowerOutletTemplatesRead(params *DcimPowerOutletTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletsReadParams() + params = NewDcimPowerOutletTemplatesReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlets_read", + ID: "dcim_power-outlet-templates_read", Method: "GET", - PathPattern: "/dcim/power-outlets/{id}/", + PathPattern: "/dcim/power-outlet-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletsReadReader{formats: a.formats}, + Reader: &DcimPowerOutletTemplatesReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3171,28 +3635,28 @@ func (a *Client) DcimPowerOutletsRead(params *DcimPowerOutletsReadParams, authIn if err != nil { return nil, err } - return result.(*DcimPowerOutletsReadOK), nil + return result.(*DcimPowerOutletTemplatesReadOK), nil } /* -DcimPowerOutletsUpdate dcim power outlets update API +DcimPowerOutletTemplatesUpdate dcim power outlet templates update API */ -func (a *Client) DcimPowerOutletsUpdate(params *DcimPowerOutletsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsUpdateOK, error) { +func (a *Client) DcimPowerOutletTemplatesUpdate(params *DcimPowerOutletTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerOutletsUpdateParams() + params = NewDcimPowerOutletTemplatesUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-outlets_update", + ID: "dcim_power-outlet-templates_update", Method: "PUT", - PathPattern: "/dcim/power-outlets/{id}/", + PathPattern: "/dcim/power-outlet-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerOutletsUpdateReader{formats: a.formats}, + Reader: &DcimPowerOutletTemplatesUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3200,28 +3664,28 @@ func (a *Client) DcimPowerOutletsUpdate(params *DcimPowerOutletsUpdateParams, au if err != nil { return nil, err } - return result.(*DcimPowerOutletsUpdateOK), nil + return result.(*DcimPowerOutletTemplatesUpdateOK), nil } /* -DcimPowerPortTemplatesCreate dcim power port templates create API +DcimPowerOutletsCreate dcim power outlets create API */ -func (a *Client) DcimPowerPortTemplatesCreate(params *DcimPowerPortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesCreateCreated, error) { +func (a *Client) DcimPowerOutletsCreate(params *DcimPowerOutletsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortTemplatesCreateParams() + params = NewDcimPowerOutletsCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-port-templates_create", + ID: "dcim_power-outlets_create", Method: "POST", - PathPattern: "/dcim/power-port-templates/", + PathPattern: "/dcim/power-outlets/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortTemplatesCreateReader{formats: a.formats}, + Reader: &DcimPowerOutletsCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3229,28 +3693,28 @@ func (a *Client) DcimPowerPortTemplatesCreate(params *DcimPowerPortTemplatesCrea if err != nil { return nil, err } - return result.(*DcimPowerPortTemplatesCreateCreated), nil + return result.(*DcimPowerOutletsCreateCreated), nil } /* -DcimPowerPortTemplatesDelete dcim power port templates delete API +DcimPowerOutletsDelete dcim power outlets delete API */ -func (a *Client) DcimPowerPortTemplatesDelete(params *DcimPowerPortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesDeleteNoContent, error) { +func (a *Client) DcimPowerOutletsDelete(params *DcimPowerOutletsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortTemplatesDeleteParams() + params = NewDcimPowerOutletsDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-port-templates_delete", + ID: "dcim_power-outlets_delete", Method: "DELETE", - PathPattern: "/dcim/power-port-templates/{id}/", + PathPattern: "/dcim/power-outlets/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortTemplatesDeleteReader{formats: a.formats}, + Reader: &DcimPowerOutletsDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3258,28 +3722,28 @@ func (a *Client) DcimPowerPortTemplatesDelete(params *DcimPowerPortTemplatesDele if err != nil { return nil, err } - return result.(*DcimPowerPortTemplatesDeleteNoContent), nil + return result.(*DcimPowerOutletsDeleteNoContent), nil } /* -DcimPowerPortTemplatesList dcim power port templates list API +DcimPowerOutletsList Call to super to allow for caching */ -func (a *Client) DcimPowerPortTemplatesList(params *DcimPowerPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesListOK, error) { +func (a *Client) DcimPowerOutletsList(params *DcimPowerOutletsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortTemplatesListParams() + params = NewDcimPowerOutletsListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-port-templates_list", + ID: "dcim_power-outlets_list", Method: "GET", - PathPattern: "/dcim/power-port-templates/", + PathPattern: "/dcim/power-outlets/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortTemplatesListReader{formats: a.formats}, + Reader: &DcimPowerOutletsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3287,28 +3751,28 @@ func (a *Client) DcimPowerPortTemplatesList(params *DcimPowerPortTemplatesListPa if err != nil { return nil, err } - return result.(*DcimPowerPortTemplatesListOK), nil + return result.(*DcimPowerOutletsListOK), nil } /* -DcimPowerPortTemplatesPartialUpdate dcim power port templates partial update API +DcimPowerOutletsPartialUpdate dcim power outlets partial update API */ -func (a *Client) DcimPowerPortTemplatesPartialUpdate(params *DcimPowerPortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesPartialUpdateOK, error) { +func (a *Client) DcimPowerOutletsPartialUpdate(params *DcimPowerOutletsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortTemplatesPartialUpdateParams() + params = NewDcimPowerOutletsPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-port-templates_partial_update", + ID: "dcim_power-outlets_partial_update", Method: "PATCH", - PathPattern: "/dcim/power-port-templates/{id}/", + PathPattern: "/dcim/power-outlets/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortTemplatesPartialUpdateReader{formats: a.formats}, + Reader: &DcimPowerOutletsPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3316,28 +3780,28 @@ func (a *Client) DcimPowerPortTemplatesPartialUpdate(params *DcimPowerPortTempla if err != nil { return nil, err } - return result.(*DcimPowerPortTemplatesPartialUpdateOK), nil + return result.(*DcimPowerOutletsPartialUpdateOK), nil } /* -DcimPowerPortTemplatesRead dcim power port templates read API +DcimPowerOutletsRead Call to super to allow for caching */ -func (a *Client) DcimPowerPortTemplatesRead(params *DcimPowerPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesReadOK, error) { +func (a *Client) DcimPowerOutletsRead(params *DcimPowerOutletsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortTemplatesReadParams() + params = NewDcimPowerOutletsReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-port-templates_read", + ID: "dcim_power-outlets_read", Method: "GET", - PathPattern: "/dcim/power-port-templates/{id}/", + PathPattern: "/dcim/power-outlets/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortTemplatesReadReader{formats: a.formats}, + Reader: &DcimPowerOutletsReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3345,28 +3809,57 @@ func (a *Client) DcimPowerPortTemplatesRead(params *DcimPowerPortTemplatesReadPa if err != nil { return nil, err } - return result.(*DcimPowerPortTemplatesReadOK), nil + return result.(*DcimPowerOutletsReadOK), nil } /* -DcimPowerPortTemplatesUpdate dcim power port templates update API +DcimPowerOutletsTrace Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). */ -func (a *Client) DcimPowerPortTemplatesUpdate(params *DcimPowerPortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesUpdateOK, error) { +func (a *Client) DcimPowerOutletsTrace(params *DcimPowerOutletsTraceParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsTraceOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortTemplatesUpdateParams() + params = NewDcimPowerOutletsTraceParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-port-templates_update", + ID: "dcim_power-outlets_trace", + Method: "GET", + PathPattern: "/dcim/power-outlets/{id}/trace/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsTraceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsTraceOK), nil + +} + +/* +DcimPowerOutletsUpdate dcim power outlets update API +*/ +func (a *Client) DcimPowerOutletsUpdate(params *DcimPowerOutletsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_update", Method: "PUT", - PathPattern: "/dcim/power-port-templates/{id}/", + PathPattern: "/dcim/power-outlets/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortTemplatesUpdateReader{formats: a.formats}, + Reader: &DcimPowerOutletsUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3374,28 +3867,28 @@ func (a *Client) DcimPowerPortTemplatesUpdate(params *DcimPowerPortTemplatesUpda if err != nil { return nil, err } - return result.(*DcimPowerPortTemplatesUpdateOK), nil + return result.(*DcimPowerOutletsUpdateOK), nil } /* -DcimPowerPortsCreate dcim power ports create API +DcimPowerPanelsCreate dcim power panels create API */ -func (a *Client) DcimPowerPortsCreate(params *DcimPowerPortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsCreateCreated, error) { +func (a *Client) DcimPowerPanelsCreate(params *DcimPowerPanelsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPanelsCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortsCreateParams() + params = NewDcimPowerPanelsCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-ports_create", + ID: "dcim_power-panels_create", Method: "POST", - PathPattern: "/dcim/power-ports/", + PathPattern: "/dcim/power-panels/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortsCreateReader{formats: a.formats}, + Reader: &DcimPowerPanelsCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3403,28 +3896,28 @@ func (a *Client) DcimPowerPortsCreate(params *DcimPowerPortsCreateParams, authIn if err != nil { return nil, err } - return result.(*DcimPowerPortsCreateCreated), nil + return result.(*DcimPowerPanelsCreateCreated), nil } /* -DcimPowerPortsDelete dcim power ports delete API +DcimPowerPanelsDelete dcim power panels delete API */ -func (a *Client) DcimPowerPortsDelete(params *DcimPowerPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsDeleteNoContent, error) { +func (a *Client) DcimPowerPanelsDelete(params *DcimPowerPanelsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPanelsDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortsDeleteParams() + params = NewDcimPowerPanelsDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-ports_delete", + ID: "dcim_power-panels_delete", Method: "DELETE", - PathPattern: "/dcim/power-ports/{id}/", + PathPattern: "/dcim/power-panels/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortsDeleteReader{formats: a.formats}, + Reader: &DcimPowerPanelsDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3432,28 +3925,28 @@ func (a *Client) DcimPowerPortsDelete(params *DcimPowerPortsDeleteParams, authIn if err != nil { return nil, err } - return result.(*DcimPowerPortsDeleteNoContent), nil + return result.(*DcimPowerPanelsDeleteNoContent), nil } /* -DcimPowerPortsList dcim power ports list API +DcimPowerPanelsList Call to super to allow for caching */ -func (a *Client) DcimPowerPortsList(params *DcimPowerPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsListOK, error) { +func (a *Client) DcimPowerPanelsList(params *DcimPowerPanelsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPanelsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortsListParams() + params = NewDcimPowerPanelsListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-ports_list", + ID: "dcim_power-panels_list", Method: "GET", - PathPattern: "/dcim/power-ports/", + PathPattern: "/dcim/power-panels/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortsListReader{formats: a.formats}, + Reader: &DcimPowerPanelsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3461,28 +3954,28 @@ func (a *Client) DcimPowerPortsList(params *DcimPowerPortsListParams, authInfo r if err != nil { return nil, err } - return result.(*DcimPowerPortsListOK), nil + return result.(*DcimPowerPanelsListOK), nil } /* -DcimPowerPortsPartialUpdate dcim power ports partial update API +DcimPowerPanelsPartialUpdate dcim power panels partial update API */ -func (a *Client) DcimPowerPortsPartialUpdate(params *DcimPowerPortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsPartialUpdateOK, error) { +func (a *Client) DcimPowerPanelsPartialUpdate(params *DcimPowerPanelsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPanelsPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortsPartialUpdateParams() + params = NewDcimPowerPanelsPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-ports_partial_update", + ID: "dcim_power-panels_partial_update", Method: "PATCH", - PathPattern: "/dcim/power-ports/{id}/", + PathPattern: "/dcim/power-panels/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortsPartialUpdateReader{formats: a.formats}, + Reader: &DcimPowerPanelsPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3490,28 +3983,28 @@ func (a *Client) DcimPowerPortsPartialUpdate(params *DcimPowerPortsPartialUpdate if err != nil { return nil, err } - return result.(*DcimPowerPortsPartialUpdateOK), nil + return result.(*DcimPowerPanelsPartialUpdateOK), nil } /* -DcimPowerPortsRead dcim power ports read API +DcimPowerPanelsRead Call to super to allow for caching */ -func (a *Client) DcimPowerPortsRead(params *DcimPowerPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsReadOK, error) { +func (a *Client) DcimPowerPanelsRead(params *DcimPowerPanelsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPanelsReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortsReadParams() + params = NewDcimPowerPanelsReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-ports_read", + ID: "dcim_power-panels_read", Method: "GET", - PathPattern: "/dcim/power-ports/{id}/", + PathPattern: "/dcim/power-panels/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortsReadReader{formats: a.formats}, + Reader: &DcimPowerPanelsReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3519,28 +4012,28 @@ func (a *Client) DcimPowerPortsRead(params *DcimPowerPortsReadParams, authInfo r if err != nil { return nil, err } - return result.(*DcimPowerPortsReadOK), nil + return result.(*DcimPowerPanelsReadOK), nil } /* -DcimPowerPortsUpdate dcim power ports update API +DcimPowerPanelsUpdate dcim power panels update API */ -func (a *Client) DcimPowerPortsUpdate(params *DcimPowerPortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsUpdateOK, error) { +func (a *Client) DcimPowerPanelsUpdate(params *DcimPowerPanelsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPanelsUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimPowerPortsUpdateParams() + params = NewDcimPowerPanelsUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_power-ports_update", + ID: "dcim_power-panels_update", Method: "PUT", - PathPattern: "/dcim/power-ports/{id}/", + PathPattern: "/dcim/power-panels/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimPowerPortsUpdateReader{formats: a.formats}, + Reader: &DcimPowerPanelsUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3548,28 +4041,28 @@ func (a *Client) DcimPowerPortsUpdate(params *DcimPowerPortsUpdateParams, authIn if err != nil { return nil, err } - return result.(*DcimPowerPortsUpdateOK), nil + return result.(*DcimPowerPanelsUpdateOK), nil } /* -DcimRackGroupsCreate dcim rack groups create API +DcimPowerPortTemplatesCreate dcim power port templates create API */ -func (a *Client) DcimRackGroupsCreate(params *DcimRackGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsCreateCreated, error) { +func (a *Client) DcimPowerPortTemplatesCreate(params *DcimPowerPortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackGroupsCreateParams() + params = NewDcimPowerPortTemplatesCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-groups_create", + ID: "dcim_power-port-templates_create", Method: "POST", - PathPattern: "/dcim/rack-groups/", + PathPattern: "/dcim/power-port-templates/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackGroupsCreateReader{formats: a.formats}, + Reader: &DcimPowerPortTemplatesCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3577,28 +4070,753 @@ func (a *Client) DcimRackGroupsCreate(params *DcimRackGroupsCreateParams, authIn if err != nil { return nil, err } - return result.(*DcimRackGroupsCreateCreated), nil + return result.(*DcimPowerPortTemplatesCreateCreated), nil } /* -DcimRackGroupsDelete dcim rack groups delete API +DcimPowerPortTemplatesDelete dcim power port templates delete API */ -func (a *Client) DcimRackGroupsDelete(params *DcimRackGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsDeleteNoContent, error) { +func (a *Client) DcimPowerPortTemplatesDelete(params *DcimPowerPortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackGroupsDeleteParams() + params = NewDcimPowerPortTemplatesDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-groups_delete", + ID: "dcim_power-port-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesDeleteNoContent), nil + +} + +/* +DcimPowerPortTemplatesList Call to super to allow for caching +*/ +func (a *Client) DcimPowerPortTemplatesList(params *DcimPowerPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_list", + Method: "GET", + PathPattern: "/dcim/power-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesListOK), nil + +} + +/* +DcimPowerPortTemplatesPartialUpdate dcim power port templates partial update API +*/ +func (a *Client) DcimPowerPortTemplatesPartialUpdate(params *DcimPowerPortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesPartialUpdateOK), nil + +} + +/* +DcimPowerPortTemplatesRead Call to super to allow for caching +*/ +func (a *Client) DcimPowerPortTemplatesRead(params *DcimPowerPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_read", + Method: "GET", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesReadOK), nil + +} + +/* +DcimPowerPortTemplatesUpdate dcim power port templates update API +*/ +func (a *Client) DcimPowerPortTemplatesUpdate(params *DcimPowerPortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_update", + Method: "PUT", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesUpdateOK), nil + +} + +/* +DcimPowerPortsCreate dcim power ports create API +*/ +func (a *Client) DcimPowerPortsCreate(params *DcimPowerPortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_create", + Method: "POST", + PathPattern: "/dcim/power-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsCreateCreated), nil + +} + +/* +DcimPowerPortsDelete dcim power ports delete API +*/ +func (a *Client) DcimPowerPortsDelete(params *DcimPowerPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_delete", + Method: "DELETE", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsDeleteNoContent), nil + +} + +/* +DcimPowerPortsList Call to super to allow for caching +*/ +func (a *Client) DcimPowerPortsList(params *DcimPowerPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_list", + Method: "GET", + PathPattern: "/dcim/power-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsListOK), nil + +} + +/* +DcimPowerPortsPartialUpdate dcim power ports partial update API +*/ +func (a *Client) DcimPowerPortsPartialUpdate(params *DcimPowerPortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsPartialUpdateOK), nil + +} + +/* +DcimPowerPortsRead Call to super to allow for caching +*/ +func (a *Client) DcimPowerPortsRead(params *DcimPowerPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_read", + Method: "GET", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsReadOK), nil + +} + +/* +DcimPowerPortsTrace Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination). +*/ +func (a *Client) DcimPowerPortsTrace(params *DcimPowerPortsTraceParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsTraceOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsTraceParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_trace", + Method: "GET", + PathPattern: "/dcim/power-ports/{id}/trace/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsTraceReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsTraceOK), nil + +} + +/* +DcimPowerPortsUpdate dcim power ports update API +*/ +func (a *Client) DcimPowerPortsUpdate(params *DcimPowerPortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_update", + Method: "PUT", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsUpdateOK), nil + +} + +/* +DcimRackGroupsCreate dcim rack groups create API +*/ +func (a *Client) DcimRackGroupsCreate(params *DcimRackGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_create", + Method: "POST", + PathPattern: "/dcim/rack-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsCreateCreated), nil + +} + +/* +DcimRackGroupsDelete dcim rack groups delete API +*/ +func (a *Client) DcimRackGroupsDelete(params *DcimRackGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_delete", + Method: "DELETE", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsDeleteNoContent), nil + +} + +/* +DcimRackGroupsList Call to super to allow for caching +*/ +func (a *Client) DcimRackGroupsList(params *DcimRackGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_list", + Method: "GET", + PathPattern: "/dcim/rack-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsListOK), nil + +} + +/* +DcimRackGroupsPartialUpdate dcim rack groups partial update API +*/ +func (a *Client) DcimRackGroupsPartialUpdate(params *DcimRackGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsPartialUpdateOK), nil + +} + +/* +DcimRackGroupsRead Call to super to allow for caching +*/ +func (a *Client) DcimRackGroupsRead(params *DcimRackGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_read", + Method: "GET", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsReadOK), nil + +} + +/* +DcimRackGroupsUpdate dcim rack groups update API +*/ +func (a *Client) DcimRackGroupsUpdate(params *DcimRackGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_update", + Method: "PUT", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsUpdateOK), nil + +} + +/* +DcimRackReservationsCreate dcim rack reservations create API +*/ +func (a *Client) DcimRackReservationsCreate(params *DcimRackReservationsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_create", + Method: "POST", + PathPattern: "/dcim/rack-reservations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsCreateCreated), nil + +} + +/* +DcimRackReservationsDelete dcim rack reservations delete API +*/ +func (a *Client) DcimRackReservationsDelete(params *DcimRackReservationsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_delete", + Method: "DELETE", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsDeleteNoContent), nil + +} + +/* +DcimRackReservationsList Call to super to allow for caching +*/ +func (a *Client) DcimRackReservationsList(params *DcimRackReservationsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_list", + Method: "GET", + PathPattern: "/dcim/rack-reservations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsListOK), nil + +} + +/* +DcimRackReservationsPartialUpdate dcim rack reservations partial update API +*/ +func (a *Client) DcimRackReservationsPartialUpdate(params *DcimRackReservationsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsPartialUpdateOK), nil + +} + +/* +DcimRackReservationsRead Call to super to allow for caching +*/ +func (a *Client) DcimRackReservationsRead(params *DcimRackReservationsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_read", + Method: "GET", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsReadOK), nil + +} + +/* +DcimRackReservationsUpdate dcim rack reservations update API +*/ +func (a *Client) DcimRackReservationsUpdate(params *DcimRackReservationsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_update", + Method: "PUT", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsUpdateOK), nil + +} + +/* +DcimRackRolesCreate dcim rack roles create API +*/ +func (a *Client) DcimRackRolesCreate(params *DcimRackRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_create", + Method: "POST", + PathPattern: "/dcim/rack-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesCreateCreated), nil + +} + +/* +DcimRackRolesDelete dcim rack roles delete API +*/ +func (a *Client) DcimRackRolesDelete(params *DcimRackRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_delete", Method: "DELETE", - PathPattern: "/dcim/rack-groups/{id}/", + PathPattern: "/dcim/rack-roles/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackGroupsDeleteReader{formats: a.formats}, + Reader: &DcimRackRolesDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3606,28 +4824,28 @@ func (a *Client) DcimRackGroupsDelete(params *DcimRackGroupsDeleteParams, authIn if err != nil { return nil, err } - return result.(*DcimRackGroupsDeleteNoContent), nil + return result.(*DcimRackRolesDeleteNoContent), nil } /* -DcimRackGroupsList dcim rack groups list API +DcimRackRolesList Call to super to allow for caching */ -func (a *Client) DcimRackGroupsList(params *DcimRackGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsListOK, error) { +func (a *Client) DcimRackRolesList(params *DcimRackRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackGroupsListParams() + params = NewDcimRackRolesListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-groups_list", + ID: "dcim_rack-roles_list", Method: "GET", - PathPattern: "/dcim/rack-groups/", + PathPattern: "/dcim/rack-roles/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackGroupsListReader{formats: a.formats}, + Reader: &DcimRackRolesListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3635,28 +4853,28 @@ func (a *Client) DcimRackGroupsList(params *DcimRackGroupsListParams, authInfo r if err != nil { return nil, err } - return result.(*DcimRackGroupsListOK), nil + return result.(*DcimRackRolesListOK), nil } /* -DcimRackGroupsPartialUpdate dcim rack groups partial update API +DcimRackRolesPartialUpdate dcim rack roles partial update API */ -func (a *Client) DcimRackGroupsPartialUpdate(params *DcimRackGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsPartialUpdateOK, error) { +func (a *Client) DcimRackRolesPartialUpdate(params *DcimRackRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackGroupsPartialUpdateParams() + params = NewDcimRackRolesPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-groups_partial_update", + ID: "dcim_rack-roles_partial_update", Method: "PATCH", - PathPattern: "/dcim/rack-groups/{id}/", + PathPattern: "/dcim/rack-roles/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackGroupsPartialUpdateReader{formats: a.formats}, + Reader: &DcimRackRolesPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3664,28 +4882,28 @@ func (a *Client) DcimRackGroupsPartialUpdate(params *DcimRackGroupsPartialUpdate if err != nil { return nil, err } - return result.(*DcimRackGroupsPartialUpdateOK), nil + return result.(*DcimRackRolesPartialUpdateOK), nil } /* -DcimRackGroupsRead dcim rack groups read API +DcimRackRolesRead Call to super to allow for caching */ -func (a *Client) DcimRackGroupsRead(params *DcimRackGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsReadOK, error) { +func (a *Client) DcimRackRolesRead(params *DcimRackRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackGroupsReadParams() + params = NewDcimRackRolesReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-groups_read", + ID: "dcim_rack-roles_read", Method: "GET", - PathPattern: "/dcim/rack-groups/{id}/", + PathPattern: "/dcim/rack-roles/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackGroupsReadReader{formats: a.formats}, + Reader: &DcimRackRolesReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3693,28 +4911,28 @@ func (a *Client) DcimRackGroupsRead(params *DcimRackGroupsReadParams, authInfo r if err != nil { return nil, err } - return result.(*DcimRackGroupsReadOK), nil + return result.(*DcimRackRolesReadOK), nil } /* -DcimRackGroupsUpdate dcim rack groups update API +DcimRackRolesUpdate dcim rack roles update API */ -func (a *Client) DcimRackGroupsUpdate(params *DcimRackGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsUpdateOK, error) { +func (a *Client) DcimRackRolesUpdate(params *DcimRackRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackGroupsUpdateParams() + params = NewDcimRackRolesUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-groups_update", + ID: "dcim_rack-roles_update", Method: "PUT", - PathPattern: "/dcim/rack-groups/{id}/", + PathPattern: "/dcim/rack-roles/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackGroupsUpdateReader{formats: a.formats}, + Reader: &DcimRackRolesUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3722,28 +4940,28 @@ func (a *Client) DcimRackGroupsUpdate(params *DcimRackGroupsUpdateParams, authIn if err != nil { return nil, err } - return result.(*DcimRackGroupsUpdateOK), nil + return result.(*DcimRackRolesUpdateOK), nil } /* -DcimRackReservationsCreate dcim rack reservations create API +DcimRacksCreate dcim racks create API */ -func (a *Client) DcimRackReservationsCreate(params *DcimRackReservationsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsCreateCreated, error) { +func (a *Client) DcimRacksCreate(params *DcimRacksCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackReservationsCreateParams() + params = NewDcimRacksCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-reservations_create", + ID: "dcim_racks_create", Method: "POST", - PathPattern: "/dcim/rack-reservations/", + PathPattern: "/dcim/racks/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackReservationsCreateReader{formats: a.formats}, + Reader: &DcimRacksCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3751,28 +4969,28 @@ func (a *Client) DcimRackReservationsCreate(params *DcimRackReservationsCreatePa if err != nil { return nil, err } - return result.(*DcimRackReservationsCreateCreated), nil + return result.(*DcimRacksCreateCreated), nil } /* -DcimRackReservationsDelete dcim rack reservations delete API +DcimRacksDelete dcim racks delete API */ -func (a *Client) DcimRackReservationsDelete(params *DcimRackReservationsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsDeleteNoContent, error) { +func (a *Client) DcimRacksDelete(params *DcimRacksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackReservationsDeleteParams() + params = NewDcimRacksDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-reservations_delete", + ID: "dcim_racks_delete", Method: "DELETE", - PathPattern: "/dcim/rack-reservations/{id}/", + PathPattern: "/dcim/racks/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackReservationsDeleteReader{formats: a.formats}, + Reader: &DcimRacksDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3780,28 +4998,28 @@ func (a *Client) DcimRackReservationsDelete(params *DcimRackReservationsDeletePa if err != nil { return nil, err } - return result.(*DcimRackReservationsDeleteNoContent), nil + return result.(*DcimRacksDeleteNoContent), nil } /* -DcimRackReservationsList dcim rack reservations list API +DcimRacksList Call to super to allow for caching */ -func (a *Client) DcimRackReservationsList(params *DcimRackReservationsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsListOK, error) { +func (a *Client) DcimRacksList(params *DcimRacksListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackReservationsListParams() + params = NewDcimRacksListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-reservations_list", + ID: "dcim_racks_list", Method: "GET", - PathPattern: "/dcim/rack-reservations/", + PathPattern: "/dcim/racks/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackReservationsListReader{formats: a.formats}, + Reader: &DcimRacksListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3809,28 +5027,28 @@ func (a *Client) DcimRackReservationsList(params *DcimRackReservationsListParams if err != nil { return nil, err } - return result.(*DcimRackReservationsListOK), nil + return result.(*DcimRacksListOK), nil } /* -DcimRackReservationsPartialUpdate dcim rack reservations partial update API +DcimRacksPartialUpdate dcim racks partial update API */ -func (a *Client) DcimRackReservationsPartialUpdate(params *DcimRackReservationsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsPartialUpdateOK, error) { +func (a *Client) DcimRacksPartialUpdate(params *DcimRacksPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackReservationsPartialUpdateParams() + params = NewDcimRacksPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-reservations_partial_update", + ID: "dcim_racks_partial_update", Method: "PATCH", - PathPattern: "/dcim/rack-reservations/{id}/", + PathPattern: "/dcim/racks/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackReservationsPartialUpdateReader{formats: a.formats}, + Reader: &DcimRacksPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3838,28 +5056,28 @@ func (a *Client) DcimRackReservationsPartialUpdate(params *DcimRackReservationsP if err != nil { return nil, err } - return result.(*DcimRackReservationsPartialUpdateOK), nil + return result.(*DcimRacksPartialUpdateOK), nil } /* -DcimRackReservationsRead dcim rack reservations read API +DcimRacksRead Call to super to allow for caching */ -func (a *Client) DcimRackReservationsRead(params *DcimRackReservationsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsReadOK, error) { +func (a *Client) DcimRacksRead(params *DcimRacksReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackReservationsReadParams() + params = NewDcimRacksReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-reservations_read", + ID: "dcim_racks_read", Method: "GET", - PathPattern: "/dcim/rack-reservations/{id}/", + PathPattern: "/dcim/racks/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackReservationsReadReader{formats: a.formats}, + Reader: &DcimRacksReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3867,28 +5085,28 @@ func (a *Client) DcimRackReservationsRead(params *DcimRackReservationsReadParams if err != nil { return nil, err } - return result.(*DcimRackReservationsReadOK), nil + return result.(*DcimRacksReadOK), nil } /* -DcimRackReservationsUpdate dcim rack reservations update API +DcimRacksUnits List rack units (by rack) */ -func (a *Client) DcimRackReservationsUpdate(params *DcimRackReservationsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsUpdateOK, error) { +func (a *Client) DcimRacksUnits(params *DcimRacksUnitsParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksUnitsOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackReservationsUpdateParams() + params = NewDcimRacksUnitsParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-reservations_update", - Method: "PUT", - PathPattern: "/dcim/rack-reservations/{id}/", + ID: "dcim_racks_units", + Method: "GET", + PathPattern: "/dcim/racks/{id}/units/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackReservationsUpdateReader{formats: a.formats}, + Reader: &DcimRacksUnitsReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3896,28 +5114,28 @@ func (a *Client) DcimRackReservationsUpdate(params *DcimRackReservationsUpdatePa if err != nil { return nil, err } - return result.(*DcimRackReservationsUpdateOK), nil + return result.(*DcimRacksUnitsOK), nil } /* -DcimRackRolesCreate dcim rack roles create API +DcimRacksUpdate dcim racks update API */ -func (a *Client) DcimRackRolesCreate(params *DcimRackRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesCreateCreated, error) { +func (a *Client) DcimRacksUpdate(params *DcimRacksUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackRolesCreateParams() + params = NewDcimRacksUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-roles_create", - Method: "POST", - PathPattern: "/dcim/rack-roles/", + ID: "dcim_racks_update", + Method: "PUT", + PathPattern: "/dcim/racks/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackRolesCreateReader{formats: a.formats}, + Reader: &DcimRacksUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3925,28 +5143,28 @@ func (a *Client) DcimRackRolesCreate(params *DcimRackRolesCreateParams, authInfo if err != nil { return nil, err } - return result.(*DcimRackRolesCreateCreated), nil + return result.(*DcimRacksUpdateOK), nil } /* -DcimRackRolesDelete dcim rack roles delete API +DcimRearPortTemplatesCreate dcim rear port templates create API */ -func (a *Client) DcimRackRolesDelete(params *DcimRackRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesDeleteNoContent, error) { +func (a *Client) DcimRearPortTemplatesCreate(params *DcimRearPortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortTemplatesCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackRolesDeleteParams() + params = NewDcimRearPortTemplatesCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-roles_delete", - Method: "DELETE", - PathPattern: "/dcim/rack-roles/{id}/", + ID: "dcim_rear-port-templates_create", + Method: "POST", + PathPattern: "/dcim/rear-port-templates/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackRolesDeleteReader{formats: a.formats}, + Reader: &DcimRearPortTemplatesCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3954,28 +5172,28 @@ func (a *Client) DcimRackRolesDelete(params *DcimRackRolesDeleteParams, authInfo if err != nil { return nil, err } - return result.(*DcimRackRolesDeleteNoContent), nil + return result.(*DcimRearPortTemplatesCreateCreated), nil } /* -DcimRackRolesList dcim rack roles list API +DcimRearPortTemplatesDelete dcim rear port templates delete API */ -func (a *Client) DcimRackRolesList(params *DcimRackRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesListOK, error) { +func (a *Client) DcimRearPortTemplatesDelete(params *DcimRearPortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortTemplatesDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackRolesListParams() + params = NewDcimRearPortTemplatesDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-roles_list", - Method: "GET", - PathPattern: "/dcim/rack-roles/", + ID: "dcim_rear-port-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/rear-port-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackRolesListReader{formats: a.formats}, + Reader: &DcimRearPortTemplatesDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -3983,28 +5201,28 @@ func (a *Client) DcimRackRolesList(params *DcimRackRolesListParams, authInfo run if err != nil { return nil, err } - return result.(*DcimRackRolesListOK), nil + return result.(*DcimRearPortTemplatesDeleteNoContent), nil } /* -DcimRackRolesPartialUpdate dcim rack roles partial update API +DcimRearPortTemplatesList Call to super to allow for caching */ -func (a *Client) DcimRackRolesPartialUpdate(params *DcimRackRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesPartialUpdateOK, error) { +func (a *Client) DcimRearPortTemplatesList(params *DcimRearPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortTemplatesListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackRolesPartialUpdateParams() + params = NewDcimRearPortTemplatesListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-roles_partial_update", - Method: "PATCH", - PathPattern: "/dcim/rack-roles/{id}/", + ID: "dcim_rear-port-templates_list", + Method: "GET", + PathPattern: "/dcim/rear-port-templates/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackRolesPartialUpdateReader{formats: a.formats}, + Reader: &DcimRearPortTemplatesListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4012,28 +5230,28 @@ func (a *Client) DcimRackRolesPartialUpdate(params *DcimRackRolesPartialUpdatePa if err != nil { return nil, err } - return result.(*DcimRackRolesPartialUpdateOK), nil + return result.(*DcimRearPortTemplatesListOK), nil } /* -DcimRackRolesRead dcim rack roles read API +DcimRearPortTemplatesPartialUpdate dcim rear port templates partial update API */ -func (a *Client) DcimRackRolesRead(params *DcimRackRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesReadOK, error) { +func (a *Client) DcimRearPortTemplatesPartialUpdate(params *DcimRearPortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortTemplatesPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackRolesReadParams() + params = NewDcimRearPortTemplatesPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-roles_read", - Method: "GET", - PathPattern: "/dcim/rack-roles/{id}/", + ID: "dcim_rear-port-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rear-port-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackRolesReadReader{formats: a.formats}, + Reader: &DcimRearPortTemplatesPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4041,28 +5259,28 @@ func (a *Client) DcimRackRolesRead(params *DcimRackRolesReadParams, authInfo run if err != nil { return nil, err } - return result.(*DcimRackRolesReadOK), nil + return result.(*DcimRearPortTemplatesPartialUpdateOK), nil } /* -DcimRackRolesUpdate dcim rack roles update API +DcimRearPortTemplatesRead Call to super to allow for caching */ -func (a *Client) DcimRackRolesUpdate(params *DcimRackRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesUpdateOK, error) { +func (a *Client) DcimRearPortTemplatesRead(params *DcimRearPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortTemplatesReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRackRolesUpdateParams() + params = NewDcimRearPortTemplatesReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_rack-roles_update", - Method: "PUT", - PathPattern: "/dcim/rack-roles/{id}/", + ID: "dcim_rear-port-templates_read", + Method: "GET", + PathPattern: "/dcim/rear-port-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRackRolesUpdateReader{formats: a.formats}, + Reader: &DcimRearPortTemplatesReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4070,28 +5288,28 @@ func (a *Client) DcimRackRolesUpdate(params *DcimRackRolesUpdateParams, authInfo if err != nil { return nil, err } - return result.(*DcimRackRolesUpdateOK), nil + return result.(*DcimRearPortTemplatesReadOK), nil } /* -DcimRacksCreate dcim racks create API +DcimRearPortTemplatesUpdate dcim rear port templates update API */ -func (a *Client) DcimRacksCreate(params *DcimRacksCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksCreateCreated, error) { +func (a *Client) DcimRearPortTemplatesUpdate(params *DcimRearPortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortTemplatesUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRacksCreateParams() + params = NewDcimRearPortTemplatesUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_racks_create", - Method: "POST", - PathPattern: "/dcim/racks/", + ID: "dcim_rear-port-templates_update", + Method: "PUT", + PathPattern: "/dcim/rear-port-templates/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRacksCreateReader{formats: a.formats}, + Reader: &DcimRearPortTemplatesUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4099,28 +5317,28 @@ func (a *Client) DcimRacksCreate(params *DcimRacksCreateParams, authInfo runtime if err != nil { return nil, err } - return result.(*DcimRacksCreateCreated), nil + return result.(*DcimRearPortTemplatesUpdateOK), nil } /* -DcimRacksDelete dcim racks delete API +DcimRearPortsCreate dcim rear ports create API */ -func (a *Client) DcimRacksDelete(params *DcimRacksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksDeleteNoContent, error) { +func (a *Client) DcimRearPortsCreate(params *DcimRearPortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortsCreateCreated, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRacksDeleteParams() + params = NewDcimRearPortsCreateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_racks_delete", - Method: "DELETE", - PathPattern: "/dcim/racks/{id}/", + ID: "dcim_rear-ports_create", + Method: "POST", + PathPattern: "/dcim/rear-ports/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRacksDeleteReader{formats: a.formats}, + Reader: &DcimRearPortsCreateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4128,28 +5346,28 @@ func (a *Client) DcimRacksDelete(params *DcimRacksDeleteParams, authInfo runtime if err != nil { return nil, err } - return result.(*DcimRacksDeleteNoContent), nil + return result.(*DcimRearPortsCreateCreated), nil } /* -DcimRacksList dcim racks list API +DcimRearPortsDelete dcim rear ports delete API */ -func (a *Client) DcimRacksList(params *DcimRacksListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksListOK, error) { +func (a *Client) DcimRearPortsDelete(params *DcimRearPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortsDeleteNoContent, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRacksListParams() + params = NewDcimRearPortsDeleteParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_racks_list", - Method: "GET", - PathPattern: "/dcim/racks/", + ID: "dcim_rear-ports_delete", + Method: "DELETE", + PathPattern: "/dcim/rear-ports/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRacksListReader{formats: a.formats}, + Reader: &DcimRearPortsDeleteReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4157,28 +5375,28 @@ func (a *Client) DcimRacksList(params *DcimRacksListParams, authInfo runtime.Cli if err != nil { return nil, err } - return result.(*DcimRacksListOK), nil + return result.(*DcimRearPortsDeleteNoContent), nil } /* -DcimRacksPartialUpdate dcim racks partial update API +DcimRearPortsList Call to super to allow for caching */ -func (a *Client) DcimRacksPartialUpdate(params *DcimRacksPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksPartialUpdateOK, error) { +func (a *Client) DcimRearPortsList(params *DcimRearPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRacksPartialUpdateParams() + params = NewDcimRearPortsListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_racks_partial_update", - Method: "PATCH", - PathPattern: "/dcim/racks/{id}/", + ID: "dcim_rear-ports_list", + Method: "GET", + PathPattern: "/dcim/rear-ports/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRacksPartialUpdateReader{formats: a.formats}, + Reader: &DcimRearPortsListReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4186,28 +5404,28 @@ func (a *Client) DcimRacksPartialUpdate(params *DcimRacksPartialUpdateParams, au if err != nil { return nil, err } - return result.(*DcimRacksPartialUpdateOK), nil + return result.(*DcimRearPortsListOK), nil } /* -DcimRacksRead dcim racks read API +DcimRearPortsPartialUpdate dcim rear ports partial update API */ -func (a *Client) DcimRacksRead(params *DcimRacksReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksReadOK, error) { +func (a *Client) DcimRearPortsPartialUpdate(params *DcimRearPortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortsPartialUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRacksReadParams() + params = NewDcimRearPortsPartialUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_racks_read", - Method: "GET", - PathPattern: "/dcim/racks/{id}/", + ID: "dcim_rear-ports_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rear-ports/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRacksReadReader{formats: a.formats}, + Reader: &DcimRearPortsPartialUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4215,28 +5433,28 @@ func (a *Client) DcimRacksRead(params *DcimRacksReadParams, authInfo runtime.Cli if err != nil { return nil, err } - return result.(*DcimRacksReadOK), nil + return result.(*DcimRearPortsPartialUpdateOK), nil } /* -DcimRacksUnits List rack units (by rack) +DcimRearPortsRead Call to super to allow for caching */ -func (a *Client) DcimRacksUnits(params *DcimRacksUnitsParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksUnitsOK, error) { +func (a *Client) DcimRearPortsRead(params *DcimRearPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortsReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRacksUnitsParams() + params = NewDcimRearPortsReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_racks_units", + ID: "dcim_rear-ports_read", Method: "GET", - PathPattern: "/dcim/racks/{id}/units/", + PathPattern: "/dcim/rear-ports/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRacksUnitsReader{formats: a.formats}, + Reader: &DcimRearPortsReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4244,28 +5462,28 @@ func (a *Client) DcimRacksUnits(params *DcimRacksUnitsParams, authInfo runtime.C if err != nil { return nil, err } - return result.(*DcimRacksUnitsOK), nil + return result.(*DcimRearPortsReadOK), nil } /* -DcimRacksUpdate dcim racks update API +DcimRearPortsUpdate dcim rear ports update API */ -func (a *Client) DcimRacksUpdate(params *DcimRacksUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksUpdateOK, error) { +func (a *Client) DcimRearPortsUpdate(params *DcimRearPortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRearPortsUpdateOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewDcimRacksUpdateParams() + params = NewDcimRearPortsUpdateParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "dcim_racks_update", + ID: "dcim_rear-ports_update", Method: "PUT", - PathPattern: "/dcim/racks/{id}/", + PathPattern: "/dcim/rear-ports/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &DcimRacksUpdateReader{formats: a.formats}, + Reader: &DcimRearPortsUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -4273,7 +5491,7 @@ func (a *Client) DcimRacksUpdate(params *DcimRacksUpdateParams, authInfo runtime if err != nil { return nil, err } - return result.(*DcimRacksUpdateOK), nil + return result.(*DcimRearPortsUpdateOK), nil } @@ -4336,7 +5554,7 @@ func (a *Client) DcimRegionsDelete(params *DcimRegionsDeleteParams, authInfo run } /* -DcimRegionsList dcim regions list API +DcimRegionsList Call to super to allow for caching */ func (a *Client) DcimRegionsList(params *DcimRegionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsListOK, error) { // TODO: Validate the params before sending @@ -4394,7 +5612,7 @@ func (a *Client) DcimRegionsPartialUpdate(params *DcimRegionsPartialUpdateParams } /* -DcimRegionsRead dcim regions read API +DcimRegionsRead Call to super to allow for caching */ func (a *Client) DcimRegionsRead(params *DcimRegionsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsReadOK, error) { // TODO: Validate the params before sending @@ -4539,7 +5757,7 @@ func (a *Client) DcimSitesGraphs(params *DcimSitesGraphsParams, authInfo runtime } /* -DcimSitesList dcim sites list API +DcimSitesList Call to super to allow for caching */ func (a *Client) DcimSitesList(params *DcimSitesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesListOK, error) { // TODO: Validate the params before sending @@ -4597,7 +5815,7 @@ func (a *Client) DcimSitesPartialUpdate(params *DcimSitesPartialUpdateParams, au } /* -DcimSitesRead dcim sites read API +DcimSitesRead Call to super to allow for caching */ func (a *Client) DcimSitesRead(params *DcimSitesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesReadOK, error) { // TODO: Validate the params before sending @@ -4713,7 +5931,7 @@ func (a *Client) DcimVirtualChassisDelete(params *DcimVirtualChassisDeleteParams } /* -DcimVirtualChassisList dcim virtual chassis list API +DcimVirtualChassisList Call to super to allow for caching */ func (a *Client) DcimVirtualChassisList(params *DcimVirtualChassisListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisListOK, error) { // TODO: Validate the params before sending @@ -4771,7 +5989,7 @@ func (a *Client) DcimVirtualChassisPartialUpdate(params *DcimVirtualChassisParti } /* -DcimVirtualChassisRead dcim virtual chassis read API +DcimVirtualChassisRead Call to super to allow for caching */ func (a *Client) DcimVirtualChassisRead(params *DcimVirtualChassisReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisReadOK, error) { // TODO: Validate the params before sending diff --git a/netbox/client/dcim/dcim_connected_device_list_parameters.go b/netbox/client/dcim/dcim_connected_device_list_parameters.go index 2524a3be637bc6984f97fc9d138eb11121ba3e7e..02236fd2a92a7d64cd94725688d85b7cccaf7c9f 100644 --- a/netbox/client/dcim/dcim_connected_device_list_parameters.go +++ b/netbox/client/dcim/dcim_connected_device_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -155,20 +154,20 @@ func (o *DcimConnectedDeviceListParams) WriteToRequest(r runtime.ClientRequest, } var res []error - // query param peer-device + // query param peer_device qrPeerDevice := o.PeerDevice qPeerDevice := qrPeerDevice if qPeerDevice != "" { - if err := r.SetQueryParam("peer-device", qPeerDevice); err != nil { + if err := r.SetQueryParam("peer_device", qPeerDevice); err != nil { return err } } - // query param peer-interface + // query param peer_interface qrPeerInterface := o.PeerInterface qPeerInterface := qrPeerInterface if qPeerInterface != "" { - if err := r.SetQueryParam("peer-interface", qPeerInterface); err != nil { + if err := r.SetQueryParam("peer_interface", qPeerInterface); err != nil { return err } } diff --git a/netbox/client/dcim/dcim_connected_device_list_responses.go b/netbox/client/dcim/dcim_connected_device_list_responses.go index 2aada3c8b36f5a90b911823fd01cd1ccba41f607..d7c3bc20c4a8d71db507b90063443efb06510b7c 100644 --- a/netbox/client/dcim/dcim_connected_device_list_responses.go +++ b/netbox/client/dcim/dcim_connected_device_list_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConnectedDeviceListReader is a Reader for the DcimConnectedDeviceList structure. diff --git a/netbox/client/dcim/dcim_console_connections_list_parameters.go b/netbox/client/dcim/dcim_console_connections_list_parameters.go index 63185cfcaa026535c222e2519a880e84425c173c..6e709573659dae1ab6e3faf16153a5f50812a9bf 100644 --- a/netbox/client/dcim/dcim_console_connections_list_parameters.go +++ b/netbox/client/dcim/dcim_console_connections_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_connections_list_responses.go b/netbox/client/dcim/dcim_console_connections_list_responses.go index e909386be97a16edbf83b6eb243b83c944fec14c..3703789827defd86f15dc745438982f113edc814 100644 --- a/netbox/client/dcim/dcim_console_connections_list_responses.go +++ b/netbox/client/dcim/dcim_console_connections_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleConnectionsListReader is a Reader for the DcimConsoleConnectionsList structure. @@ -61,7 +65,7 @@ func NewDcimConsoleConnectionsListOK() *DcimConsoleConnectionsListOK { DcimConsoleConnectionsListOK dcim console connections list o k */ type DcimConsoleConnectionsListOK struct { - Payload *models.DcimConsoleConnectionsListOKBody + Payload *DcimConsoleConnectionsListOKBody } func (o *DcimConsoleConnectionsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimConsoleConnectionsListOK) Error() string { func (o *DcimConsoleConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimConsoleConnectionsListOKBody) + o.Payload = new(DcimConsoleConnectionsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimConsoleConnectionsListOK) readResponse(response runtime.ClientRespo return nil } + +/*DcimConsoleConnectionsListOKBody dcim console connections list o k body +swagger:model DcimConsoleConnectionsListOKBody +*/ +type DcimConsoleConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ConsolePort `json:"results"` +} + +// Validate validates this dcim console connections list o k body +func (o *DcimConsoleConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimConsoleConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsoleConnectionsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleConnectionsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsoleConnectionsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleConnectionsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsoleConnectionsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsoleConnectionsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimConsoleConnectionsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimConsoleConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimConsoleConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_create_parameters.go b/netbox/client/dcim/dcim_console_port_templates_create_parameters.go index e6fd658c89e220c167c6fd82d78c553f4efd74b6..79d1886dd7d6e1f649e11bab55ed9f8fc08e9831 100644 --- a/netbox/client/dcim/dcim_console_port_templates_create_parameters.go +++ b/netbox/client/dcim/dcim_console_port_templates_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsolePortTemplatesCreateParams creates a new DcimConsolePortTemplatesCreateParams object diff --git a/netbox/client/dcim/dcim_console_port_templates_create_responses.go b/netbox/client/dcim/dcim_console_port_templates_create_responses.go index 79d2ecacf4ef052be8833987909d6dbee03a401f..b78a627eb1fd1beae28db6fc248a91e5cd762b46 100644 --- a/netbox/client/dcim/dcim_console_port_templates_create_responses.go +++ b/netbox/client/dcim/dcim_console_port_templates_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortTemplatesCreateReader is a Reader for the DcimConsolePortTemplatesCreate structure. @@ -61,7 +61,7 @@ func NewDcimConsolePortTemplatesCreateCreated() *DcimConsolePortTemplatesCreateC DcimConsolePortTemplatesCreateCreated dcim console port templates create created */ type DcimConsolePortTemplatesCreateCreated struct { - Payload *models.WritableConsolePortTemplate + Payload *models.ConsolePortTemplate } func (o *DcimConsolePortTemplatesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsolePortTemplatesCreateCreated) Error() string { func (o *DcimConsolePortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsolePortTemplate) + o.Payload = new(models.ConsolePortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go b/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go index 1b1b898826fb40ab73410a7a195b1df60ea2e852..fec625f4c9c2879f5809477413561610eb8c0e45 100644 --- a/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go +++ b/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_port_templates_list_parameters.go b/netbox/client/dcim/dcim_console_port_templates_list_parameters.go index 3ed60c058e68908b6b4cc4c6268f38d0f32eb3f6..9a36b54011cb37d000777dc9e6ef1c781a8296c4 100644 --- a/netbox/client/dcim/dcim_console_port_templates_list_parameters.go +++ b/netbox/client/dcim/dcim_console_port_templates_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -79,6 +78,8 @@ type DcimConsolePortTemplatesListParams struct { /*DevicetypeID*/ DevicetypeID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -91,6 +92,8 @@ type DcimConsolePortTemplatesListParams struct { */ Offset *int64 + /*Q*/ + Q *string timeout time.Duration Context context.Context @@ -141,6 +144,17 @@ func (o *DcimConsolePortTemplatesListParams) SetDevicetypeID(devicetypeID *strin o.DevicetypeID = devicetypeID } +// WithID adds the id to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithID(id *string) *DcimConsolePortTemplatesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim console port templates list params func (o *DcimConsolePortTemplatesListParams) WithLimit(limit *int64) *DcimConsolePortTemplatesListParams { o.SetLimit(limit) @@ -174,6 +188,17 @@ func (o *DcimConsolePortTemplatesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithQ(q *string) *DcimConsolePortTemplatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetQ(q *string) { + o.Q = q +} + // WriteToRequest writes these params to a swagger request func (o *DcimConsolePortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -198,6 +223,22 @@ func (o *DcimConsolePortTemplatesListParams) WriteToRequest(r runtime.ClientRequ } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -246,6 +287,22 @@ func (o *DcimConsolePortTemplatesListParams) WriteToRequest(r runtime.ClientRequ } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_console_port_templates_list_responses.go b/netbox/client/dcim/dcim_console_port_templates_list_responses.go index 84e206bac6bfce7dc906acbd3db9ed3dfaec1141..bad4a4ba163b47b7ccf24e261771dc735f19c626 100644 --- a/netbox/client/dcim/dcim_console_port_templates_list_responses.go +++ b/netbox/client/dcim/dcim_console_port_templates_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortTemplatesListReader is a Reader for the DcimConsolePortTemplatesList structure. @@ -61,7 +65,7 @@ func NewDcimConsolePortTemplatesListOK() *DcimConsolePortTemplatesListOK { DcimConsolePortTemplatesListOK dcim console port templates list o k */ type DcimConsolePortTemplatesListOK struct { - Payload *models.DcimConsolePortTemplatesListOKBody + Payload *DcimConsolePortTemplatesListOKBody } func (o *DcimConsolePortTemplatesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimConsolePortTemplatesListOK) Error() string { func (o *DcimConsolePortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimConsolePortTemplatesListOKBody) + o.Payload = new(DcimConsolePortTemplatesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimConsolePortTemplatesListOK) readResponse(response runtime.ClientRes return nil } + +/*DcimConsolePortTemplatesListOKBody dcim console port templates list o k body +swagger:model DcimConsolePortTemplatesListOKBody +*/ +type DcimConsolePortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ConsolePortTemplate `json:"results"` +} + +// Validate validates this dcim console port templates list o k body +func (o *DcimConsolePortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimConsolePortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsolePortTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimConsolePortTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsolePortTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsolePortTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsolePortTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsolePortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsolePortTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimConsolePortTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimConsolePortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimConsolePortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsolePortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go index 652250e0844d58bd326b91d1bd656e1c3ba271bd..be1a624d4097beb4fc9132e58451a5ffe4017ef0 100644 --- a/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsolePortTemplatesPartialUpdateParams creates a new DcimConsolePortTemplatesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go b/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go index 1f49cc3cdf2d97b56d2297fd1e16a2d54c24c4ba..24901aa6766e17a5b53d8ab37e04ad00f63ac6ce 100644 --- a/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go +++ b/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortTemplatesPartialUpdateReader is a Reader for the DcimConsolePortTemplatesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimConsolePortTemplatesPartialUpdateOK() *DcimConsolePortTemplatesParti DcimConsolePortTemplatesPartialUpdateOK dcim console port templates partial update o k */ type DcimConsolePortTemplatesPartialUpdateOK struct { - Payload *models.WritableConsolePortTemplate + Payload *models.ConsolePortTemplate } func (o *DcimConsolePortTemplatesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsolePortTemplatesPartialUpdateOK) Error() string { func (o *DcimConsolePortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsolePortTemplate) + o.Payload = new(models.ConsolePortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_port_templates_read_parameters.go b/netbox/client/dcim/dcim_console_port_templates_read_parameters.go index 491c4b3d76325c86f3124487a37f0649319fbdd5..ddec45e2393902e26fbc730054e4ce9869c73a57 100644 --- a/netbox/client/dcim/dcim_console_port_templates_read_parameters.go +++ b/netbox/client/dcim/dcim_console_port_templates_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_port_templates_read_responses.go b/netbox/client/dcim/dcim_console_port_templates_read_responses.go index 1ccc3d07ee05e78bc8dd8c0d51caebefeff7354e..2db5940fbe5a19120db588b8d30c6020444b776a 100644 --- a/netbox/client/dcim/dcim_console_port_templates_read_responses.go +++ b/netbox/client/dcim/dcim_console_port_templates_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortTemplatesReadReader is a Reader for the DcimConsolePortTemplatesRead structure. diff --git a/netbox/client/dcim/dcim_console_port_templates_update_parameters.go b/netbox/client/dcim/dcim_console_port_templates_update_parameters.go index db9a5bd43cfda5adcf997eae448b34add21ce441..04aa2fac816c56111c55fd360eeb879626a0be71 100644 --- a/netbox/client/dcim/dcim_console_port_templates_update_parameters.go +++ b/netbox/client/dcim/dcim_console_port_templates_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsolePortTemplatesUpdateParams creates a new DcimConsolePortTemplatesUpdateParams object diff --git a/netbox/client/dcim/dcim_console_port_templates_update_responses.go b/netbox/client/dcim/dcim_console_port_templates_update_responses.go index ffc6eee4e66c1940bf972da79f412185f1d5c585..0e83540f6e229d4203ffd2a5a718ec9128e41423 100644 --- a/netbox/client/dcim/dcim_console_port_templates_update_responses.go +++ b/netbox/client/dcim/dcim_console_port_templates_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortTemplatesUpdateReader is a Reader for the DcimConsolePortTemplatesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimConsolePortTemplatesUpdateOK() *DcimConsolePortTemplatesUpdateOK { DcimConsolePortTemplatesUpdateOK dcim console port templates update o k */ type DcimConsolePortTemplatesUpdateOK struct { - Payload *models.WritableConsolePortTemplate + Payload *models.ConsolePortTemplate } func (o *DcimConsolePortTemplatesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsolePortTemplatesUpdateOK) Error() string { func (o *DcimConsolePortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsolePortTemplate) + o.Payload = new(models.ConsolePortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_ports_create_parameters.go b/netbox/client/dcim/dcim_console_ports_create_parameters.go index bc293114599fd67a03df3e35124bc2f7e66ca5dc..b79577b5a3894c4a1ccfafb06ce9da4f06c5007d 100644 --- a/netbox/client/dcim/dcim_console_ports_create_parameters.go +++ b/netbox/client/dcim/dcim_console_ports_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsolePortsCreateParams creates a new DcimConsolePortsCreateParams object diff --git a/netbox/client/dcim/dcim_console_ports_create_responses.go b/netbox/client/dcim/dcim_console_ports_create_responses.go index f90a275a63782b3d6ca3d2d608778a3eb34eeaa7..15e8bed3b4016d643e89932f3f2f05288f6d6883 100644 --- a/netbox/client/dcim/dcim_console_ports_create_responses.go +++ b/netbox/client/dcim/dcim_console_ports_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortsCreateReader is a Reader for the DcimConsolePortsCreate structure. @@ -61,7 +61,7 @@ func NewDcimConsolePortsCreateCreated() *DcimConsolePortsCreateCreated { DcimConsolePortsCreateCreated dcim console ports create created */ type DcimConsolePortsCreateCreated struct { - Payload *models.WritableConsolePort + Payload *models.ConsolePort } func (o *DcimConsolePortsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsolePortsCreateCreated) Error() string { func (o *DcimConsolePortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsolePort) + o.Payload = new(models.ConsolePort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_ports_delete_parameters.go b/netbox/client/dcim/dcim_console_ports_delete_parameters.go index 333fded6a4dfdaa1d687b0c0987671abd766d9dd..4229a32f8907bca5e932bba2c4bce94012bf4d43 100644 --- a/netbox/client/dcim/dcim_console_ports_delete_parameters.go +++ b/netbox/client/dcim/dcim_console_ports_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_ports_list_parameters.go b/netbox/client/dcim/dcim_console_ports_list_parameters.go index cfe18410c5022cf47f8556e7a5a5548836f961ac..ef63c063794818580d1f8f7ae37804913819e24e 100644 --- a/netbox/client/dcim/dcim_console_ports_list_parameters.go +++ b/netbox/client/dcim/dcim_console_ports_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,10 +76,18 @@ for the dcim console ports list operation typically these are written to a http. */ type DcimConsolePortsListParams struct { + /*Cabled*/ + Cabled *string + /*ConnectionStatus*/ + ConnectionStatus *string + /*Description*/ + Description *string /*Device*/ Device *string /*DeviceID*/ DeviceID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -93,6 +100,10 @@ type DcimConsolePortsListParams struct { */ Offset *int64 + /*Q*/ + Q *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -132,6 +143,39 @@ func (o *DcimConsolePortsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithCabled adds the cabled to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithCabled(cabled *string) *DcimConsolePortsListParams { + o.SetCabled(cabled) + return o +} + +// SetCabled adds the cabled to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetCabled(cabled *string) { + o.Cabled = cabled +} + +// WithConnectionStatus adds the connectionStatus to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithConnectionStatus(connectionStatus *string) *DcimConsolePortsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDescription adds the description to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithDescription(description *string) *DcimConsolePortsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetDescription(description *string) { + o.Description = description +} + // WithDevice adds the device to the dcim console ports list params func (o *DcimConsolePortsListParams) WithDevice(device *string) *DcimConsolePortsListParams { o.SetDevice(device) @@ -154,6 +198,17 @@ func (o *DcimConsolePortsListParams) SetDeviceID(deviceID *string) { o.DeviceID = deviceID } +// WithID adds the id to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithID(id *string) *DcimConsolePortsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim console ports list params func (o *DcimConsolePortsListParams) WithLimit(limit *int64) *DcimConsolePortsListParams { o.SetLimit(limit) @@ -187,6 +242,28 @@ func (o *DcimConsolePortsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithQ(q *string) *DcimConsolePortsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithTag(tag *string) *DcimConsolePortsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *DcimConsolePortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -195,6 +272,54 @@ func (o *DcimConsolePortsListParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + if o.Cabled != nil { + + // query param cabled + var qrCabled string + if o.Cabled != nil { + qrCabled = *o.Cabled + } + qCabled := qrCabled + if qCabled != "" { + if err := r.SetQueryParam("cabled", qCabled); err != nil { + return err + } + } + + } + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Description != nil { + + // query param description + var qrDescription string + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + + } + if o.Device != nil { // query param device @@ -227,6 +352,22 @@ func (o *DcimConsolePortsListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -275,6 +416,38 @@ func (o *DcimConsolePortsListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_console_ports_list_responses.go b/netbox/client/dcim/dcim_console_ports_list_responses.go index 01435605ea6a4597c771421cd11797518f4bc9ba..1907907cda4cc4567a1f5596d7cf66daba5cbb65 100644 --- a/netbox/client/dcim/dcim_console_ports_list_responses.go +++ b/netbox/client/dcim/dcim_console_ports_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortsListReader is a Reader for the DcimConsolePortsList structure. @@ -61,7 +65,7 @@ func NewDcimConsolePortsListOK() *DcimConsolePortsListOK { DcimConsolePortsListOK dcim console ports list o k */ type DcimConsolePortsListOK struct { - Payload *models.DcimConsolePortsListOKBody + Payload *DcimConsolePortsListOKBody } func (o *DcimConsolePortsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimConsolePortsListOK) Error() string { func (o *DcimConsolePortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimConsolePortsListOKBody) + o.Payload = new(DcimConsolePortsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimConsolePortsListOK) readResponse(response runtime.ClientResponse, c return nil } + +/*DcimConsolePortsListOKBody dcim console ports list o k body +swagger:model DcimConsolePortsListOKBody +*/ +type DcimConsolePortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ConsolePort `json:"results"` +} + +// Validate validates this dcim console ports list o k body +func (o *DcimConsolePortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimConsolePortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsolePortsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimConsolePortsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsolePortsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsolePortsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsolePortsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsolePortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsolePortsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimConsolePortsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimConsolePortsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimConsolePortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsolePortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go b/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go index 87084f60609d15fc8557911d5452557c59ad4a59..562638d6e1325e59bd015e55220802905c72bacb 100644 --- a/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsolePortsPartialUpdateParams creates a new DcimConsolePortsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_console_ports_partial_update_responses.go b/netbox/client/dcim/dcim_console_ports_partial_update_responses.go index 9fb4bfc118fa85b61f68d998d09c21faf2e932fa..782d44ae8261896f8f59a068410dd9e7c5975eb2 100644 --- a/netbox/client/dcim/dcim_console_ports_partial_update_responses.go +++ b/netbox/client/dcim/dcim_console_ports_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortsPartialUpdateReader is a Reader for the DcimConsolePortsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimConsolePortsPartialUpdateOK() *DcimConsolePortsPartialUpdateOK { DcimConsolePortsPartialUpdateOK dcim console ports partial update o k */ type DcimConsolePortsPartialUpdateOK struct { - Payload *models.WritableConsolePort + Payload *models.ConsolePort } func (o *DcimConsolePortsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsolePortsPartialUpdateOK) Error() string { func (o *DcimConsolePortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsolePort) + o.Payload = new(models.ConsolePort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_ports_read_parameters.go b/netbox/client/dcim/dcim_console_ports_read_parameters.go index 0687617363c916948b30a9633fd1aba97e7878dd..7a441b70c7b3fdf88784604fddaa124fa591dc4b 100644 --- a/netbox/client/dcim/dcim_console_ports_read_parameters.go +++ b/netbox/client/dcim/dcim_console_ports_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_ports_read_responses.go b/netbox/client/dcim/dcim_console_ports_read_responses.go index e25a09fca3eb1d6ff23fd16081b2c7674773b32e..5e0e811165776e0c14c5103fb16f9e30cd9ab4c3 100644 --- a/netbox/client/dcim/dcim_console_ports_read_responses.go +++ b/netbox/client/dcim/dcim_console_ports_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortsReadReader is a Reader for the DcimConsolePortsRead structure. diff --git a/netbox/client/dcim/dcim_console_ports_trace_parameters.go b/netbox/client/dcim/dcim_console_ports_trace_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..34352f7c916eb95b5c6c9c7f76e8d83cf76e4238 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_trace_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsolePortsTraceParams creates a new DcimConsolePortsTraceParams object +// with the default values initialized. +func NewDcimConsolePortsTraceParams() *DcimConsolePortsTraceParams { + var () + return &DcimConsolePortsTraceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsTraceParamsWithTimeout creates a new DcimConsolePortsTraceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsTraceParamsWithTimeout(timeout time.Duration) *DcimConsolePortsTraceParams { + var () + return &DcimConsolePortsTraceParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsTraceParamsWithContext creates a new DcimConsolePortsTraceParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsTraceParamsWithContext(ctx context.Context) *DcimConsolePortsTraceParams { + var () + return &DcimConsolePortsTraceParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsTraceParamsWithHTTPClient creates a new DcimConsolePortsTraceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsTraceParamsWithHTTPClient(client *http.Client) *DcimConsolePortsTraceParams { + var () + return &DcimConsolePortsTraceParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsTraceParams contains all the parameters to send to the API endpoint +for the dcim console ports trace operation typically these are written to a http.Request +*/ +type DcimConsolePortsTraceParams struct { + + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports trace params +func (o *DcimConsolePortsTraceParams) WithTimeout(timeout time.Duration) *DcimConsolePortsTraceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports trace params +func (o *DcimConsolePortsTraceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports trace params +func (o *DcimConsolePortsTraceParams) WithContext(ctx context.Context) *DcimConsolePortsTraceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports trace params +func (o *DcimConsolePortsTraceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports trace params +func (o *DcimConsolePortsTraceParams) WithHTTPClient(client *http.Client) *DcimConsolePortsTraceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports trace params +func (o *DcimConsolePortsTraceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console ports trace params +func (o *DcimConsolePortsTraceParams) WithID(id int64) *DcimConsolePortsTraceParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports trace params +func (o *DcimConsolePortsTraceParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsTraceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_trace_responses.go b/netbox/client/dcim/dcim_console_ports_trace_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7ac51a7eb1aa87333aad10457c9cec1780e8be5b --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_trace_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsolePortsTraceReader is a Reader for the DcimConsolePortsTrace structure. +type DcimConsolePortsTraceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsTraceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsTraceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsolePortsTraceOK creates a DcimConsolePortsTraceOK with default headers values +func NewDcimConsolePortsTraceOK() *DcimConsolePortsTraceOK { + return &DcimConsolePortsTraceOK{} +} + +/*DcimConsolePortsTraceOK handles this case with default header values. + +DcimConsolePortsTraceOK dcim console ports trace o k +*/ +type DcimConsolePortsTraceOK struct { + Payload *models.ConsolePort +} + +func (o *DcimConsolePortsTraceOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-ports/{id}/trace/][%d] dcimConsolePortsTraceOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsTraceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_update_parameters.go b/netbox/client/dcim/dcim_console_ports_update_parameters.go index fd01fddd48c9aa591e64d83dae65fc9d3cbe1565..318777ab58742cb718d0f95be86c21be8f4a5e2b 100644 --- a/netbox/client/dcim/dcim_console_ports_update_parameters.go +++ b/netbox/client/dcim/dcim_console_ports_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsolePortsUpdateParams creates a new DcimConsolePortsUpdateParams object diff --git a/netbox/client/dcim/dcim_console_ports_update_responses.go b/netbox/client/dcim/dcim_console_ports_update_responses.go index 4c6332b7afb8cb3b868df0acb097f5c61ca405ec..51377d86381445716d0ebe8d3c5dedb42dd24c38 100644 --- a/netbox/client/dcim/dcim_console_ports_update_responses.go +++ b/netbox/client/dcim/dcim_console_ports_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsolePortsUpdateReader is a Reader for the DcimConsolePortsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimConsolePortsUpdateOK() *DcimConsolePortsUpdateOK { DcimConsolePortsUpdateOK dcim console ports update o k */ type DcimConsolePortsUpdateOK struct { - Payload *models.WritableConsolePort + Payload *models.ConsolePort } func (o *DcimConsolePortsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsolePortsUpdateOK) Error() string { func (o *DcimConsolePortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsolePort) + o.Payload = new(models.ConsolePort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go index 9547dd399e8c38a99a6b40904a234cd38ef580c1..5a1244f3e8ac658f69db8da763c186ecb83a3d67 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsoleServerPortTemplatesCreateParams creates a new DcimConsoleServerPortTemplatesCreateParams object diff --git a/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go index 55bb25ddad151e9bf3a34ee15b225c1e4e3dc9f5..e6b399d0176e650de7e2638655e59c98f9aaa824 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortTemplatesCreateReader is a Reader for the DcimConsoleServerPortTemplatesCreate structure. @@ -61,7 +61,7 @@ func NewDcimConsoleServerPortTemplatesCreateCreated() *DcimConsoleServerPortTemp DcimConsoleServerPortTemplatesCreateCreated dcim console server port templates create created */ type DcimConsoleServerPortTemplatesCreateCreated struct { - Payload *models.WritableConsoleServerPortTemplate + Payload *models.ConsoleServerPortTemplate } func (o *DcimConsoleServerPortTemplatesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsoleServerPortTemplatesCreateCreated) Error() string { func (o *DcimConsoleServerPortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsoleServerPortTemplate) + o.Payload = new(models.ConsoleServerPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go index 2d7623c6a86a29ab901ab89cd652a4e00ff1d8db..35922d40e9626243727c31339269996262e498ce 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go index 90779d9e25eadc47e3d9294e74083dd390ebb5eb..da847d0591baa43a9e8a54e98515e5adcd5b6266 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -79,6 +78,8 @@ type DcimConsoleServerPortTemplatesListParams struct { /*DevicetypeID*/ DevicetypeID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -91,6 +92,8 @@ type DcimConsoleServerPortTemplatesListParams struct { */ Offset *int64 + /*Q*/ + Q *string timeout time.Duration Context context.Context @@ -141,6 +144,17 @@ func (o *DcimConsoleServerPortTemplatesListParams) SetDevicetypeID(devicetypeID o.DevicetypeID = devicetypeID } +// WithID adds the id to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithID(id *string) *DcimConsoleServerPortTemplatesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim console server port templates list params func (o *DcimConsoleServerPortTemplatesListParams) WithLimit(limit *int64) *DcimConsoleServerPortTemplatesListParams { o.SetLimit(limit) @@ -174,6 +188,17 @@ func (o *DcimConsoleServerPortTemplatesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithQ(q *string) *DcimConsoleServerPortTemplatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetQ(q *string) { + o.Q = q +} + // WriteToRequest writes these params to a swagger request func (o *DcimConsoleServerPortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -198,6 +223,22 @@ func (o *DcimConsoleServerPortTemplatesListParams) WriteToRequest(r runtime.Clie } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -246,6 +287,22 @@ func (o *DcimConsoleServerPortTemplatesListParams) WriteToRequest(r runtime.Clie } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go index a0e1a97743e5a7bab7f5441b7a1ef42848280a74..367e27a488661a926b73255901bfc59511b91608 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortTemplatesListReader is a Reader for the DcimConsoleServerPortTemplatesList structure. @@ -61,7 +65,7 @@ func NewDcimConsoleServerPortTemplatesListOK() *DcimConsoleServerPortTemplatesLi DcimConsoleServerPortTemplatesListOK dcim console server port templates list o k */ type DcimConsoleServerPortTemplatesListOK struct { - Payload *models.DcimConsoleServerPortTemplatesListOKBody + Payload *DcimConsoleServerPortTemplatesListOKBody } func (o *DcimConsoleServerPortTemplatesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimConsoleServerPortTemplatesListOK) Error() string { func (o *DcimConsoleServerPortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimConsoleServerPortTemplatesListOKBody) + o.Payload = new(DcimConsoleServerPortTemplatesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimConsoleServerPortTemplatesListOK) readResponse(response runtime.Cli return nil } + +/*DcimConsoleServerPortTemplatesListOKBody dcim console server port templates list o k body +swagger:model DcimConsoleServerPortTemplatesListOKBody +*/ +type DcimConsoleServerPortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ConsoleServerPortTemplate `json:"results"` +} + +// Validate validates this dcim console server port templates list o k body +func (o *DcimConsoleServerPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimConsoleServerPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsoleServerPortTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleServerPortTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsoleServerPortTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleServerPortTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsoleServerPortTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleServerPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsoleServerPortTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimConsoleServerPortTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimConsoleServerPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimConsoleServerPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleServerPortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go index 5a6f3e0676ac5b8f0ee2d822638c90ab070fd6d0..02aa7279d8f7d087777d8ee516a6b8d230e98e60 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsoleServerPortTemplatesPartialUpdateParams creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go index 48d940d85fb057fb4ff3ab6d07aea24a965c015d..48823b5a3ed8fbc59a871a626a56dee814ccffc8 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortTemplatesPartialUpdateReader is a Reader for the DcimConsoleServerPortTemplatesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimConsoleServerPortTemplatesPartialUpdateOK() *DcimConsoleServerPortTe DcimConsoleServerPortTemplatesPartialUpdateOK dcim console server port templates partial update o k */ type DcimConsoleServerPortTemplatesPartialUpdateOK struct { - Payload *models.WritableConsoleServerPortTemplate + Payload *models.ConsoleServerPortTemplate } func (o *DcimConsoleServerPortTemplatesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsoleServerPortTemplatesPartialUpdateOK) Error() string { func (o *DcimConsoleServerPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsoleServerPortTemplate) + o.Payload = new(models.ConsoleServerPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go index 498d73cf6408e7e2dfd8e88011c930ed82bef96e..655b890df5f9119c9ad9c217a9faf213e0bf2cc1 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go index 9d2b9f6fab51989e798ffee03ecf34db46bed529..5eb9b76f05c162111ada7cf5d7238e5660c99a84 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortTemplatesReadReader is a Reader for the DcimConsoleServerPortTemplatesRead structure. diff --git a/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go index 26bfe388201391b9bf8c0cc2be2e0810d1e32cc0..ba4230405181b666ccd73527504aefc0cae0717b 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsoleServerPortTemplatesUpdateParams creates a new DcimConsoleServerPortTemplatesUpdateParams object diff --git a/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go index 633057db7272a1ff1b12f93fcbd9a4c9a2d8ab3b..0386d5fe3cdd04c6af53672de84a3542581f0def 100644 --- a/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go +++ b/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortTemplatesUpdateReader is a Reader for the DcimConsoleServerPortTemplatesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimConsoleServerPortTemplatesUpdateOK() *DcimConsoleServerPortTemplates DcimConsoleServerPortTemplatesUpdateOK dcim console server port templates update o k */ type DcimConsoleServerPortTemplatesUpdateOK struct { - Payload *models.WritableConsoleServerPortTemplate + Payload *models.ConsoleServerPortTemplate } func (o *DcimConsoleServerPortTemplatesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsoleServerPortTemplatesUpdateOK) Error() string { func (o *DcimConsoleServerPortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsoleServerPortTemplate) + o.Payload = new(models.ConsoleServerPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_server_ports_create_parameters.go b/netbox/client/dcim/dcim_console_server_ports_create_parameters.go index 7b6cbba83ae697e16785de388ec16a7fda49f25f..137417448bfc0339412a0aa5606dd877c4560f65 100644 --- a/netbox/client/dcim/dcim_console_server_ports_create_parameters.go +++ b/netbox/client/dcim/dcim_console_server_ports_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsoleServerPortsCreateParams creates a new DcimConsoleServerPortsCreateParams object diff --git a/netbox/client/dcim/dcim_console_server_ports_create_responses.go b/netbox/client/dcim/dcim_console_server_ports_create_responses.go index ea311acde6bb654dd102640f371415d43f2038f7..ee043490c8f06225a89d77071446082ef529465e 100644 --- a/netbox/client/dcim/dcim_console_server_ports_create_responses.go +++ b/netbox/client/dcim/dcim_console_server_ports_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortsCreateReader is a Reader for the DcimConsoleServerPortsCreate structure. @@ -61,7 +61,7 @@ func NewDcimConsoleServerPortsCreateCreated() *DcimConsoleServerPortsCreateCreat DcimConsoleServerPortsCreateCreated dcim console server ports create created */ type DcimConsoleServerPortsCreateCreated struct { - Payload *models.WritableConsoleServerPort + Payload *models.ConsoleServerPort } func (o *DcimConsoleServerPortsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsoleServerPortsCreateCreated) Error() string { func (o *DcimConsoleServerPortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsoleServerPort) + o.Payload = new(models.ConsoleServerPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go b/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go index 78592be6deef108f3c4d73187ff84b42b1908b71..53506437d17789a03c3a3d63de28e7d2b27ca64d 100644 --- a/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go +++ b/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_server_ports_list_parameters.go b/netbox/client/dcim/dcim_console_server_ports_list_parameters.go index df14161d45a1a73a0865dd457ed5017f91fe3005..1577bf03f7ba18bf618467a724378be23e924b43 100644 --- a/netbox/client/dcim/dcim_console_server_ports_list_parameters.go +++ b/netbox/client/dcim/dcim_console_server_ports_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,10 +76,18 @@ for the dcim console server ports list operation typically these are written to */ type DcimConsoleServerPortsListParams struct { + /*Cabled*/ + Cabled *string + /*ConnectionStatus*/ + ConnectionStatus *string + /*Description*/ + Description *string /*Device*/ Device *string /*DeviceID*/ DeviceID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -93,6 +100,10 @@ type DcimConsoleServerPortsListParams struct { */ Offset *int64 + /*Q*/ + Q *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -132,6 +143,39 @@ func (o *DcimConsoleServerPortsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithCabled adds the cabled to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithCabled(cabled *string) *DcimConsoleServerPortsListParams { + o.SetCabled(cabled) + return o +} + +// SetCabled adds the cabled to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetCabled(cabled *string) { + o.Cabled = cabled +} + +// WithConnectionStatus adds the connectionStatus to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithConnectionStatus(connectionStatus *string) *DcimConsoleServerPortsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDescription adds the description to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithDescription(description *string) *DcimConsoleServerPortsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetDescription(description *string) { + o.Description = description +} + // WithDevice adds the device to the dcim console server ports list params func (o *DcimConsoleServerPortsListParams) WithDevice(device *string) *DcimConsoleServerPortsListParams { o.SetDevice(device) @@ -154,6 +198,17 @@ func (o *DcimConsoleServerPortsListParams) SetDeviceID(deviceID *string) { o.DeviceID = deviceID } +// WithID adds the id to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithID(id *string) *DcimConsoleServerPortsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim console server ports list params func (o *DcimConsoleServerPortsListParams) WithLimit(limit *int64) *DcimConsoleServerPortsListParams { o.SetLimit(limit) @@ -187,6 +242,28 @@ func (o *DcimConsoleServerPortsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithQ(q *string) *DcimConsoleServerPortsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithTag(tag *string) *DcimConsoleServerPortsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *DcimConsoleServerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -195,6 +272,54 @@ func (o *DcimConsoleServerPortsListParams) WriteToRequest(r runtime.ClientReques } var res []error + if o.Cabled != nil { + + // query param cabled + var qrCabled string + if o.Cabled != nil { + qrCabled = *o.Cabled + } + qCabled := qrCabled + if qCabled != "" { + if err := r.SetQueryParam("cabled", qCabled); err != nil { + return err + } + } + + } + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Description != nil { + + // query param description + var qrDescription string + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + + } + if o.Device != nil { // query param device @@ -227,6 +352,22 @@ func (o *DcimConsoleServerPortsListParams) WriteToRequest(r runtime.ClientReques } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -275,6 +416,38 @@ func (o *DcimConsoleServerPortsListParams) WriteToRequest(r runtime.ClientReques } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_console_server_ports_list_responses.go b/netbox/client/dcim/dcim_console_server_ports_list_responses.go index fd9ac09f46c7599e775dc777f5fe95eebb98109e..496aa5466259764e77c844ba403dfc11b52a44f7 100644 --- a/netbox/client/dcim/dcim_console_server_ports_list_responses.go +++ b/netbox/client/dcim/dcim_console_server_ports_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortsListReader is a Reader for the DcimConsoleServerPortsList structure. @@ -61,7 +65,7 @@ func NewDcimConsoleServerPortsListOK() *DcimConsoleServerPortsListOK { DcimConsoleServerPortsListOK dcim console server ports list o k */ type DcimConsoleServerPortsListOK struct { - Payload *models.DcimConsoleServerPortsListOKBody + Payload *DcimConsoleServerPortsListOKBody } func (o *DcimConsoleServerPortsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimConsoleServerPortsListOK) Error() string { func (o *DcimConsoleServerPortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimConsoleServerPortsListOKBody) + o.Payload = new(DcimConsoleServerPortsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimConsoleServerPortsListOK) readResponse(response runtime.ClientRespo return nil } + +/*DcimConsoleServerPortsListOKBody dcim console server ports list o k body +swagger:model DcimConsoleServerPortsListOKBody +*/ +type DcimConsoleServerPortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ConsoleServerPort `json:"results"` +} + +// Validate validates this dcim console server ports list o k body +func (o *DcimConsoleServerPortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimConsoleServerPortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsoleServerPortsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleServerPortsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsoleServerPortsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleServerPortsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimConsoleServerPortsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimConsoleServerPortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimConsoleServerPortsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimConsoleServerPortsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimConsoleServerPortsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimConsoleServerPortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleServerPortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go b/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go index 90d0deadbcdcb69c8790df2f6b2e8bca7d2f721e..4c354b9cf52535a852971b76d338833311893ad1 100644 --- a/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsoleServerPortsPartialUpdateParams creates a new DcimConsoleServerPortsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go b/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go index bcbac0ad285b8b0c2d4084fc84101e0c912431c0..358c23bb273115053da928503229205cb9220706 100644 --- a/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go +++ b/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortsPartialUpdateReader is a Reader for the DcimConsoleServerPortsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimConsoleServerPortsPartialUpdateOK() *DcimConsoleServerPortsPartialUp DcimConsoleServerPortsPartialUpdateOK dcim console server ports partial update o k */ type DcimConsoleServerPortsPartialUpdateOK struct { - Payload *models.WritableConsoleServerPort + Payload *models.ConsoleServerPort } func (o *DcimConsoleServerPortsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsoleServerPortsPartialUpdateOK) Error() string { func (o *DcimConsoleServerPortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsoleServerPort) + o.Payload = new(models.ConsoleServerPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_console_server_ports_read_parameters.go b/netbox/client/dcim/dcim_console_server_ports_read_parameters.go index 5dd2d73a87fb8afd3dbc6ef58b9c9717793337c8..0c54c78d966a9ec001b725aa7315dcce0952fd92 100644 --- a/netbox/client/dcim/dcim_console_server_ports_read_parameters.go +++ b/netbox/client/dcim/dcim_console_server_ports_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_console_server_ports_read_responses.go b/netbox/client/dcim/dcim_console_server_ports_read_responses.go index a1790ee5615a0295d749f4570f86aab0c4428ac8..5d5ec11e4b09a718d0b84f34e4615524c40d5676 100644 --- a/netbox/client/dcim/dcim_console_server_ports_read_responses.go +++ b/netbox/client/dcim/dcim_console_server_ports_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortsReadReader is a Reader for the DcimConsoleServerPortsRead structure. diff --git a/netbox/client/dcim/dcim_console_server_ports_trace_parameters.go b/netbox/client/dcim/dcim_console_server_ports_trace_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6afafa6924a91a142ea36399281af675b9172da4 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_trace_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimConsoleServerPortsTraceParams creates a new DcimConsoleServerPortsTraceParams object +// with the default values initialized. +func NewDcimConsoleServerPortsTraceParams() *DcimConsoleServerPortsTraceParams { + var () + return &DcimConsoleServerPortsTraceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsTraceParamsWithTimeout creates a new DcimConsoleServerPortsTraceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsTraceParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsTraceParams { + var () + return &DcimConsoleServerPortsTraceParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsTraceParamsWithContext creates a new DcimConsoleServerPortsTraceParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsTraceParamsWithContext(ctx context.Context) *DcimConsoleServerPortsTraceParams { + var () + return &DcimConsoleServerPortsTraceParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsTraceParamsWithHTTPClient creates a new DcimConsoleServerPortsTraceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsTraceParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsTraceParams { + var () + return &DcimConsoleServerPortsTraceParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsTraceParams contains all the parameters to send to the API endpoint +for the dcim console server ports trace operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsTraceParams struct { + + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports trace params +func (o *DcimConsoleServerPortsTraceParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsTraceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports trace params +func (o *DcimConsoleServerPortsTraceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports trace params +func (o *DcimConsoleServerPortsTraceParams) WithContext(ctx context.Context) *DcimConsoleServerPortsTraceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports trace params +func (o *DcimConsoleServerPortsTraceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports trace params +func (o *DcimConsoleServerPortsTraceParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsTraceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports trace params +func (o *DcimConsoleServerPortsTraceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server ports trace params +func (o *DcimConsoleServerPortsTraceParams) WithID(id int64) *DcimConsoleServerPortsTraceParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports trace params +func (o *DcimConsoleServerPortsTraceParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsTraceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_trace_responses.go b/netbox/client/dcim/dcim_console_server_ports_trace_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..52a1956b6c76741df16ae5e9f3f3e8db85438113 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_trace_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimConsoleServerPortsTraceReader is a Reader for the DcimConsoleServerPortsTrace structure. +type DcimConsoleServerPortsTraceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsTraceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsTraceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimConsoleServerPortsTraceOK creates a DcimConsoleServerPortsTraceOK with default headers values +func NewDcimConsoleServerPortsTraceOK() *DcimConsoleServerPortsTraceOK { + return &DcimConsoleServerPortsTraceOK{} +} + +/*DcimConsoleServerPortsTraceOK handles this case with default header values. + +DcimConsoleServerPortsTraceOK dcim console server ports trace o k +*/ +type DcimConsoleServerPortsTraceOK struct { + Payload *models.ConsoleServerPort +} + +func (o *DcimConsoleServerPortsTraceOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-ports/{id}/trace/][%d] dcimConsoleServerPortsTraceOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsTraceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsoleServerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_update_parameters.go b/netbox/client/dcim/dcim_console_server_ports_update_parameters.go index 06832cd197fc3811fa01e56325adf17ec68251e5..c769d6f7b28f7060a0589e8b2d4aff7a3b03f271 100644 --- a/netbox/client/dcim/dcim_console_server_ports_update_parameters.go +++ b/netbox/client/dcim/dcim_console_server_ports_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimConsoleServerPortsUpdateParams creates a new DcimConsoleServerPortsUpdateParams object diff --git a/netbox/client/dcim/dcim_console_server_ports_update_responses.go b/netbox/client/dcim/dcim_console_server_ports_update_responses.go index f90c9c531abdd0d49cec0be3ae500d16b96a4d24..93d215ae05e834302bb89e036b6ad6cbb3b5c29e 100644 --- a/netbox/client/dcim/dcim_console_server_ports_update_responses.go +++ b/netbox/client/dcim/dcim_console_server_ports_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimConsoleServerPortsUpdateReader is a Reader for the DcimConsoleServerPortsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimConsoleServerPortsUpdateOK() *DcimConsoleServerPortsUpdateOK { DcimConsoleServerPortsUpdateOK dcim console server ports update o k */ type DcimConsoleServerPortsUpdateOK struct { - Payload *models.WritableConsoleServerPort + Payload *models.ConsoleServerPort } func (o *DcimConsoleServerPortsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimConsoleServerPortsUpdateOK) Error() string { func (o *DcimConsoleServerPortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableConsoleServerPort) + o.Payload = new(models.ConsoleServerPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go index b0fdaf2b4000620a62984ba42193ef1ca39237e6..e2eb1f62b5fdaa5239dea56769a0aab06e123880 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go +++ b/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceBayTemplatesCreateParams creates a new DcimDeviceBayTemplatesCreateParams object diff --git a/netbox/client/dcim/dcim_device_bay_templates_create_responses.go b/netbox/client/dcim/dcim_device_bay_templates_create_responses.go index e947354d11856450aca06169ef4c365a98801b59..7687c16e0ec6f95947885e17deb8d1821735afb3 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_create_responses.go +++ b/netbox/client/dcim/dcim_device_bay_templates_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBayTemplatesCreateReader is a Reader for the DcimDeviceBayTemplatesCreate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceBayTemplatesCreateCreated() *DcimDeviceBayTemplatesCreateCreat DcimDeviceBayTemplatesCreateCreated dcim device bay templates create created */ type DcimDeviceBayTemplatesCreateCreated struct { - Payload *models.WritableDeviceBayTemplate + Payload *models.DeviceBayTemplate } func (o *DcimDeviceBayTemplatesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceBayTemplatesCreateCreated) Error() string { func (o *DcimDeviceBayTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceBayTemplate) + o.Payload = new(models.DeviceBayTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go index 43928cc501b5b2a266fde0bdc5de6d1b05791c89..497b07e8096e8bb6e6e7cdc5c002a6b7f2b7daa7 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go +++ b/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go index b967bcf90d8b0acab43dbd1317d32302d7989bd8..9f1361c8786155a0d1b4d4b5ae34e8bd24e15759 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go +++ b/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -79,6 +78,8 @@ type DcimDeviceBayTemplatesListParams struct { /*DevicetypeID*/ DevicetypeID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -91,6 +92,8 @@ type DcimDeviceBayTemplatesListParams struct { */ Offset *int64 + /*Q*/ + Q *string timeout time.Duration Context context.Context @@ -141,6 +144,17 @@ func (o *DcimDeviceBayTemplatesListParams) SetDevicetypeID(devicetypeID *string) o.DevicetypeID = devicetypeID } +// WithID adds the id to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithID(id *string) *DcimDeviceBayTemplatesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim device bay templates list params func (o *DcimDeviceBayTemplatesListParams) WithLimit(limit *int64) *DcimDeviceBayTemplatesListParams { o.SetLimit(limit) @@ -174,6 +188,17 @@ func (o *DcimDeviceBayTemplatesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithQ(q *string) *DcimDeviceBayTemplatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetQ(q *string) { + o.Q = q +} + // WriteToRequest writes these params to a swagger request func (o *DcimDeviceBayTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -198,6 +223,22 @@ func (o *DcimDeviceBayTemplatesListParams) WriteToRequest(r runtime.ClientReques } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -246,6 +287,22 @@ func (o *DcimDeviceBayTemplatesListParams) WriteToRequest(r runtime.ClientReques } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_device_bay_templates_list_responses.go b/netbox/client/dcim/dcim_device_bay_templates_list_responses.go index 1e83bc7611f3e4525f085b3b299a65d0bbe6c42e..41b93ffd5fa62d07ea20f430ee7c3f37deb56e2e 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_list_responses.go +++ b/netbox/client/dcim/dcim_device_bay_templates_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBayTemplatesListReader is a Reader for the DcimDeviceBayTemplatesList structure. @@ -61,7 +65,7 @@ func NewDcimDeviceBayTemplatesListOK() *DcimDeviceBayTemplatesListOK { DcimDeviceBayTemplatesListOK dcim device bay templates list o k */ type DcimDeviceBayTemplatesListOK struct { - Payload *models.DcimDeviceBayTemplatesListOKBody + Payload *DcimDeviceBayTemplatesListOKBody } func (o *DcimDeviceBayTemplatesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimDeviceBayTemplatesListOK) Error() string { func (o *DcimDeviceBayTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimDeviceBayTemplatesListOKBody) + o.Payload = new(DcimDeviceBayTemplatesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimDeviceBayTemplatesListOK) readResponse(response runtime.ClientRespo return nil } + +/*DcimDeviceBayTemplatesListOKBody dcim device bay templates list o k body +swagger:model DcimDeviceBayTemplatesListOKBody +*/ +type DcimDeviceBayTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.DeviceBayTemplate `json:"results"` +} + +// Validate validates this dcim device bay templates list o k body +func (o *DcimDeviceBayTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimDeviceBayTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimDeviceBayTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceBayTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimDeviceBayTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceBayTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimDeviceBayTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceBayTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimDeviceBayTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimDeviceBayTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimDeviceBayTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimDeviceBayTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceBayTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go index 7fd8556bd882a353d4f192b5809d5ea436446758..f4fe7f22dbf90c8dc41b0eb019506d04bfa54850 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceBayTemplatesPartialUpdateParams creates a new DcimDeviceBayTemplatesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go b/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go index be2b1e0ce6d6482ff7aa17470cf29d6cc799388c..0142fbe8c64ac9a9511a4b6dfc56bc50cc5bd330 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go +++ b/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBayTemplatesPartialUpdateReader is a Reader for the DcimDeviceBayTemplatesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceBayTemplatesPartialUpdateOK() *DcimDeviceBayTemplatesPartialUp DcimDeviceBayTemplatesPartialUpdateOK dcim device bay templates partial update o k */ type DcimDeviceBayTemplatesPartialUpdateOK struct { - Payload *models.WritableDeviceBayTemplate + Payload *models.DeviceBayTemplate } func (o *DcimDeviceBayTemplatesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceBayTemplatesPartialUpdateOK) Error() string { func (o *DcimDeviceBayTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceBayTemplate) + o.Payload = new(models.DeviceBayTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go index 3e450eafe68f3e3cf10125eaa5164bd4a0f4d5a9..5054c4075c81f25c5779799b3e858eb8f865670b 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go +++ b/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_device_bay_templates_read_responses.go b/netbox/client/dcim/dcim_device_bay_templates_read_responses.go index 81e2dea77ed25852bce8a25b67f037403f4b07d9..989978d15422ffb29a53af6d83b255c2350d3a9d 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_read_responses.go +++ b/netbox/client/dcim/dcim_device_bay_templates_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBayTemplatesReadReader is a Reader for the DcimDeviceBayTemplatesRead structure. diff --git a/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go index 1a8c9268eace9dd6d255a7d58afeaae3d467aae5..d2389b120fb28a48837077b32db2da564105d826 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go +++ b/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceBayTemplatesUpdateParams creates a new DcimDeviceBayTemplatesUpdateParams object diff --git a/netbox/client/dcim/dcim_device_bay_templates_update_responses.go b/netbox/client/dcim/dcim_device_bay_templates_update_responses.go index 8f67bd928b5970e0517700f2ee0f53464ab40e82..5da0afdb8125d66e73435897e48be15bfa081e4d 100644 --- a/netbox/client/dcim/dcim_device_bay_templates_update_responses.go +++ b/netbox/client/dcim/dcim_device_bay_templates_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBayTemplatesUpdateReader is a Reader for the DcimDeviceBayTemplatesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceBayTemplatesUpdateOK() *DcimDeviceBayTemplatesUpdateOK { DcimDeviceBayTemplatesUpdateOK dcim device bay templates update o k */ type DcimDeviceBayTemplatesUpdateOK struct { - Payload *models.WritableDeviceBayTemplate + Payload *models.DeviceBayTemplate } func (o *DcimDeviceBayTemplatesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceBayTemplatesUpdateOK) Error() string { func (o *DcimDeviceBayTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceBayTemplate) + o.Payload = new(models.DeviceBayTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_bays_create_parameters.go b/netbox/client/dcim/dcim_device_bays_create_parameters.go index d4f8b0d49977919ea3c225b1d5ab87c02722d247..f4c3c9418c304735548f258ee8f3981c6baf6b2b 100644 --- a/netbox/client/dcim/dcim_device_bays_create_parameters.go +++ b/netbox/client/dcim/dcim_device_bays_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceBaysCreateParams creates a new DcimDeviceBaysCreateParams object diff --git a/netbox/client/dcim/dcim_device_bays_create_responses.go b/netbox/client/dcim/dcim_device_bays_create_responses.go index 17a31cd3fcef8555e2aec168a32252af51b2dbcb..2ea5d4efe259f51ef8e09605cc97e1ff6c573759 100644 --- a/netbox/client/dcim/dcim_device_bays_create_responses.go +++ b/netbox/client/dcim/dcim_device_bays_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBaysCreateReader is a Reader for the DcimDeviceBaysCreate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceBaysCreateCreated() *DcimDeviceBaysCreateCreated { DcimDeviceBaysCreateCreated dcim device bays create created */ type DcimDeviceBaysCreateCreated struct { - Payload *models.WritableDeviceBay + Payload *models.DeviceBay } func (o *DcimDeviceBaysCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceBaysCreateCreated) Error() string { func (o *DcimDeviceBaysCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceBay) + o.Payload = new(models.DeviceBay) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_bays_delete_parameters.go b/netbox/client/dcim/dcim_device_bays_delete_parameters.go index 834eab814853a5455f1fa1b5ad4e9d251b68bbcf..5fa90e4b9d8d63c3afb0318a6f2149b0ad3a936c 100644 --- a/netbox/client/dcim/dcim_device_bays_delete_parameters.go +++ b/netbox/client/dcim/dcim_device_bays_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_device_bays_list_parameters.go b/netbox/client/dcim/dcim_device_bays_list_parameters.go index 1c8fe534c4e1f11b1504502d0e9e48e49f2c6f40..a310fe98ad0700a4d371f758cc28d47d868625b3 100644 --- a/netbox/client/dcim/dcim_device_bays_list_parameters.go +++ b/netbox/client/dcim/dcim_device_bays_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,10 +76,14 @@ for the dcim device bays list operation typically these are written to a http.Re */ type DcimDeviceBaysListParams struct { + /*Description*/ + Description *string /*Device*/ Device *string /*DeviceID*/ DeviceID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -93,6 +96,10 @@ type DcimDeviceBaysListParams struct { */ Offset *int64 + /*Q*/ + Q *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -132,6 +139,17 @@ func (o *DcimDeviceBaysListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithDescription adds the description to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithDescription(description *string) *DcimDeviceBaysListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetDescription(description *string) { + o.Description = description +} + // WithDevice adds the device to the dcim device bays list params func (o *DcimDeviceBaysListParams) WithDevice(device *string) *DcimDeviceBaysListParams { o.SetDevice(device) @@ -154,6 +172,17 @@ func (o *DcimDeviceBaysListParams) SetDeviceID(deviceID *string) { o.DeviceID = deviceID } +// WithID adds the id to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithID(id *string) *DcimDeviceBaysListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim device bays list params func (o *DcimDeviceBaysListParams) WithLimit(limit *int64) *DcimDeviceBaysListParams { o.SetLimit(limit) @@ -187,6 +216,28 @@ func (o *DcimDeviceBaysListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithQ(q *string) *DcimDeviceBaysListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithTag(tag *string) *DcimDeviceBaysListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *DcimDeviceBaysListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -195,6 +246,22 @@ func (o *DcimDeviceBaysListParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.Description != nil { + + // query param description + var qrDescription string + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + + } + if o.Device != nil { // query param device @@ -227,6 +294,22 @@ func (o *DcimDeviceBaysListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -275,6 +358,38 @@ func (o *DcimDeviceBaysListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_device_bays_list_responses.go b/netbox/client/dcim/dcim_device_bays_list_responses.go index 5ed482c8dfea35a5a3a71135e7bef0da24e4d104..e0c1d7b69b8ef3ef947ad6ce56498d5777e57d92 100644 --- a/netbox/client/dcim/dcim_device_bays_list_responses.go +++ b/netbox/client/dcim/dcim_device_bays_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBaysListReader is a Reader for the DcimDeviceBaysList structure. @@ -61,7 +65,7 @@ func NewDcimDeviceBaysListOK() *DcimDeviceBaysListOK { DcimDeviceBaysListOK dcim device bays list o k */ type DcimDeviceBaysListOK struct { - Payload *models.DcimDeviceBaysListOKBody + Payload *DcimDeviceBaysListOKBody } func (o *DcimDeviceBaysListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimDeviceBaysListOK) Error() string { func (o *DcimDeviceBaysListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimDeviceBaysListOKBody) + o.Payload = new(DcimDeviceBaysListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimDeviceBaysListOK) readResponse(response runtime.ClientResponse, con return nil } + +/*DcimDeviceBaysListOKBody dcim device bays list o k body +swagger:model DcimDeviceBaysListOKBody +*/ +type DcimDeviceBaysListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.DeviceBay `json:"results"` +} + +// Validate validates this dcim device bays list o k body +func (o *DcimDeviceBaysListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimDeviceBaysListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimDeviceBaysListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceBaysListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimDeviceBaysListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceBaysListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimDeviceBaysListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceBaysListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimDeviceBaysListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimDeviceBaysListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimDeviceBaysListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimDeviceBaysListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceBaysListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go b/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go index 5271419bb0c8e33341d03b962d46c9cf29017242..27fcd3715db35bb6cbfc7bb2f6c3ecd81a0e1285 100644 --- a/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceBaysPartialUpdateParams creates a new DcimDeviceBaysPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_device_bays_partial_update_responses.go b/netbox/client/dcim/dcim_device_bays_partial_update_responses.go index cc824fe3c055e2e86819e12c2e0b37fc25344b9f..0264544e1bab060f54ad6b740004f7c8f626d941 100644 --- a/netbox/client/dcim/dcim_device_bays_partial_update_responses.go +++ b/netbox/client/dcim/dcim_device_bays_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBaysPartialUpdateReader is a Reader for the DcimDeviceBaysPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceBaysPartialUpdateOK() *DcimDeviceBaysPartialUpdateOK { DcimDeviceBaysPartialUpdateOK dcim device bays partial update o k */ type DcimDeviceBaysPartialUpdateOK struct { - Payload *models.WritableDeviceBay + Payload *models.DeviceBay } func (o *DcimDeviceBaysPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceBaysPartialUpdateOK) Error() string { func (o *DcimDeviceBaysPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceBay) + o.Payload = new(models.DeviceBay) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_bays_read_parameters.go b/netbox/client/dcim/dcim_device_bays_read_parameters.go index f2812f59159aade0e7f4a075b296ae541dbd8ad4..3bf79496cb491762c44d02317d3a2ae3474af800 100644 --- a/netbox/client/dcim/dcim_device_bays_read_parameters.go +++ b/netbox/client/dcim/dcim_device_bays_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_device_bays_read_responses.go b/netbox/client/dcim/dcim_device_bays_read_responses.go index 31ed1cf5215830367d7bed0cb11251fe49427a56..e73bf4392da646c45f705684c5d5eab7f4ea9fee 100644 --- a/netbox/client/dcim/dcim_device_bays_read_responses.go +++ b/netbox/client/dcim/dcim_device_bays_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBaysReadReader is a Reader for the DcimDeviceBaysRead structure. diff --git a/netbox/client/dcim/dcim_device_bays_update_parameters.go b/netbox/client/dcim/dcim_device_bays_update_parameters.go index 57ddad043ce72c3d49638865d470fea1dc001fe3..5cbe21241db7a268e58201a3194b911238d19e51 100644 --- a/netbox/client/dcim/dcim_device_bays_update_parameters.go +++ b/netbox/client/dcim/dcim_device_bays_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceBaysUpdateParams creates a new DcimDeviceBaysUpdateParams object diff --git a/netbox/client/dcim/dcim_device_bays_update_responses.go b/netbox/client/dcim/dcim_device_bays_update_responses.go index 13b1951e102e2255dac53bd12f05a70b3c6c5cca..aab21704ad1240b2e6b42b4e4efb7faa39fe3895 100644 --- a/netbox/client/dcim/dcim_device_bays_update_responses.go +++ b/netbox/client/dcim/dcim_device_bays_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceBaysUpdateReader is a Reader for the DcimDeviceBaysUpdate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceBaysUpdateOK() *DcimDeviceBaysUpdateOK { DcimDeviceBaysUpdateOK dcim device bays update o k */ type DcimDeviceBaysUpdateOK struct { - Payload *models.WritableDeviceBay + Payload *models.DeviceBay } func (o *DcimDeviceBaysUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceBaysUpdateOK) Error() string { func (o *DcimDeviceBaysUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceBay) + o.Payload = new(models.DeviceBay) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_roles_create_parameters.go b/netbox/client/dcim/dcim_device_roles_create_parameters.go index 2fe6af2445ca2662a53304992209bf54dc653934..9ba8038708721d1c36573cab06172da764aa7ae0 100644 --- a/netbox/client/dcim/dcim_device_roles_create_parameters.go +++ b/netbox/client/dcim/dcim_device_roles_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceRolesCreateParams creates a new DcimDeviceRolesCreateParams object diff --git a/netbox/client/dcim/dcim_device_roles_create_responses.go b/netbox/client/dcim/dcim_device_roles_create_responses.go index 193ac1010c8e288af50b18c230768b6215448c33..f4e8a63d55a40f05a4bbef4dcf0175c491f675fc 100644 --- a/netbox/client/dcim/dcim_device_roles_create_responses.go +++ b/netbox/client/dcim/dcim_device_roles_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceRolesCreateReader is a Reader for the DcimDeviceRolesCreate structure. diff --git a/netbox/client/dcim/dcim_device_roles_delete_parameters.go b/netbox/client/dcim/dcim_device_roles_delete_parameters.go index 689c2da63e38beacf2a32fa74f84e3e6c9ff5bfa..1ad614fc9e4c094b16e5a15754a370095e26d2f6 100644 --- a/netbox/client/dcim/dcim_device_roles_delete_parameters.go +++ b/netbox/client/dcim/dcim_device_roles_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_device_roles_list_parameters.go b/netbox/client/dcim/dcim_device_roles_list_parameters.go index 116a9f2086b1bc48b2a9c0061cd19a371854aed0..26e3253f7439af8aba0457847ebf9cb438739f5c 100644 --- a/netbox/client/dcim/dcim_device_roles_list_parameters.go +++ b/netbox/client/dcim/dcim_device_roles_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -79,6 +78,8 @@ type DcimDeviceRolesListParams struct { /*Color*/ Color *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -91,6 +92,8 @@ type DcimDeviceRolesListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string /*VMRole*/ @@ -145,6 +148,17 @@ func (o *DcimDeviceRolesListParams) SetColor(color *string) { o.Color = color } +// WithID adds the id to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithID(id *string) *DcimDeviceRolesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim device roles list params func (o *DcimDeviceRolesListParams) WithLimit(limit *int64) *DcimDeviceRolesListParams { o.SetLimit(limit) @@ -178,6 +192,17 @@ func (o *DcimDeviceRolesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithQ(q *string) *DcimDeviceRolesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the dcim device roles list params func (o *DcimDeviceRolesListParams) WithSlug(slug *string) *DcimDeviceRolesListParams { o.SetSlug(slug) @@ -224,6 +249,22 @@ func (o *DcimDeviceRolesListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -272,6 +313,22 @@ func (o *DcimDeviceRolesListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/dcim/dcim_device_roles_list_responses.go b/netbox/client/dcim/dcim_device_roles_list_responses.go index d2708a0f062118275164c76894e441dedf821931..4963bfce8c88d3df65f39576b12191e5e17c6b8d 100644 --- a/netbox/client/dcim/dcim_device_roles_list_responses.go +++ b/netbox/client/dcim/dcim_device_roles_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceRolesListReader is a Reader for the DcimDeviceRolesList structure. @@ -61,7 +65,7 @@ func NewDcimDeviceRolesListOK() *DcimDeviceRolesListOK { DcimDeviceRolesListOK dcim device roles list o k */ type DcimDeviceRolesListOK struct { - Payload *models.DcimDeviceRolesListOKBody + Payload *DcimDeviceRolesListOKBody } func (o *DcimDeviceRolesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimDeviceRolesListOK) Error() string { func (o *DcimDeviceRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimDeviceRolesListOKBody) + o.Payload = new(DcimDeviceRolesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimDeviceRolesListOK) readResponse(response runtime.ClientResponse, co return nil } + +/*DcimDeviceRolesListOKBody dcim device roles list o k body +swagger:model DcimDeviceRolesListOKBody +*/ +type DcimDeviceRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.DeviceRole `json:"results"` +} + +// Validate validates this dcim device roles list o k body +func (o *DcimDeviceRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimDeviceRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimDeviceRolesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceRolesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimDeviceRolesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceRolesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimDeviceRolesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimDeviceRolesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimDeviceRolesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimDeviceRolesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimDeviceRolesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go b/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go index 10a3593fd41ddbfaee1c39e3a115471b633ede20..8022fb35473e8c199c5c4274f8bd52549260a0a3 100644 --- a/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceRolesPartialUpdateParams creates a new DcimDeviceRolesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_device_roles_partial_update_responses.go b/netbox/client/dcim/dcim_device_roles_partial_update_responses.go index 87bcf68eeffea4f075514c1d9b7cfbee15cd125e..510c51323ff964984961216ecd8505945a53882c 100644 --- a/netbox/client/dcim/dcim_device_roles_partial_update_responses.go +++ b/netbox/client/dcim/dcim_device_roles_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceRolesPartialUpdateReader is a Reader for the DcimDeviceRolesPartialUpdate structure. diff --git a/netbox/client/dcim/dcim_device_roles_read_parameters.go b/netbox/client/dcim/dcim_device_roles_read_parameters.go index 979b3d6e00f7fd63f815b728686087ab30823db3..fa681ae685de9d2c3ca58e072be0507d0edcf891 100644 --- a/netbox/client/dcim/dcim_device_roles_read_parameters.go +++ b/netbox/client/dcim/dcim_device_roles_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_device_roles_read_responses.go b/netbox/client/dcim/dcim_device_roles_read_responses.go index 93b241f05b2f7787cd175df1474bedce7a8609c2..df452a70cf3f78d2b6209c17481b3ee2d11e7415 100644 --- a/netbox/client/dcim/dcim_device_roles_read_responses.go +++ b/netbox/client/dcim/dcim_device_roles_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceRolesReadReader is a Reader for the DcimDeviceRolesRead structure. diff --git a/netbox/client/dcim/dcim_device_roles_update_parameters.go b/netbox/client/dcim/dcim_device_roles_update_parameters.go index 5f046045ad9bc72d095662ccf8a6ed0d8d1f1e7b..a557582840dcbe4b56225872ca20c4d4f5949dad 100644 --- a/netbox/client/dcim/dcim_device_roles_update_parameters.go +++ b/netbox/client/dcim/dcim_device_roles_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceRolesUpdateParams creates a new DcimDeviceRolesUpdateParams object diff --git a/netbox/client/dcim/dcim_device_roles_update_responses.go b/netbox/client/dcim/dcim_device_roles_update_responses.go index 5b1940f9946676201b3b5eff92746308203a2a84..8fa73513ffdf93e035d0a938f0f59285101d7917 100644 --- a/netbox/client/dcim/dcim_device_roles_update_responses.go +++ b/netbox/client/dcim/dcim_device_roles_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceRolesUpdateReader is a Reader for the DcimDeviceRolesUpdate structure. diff --git a/netbox/client/dcim/dcim_device_types_create_parameters.go b/netbox/client/dcim/dcim_device_types_create_parameters.go index 731ca3f94597d213f6b344b983e3627488e97ef8..736ed6983dec0aaa8d26185fd552f6a1ac2ddb99 100644 --- a/netbox/client/dcim/dcim_device_types_create_parameters.go +++ b/netbox/client/dcim/dcim_device_types_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceTypesCreateParams creates a new DcimDeviceTypesCreateParams object diff --git a/netbox/client/dcim/dcim_device_types_create_responses.go b/netbox/client/dcim/dcim_device_types_create_responses.go index 6d99a6efb5f6b1448b97dffa3e6bc5b56b86da68..8c0fcd8eef2f8e3b2965f8090ac82e55e816baac 100644 --- a/netbox/client/dcim/dcim_device_types_create_responses.go +++ b/netbox/client/dcim/dcim_device_types_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceTypesCreateReader is a Reader for the DcimDeviceTypesCreate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceTypesCreateCreated() *DcimDeviceTypesCreateCreated { DcimDeviceTypesCreateCreated dcim device types create created */ type DcimDeviceTypesCreateCreated struct { - Payload *models.WritableDeviceType + Payload *models.DeviceType } func (o *DcimDeviceTypesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceTypesCreateCreated) Error() string { func (o *DcimDeviceTypesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceType) + o.Payload = new(models.DeviceType) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_types_delete_parameters.go b/netbox/client/dcim/dcim_device_types_delete_parameters.go index 94e1e7ee3b4f1ff042605d88f3bf01137a157e34..289aa61c50efa9e855af1ac1d813c3d4a0df4207 100644 --- a/netbox/client/dcim/dcim_device_types_delete_parameters.go +++ b/netbox/client/dcim/dcim_device_types_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_device_types_list_parameters.go b/netbox/client/dcim/dcim_device_types_list_parameters.go index fe8a8774151f608b9849728d96ee79160d949d49..96a809aeac76f1bb15b41a665cdb800cf26e6ab4 100644 --- a/netbox/client/dcim/dcim_device_types_list_parameters.go +++ b/netbox/client/dcim/dcim_device_types_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,19 +76,19 @@ for the dcim device types list operation typically these are written to a http.R */ type DcimDeviceTypesListParams struct { + /*ConsolePorts*/ + ConsolePorts *string + /*ConsoleServerPorts*/ + ConsoleServerPorts *string /*IDIn Multiple values may be separated by commas. */ IDIn *string - /*IsConsoleServer*/ - IsConsoleServer *string + /*Interfaces*/ + Interfaces *string /*IsFullDepth*/ IsFullDepth *string - /*IsNetworkDevice*/ - IsNetworkDevice *string - /*IsPdu*/ - IsPdu *string /*Limit Number of results to return per page. @@ -108,14 +107,22 @@ type DcimDeviceTypesListParams struct { Offset *int64 /*PartNumber*/ PartNumber *string + /*PassThroughPorts*/ + PassThroughPorts *string + /*PowerOutlets*/ + PowerOutlets *string + /*PowerPorts*/ + PowerPorts *string /*Q*/ Q *string /*Slug*/ Slug *string /*SubdeviceRole*/ SubdeviceRole *string + /*Tag*/ + Tag *string /*UHeight*/ - UHeight *float64 + UHeight *string timeout time.Duration Context context.Context @@ -155,6 +162,28 @@ func (o *DcimDeviceTypesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithConsolePorts adds the consolePorts to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithConsolePorts(consolePorts *string) *DcimDeviceTypesListParams { + o.SetConsolePorts(consolePorts) + return o +} + +// SetConsolePorts adds the consolePorts to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetConsolePorts(consolePorts *string) { + o.ConsolePorts = consolePorts +} + +// WithConsoleServerPorts adds the consoleServerPorts to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithConsoleServerPorts(consoleServerPorts *string) *DcimDeviceTypesListParams { + o.SetConsoleServerPorts(consoleServerPorts) + return o +} + +// SetConsoleServerPorts adds the consoleServerPorts to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetConsoleServerPorts(consoleServerPorts *string) { + o.ConsoleServerPorts = consoleServerPorts +} + // WithIDIn adds the iDIn to the dcim device types list params func (o *DcimDeviceTypesListParams) WithIDIn(iDIn *string) *DcimDeviceTypesListParams { o.SetIDIn(iDIn) @@ -166,15 +195,15 @@ func (o *DcimDeviceTypesListParams) SetIDIn(iDIn *string) { o.IDIn = iDIn } -// WithIsConsoleServer adds the isConsoleServer to the dcim device types list params -func (o *DcimDeviceTypesListParams) WithIsConsoleServer(isConsoleServer *string) *DcimDeviceTypesListParams { - o.SetIsConsoleServer(isConsoleServer) +// WithInterfaces adds the interfaces to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithInterfaces(interfaces *string) *DcimDeviceTypesListParams { + o.SetInterfaces(interfaces) return o } -// SetIsConsoleServer adds the isConsoleServer to the dcim device types list params -func (o *DcimDeviceTypesListParams) SetIsConsoleServer(isConsoleServer *string) { - o.IsConsoleServer = isConsoleServer +// SetInterfaces adds the interfaces to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetInterfaces(interfaces *string) { + o.Interfaces = interfaces } // WithIsFullDepth adds the isFullDepth to the dcim device types list params @@ -188,28 +217,6 @@ func (o *DcimDeviceTypesListParams) SetIsFullDepth(isFullDepth *string) { o.IsFullDepth = isFullDepth } -// WithIsNetworkDevice adds the isNetworkDevice to the dcim device types list params -func (o *DcimDeviceTypesListParams) WithIsNetworkDevice(isNetworkDevice *string) *DcimDeviceTypesListParams { - o.SetIsNetworkDevice(isNetworkDevice) - return o -} - -// SetIsNetworkDevice adds the isNetworkDevice to the dcim device types list params -func (o *DcimDeviceTypesListParams) SetIsNetworkDevice(isNetworkDevice *string) { - o.IsNetworkDevice = isNetworkDevice -} - -// WithIsPdu adds the isPdu to the dcim device types list params -func (o *DcimDeviceTypesListParams) WithIsPdu(isPdu *string) *DcimDeviceTypesListParams { - o.SetIsPdu(isPdu) - return o -} - -// SetIsPdu adds the isPdu to the dcim device types list params -func (o *DcimDeviceTypesListParams) SetIsPdu(isPdu *string) { - o.IsPdu = isPdu -} - // WithLimit adds the limit to the dcim device types list params func (o *DcimDeviceTypesListParams) WithLimit(limit *int64) *DcimDeviceTypesListParams { o.SetLimit(limit) @@ -276,6 +283,39 @@ func (o *DcimDeviceTypesListParams) SetPartNumber(partNumber *string) { o.PartNumber = partNumber } +// WithPassThroughPorts adds the passThroughPorts to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithPassThroughPorts(passThroughPorts *string) *DcimDeviceTypesListParams { + o.SetPassThroughPorts(passThroughPorts) + return o +} + +// SetPassThroughPorts adds the passThroughPorts to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetPassThroughPorts(passThroughPorts *string) { + o.PassThroughPorts = passThroughPorts +} + +// WithPowerOutlets adds the powerOutlets to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithPowerOutlets(powerOutlets *string) *DcimDeviceTypesListParams { + o.SetPowerOutlets(powerOutlets) + return o +} + +// SetPowerOutlets adds the powerOutlets to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetPowerOutlets(powerOutlets *string) { + o.PowerOutlets = powerOutlets +} + +// WithPowerPorts adds the powerPorts to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithPowerPorts(powerPorts *string) *DcimDeviceTypesListParams { + o.SetPowerPorts(powerPorts) + return o +} + +// SetPowerPorts adds the powerPorts to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetPowerPorts(powerPorts *string) { + o.PowerPorts = powerPorts +} + // WithQ adds the q to the dcim device types list params func (o *DcimDeviceTypesListParams) WithQ(q *string) *DcimDeviceTypesListParams { o.SetQ(q) @@ -309,14 +349,25 @@ func (o *DcimDeviceTypesListParams) SetSubdeviceRole(subdeviceRole *string) { o.SubdeviceRole = subdeviceRole } +// WithTag adds the tag to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithTag(tag *string) *DcimDeviceTypesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithUHeight adds the uHeight to the dcim device types list params -func (o *DcimDeviceTypesListParams) WithUHeight(uHeight *float64) *DcimDeviceTypesListParams { +func (o *DcimDeviceTypesListParams) WithUHeight(uHeight *string) *DcimDeviceTypesListParams { o.SetUHeight(uHeight) return o } // SetUHeight adds the uHeight to the dcim device types list params -func (o *DcimDeviceTypesListParams) SetUHeight(uHeight *float64) { +func (o *DcimDeviceTypesListParams) SetUHeight(uHeight *string) { o.UHeight = uHeight } @@ -328,80 +379,80 @@ func (o *DcimDeviceTypesListParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error - if o.IDIn != nil { + if o.ConsolePorts != nil { - // query param id__in - var qrIDIn string - if o.IDIn != nil { - qrIDIn = *o.IDIn + // query param console_ports + var qrConsolePorts string + if o.ConsolePorts != nil { + qrConsolePorts = *o.ConsolePorts } - qIDIn := qrIDIn - if qIDIn != "" { - if err := r.SetQueryParam("id__in", qIDIn); err != nil { + qConsolePorts := qrConsolePorts + if qConsolePorts != "" { + if err := r.SetQueryParam("console_ports", qConsolePorts); err != nil { return err } } } - if o.IsConsoleServer != nil { + if o.ConsoleServerPorts != nil { - // query param is_console_server - var qrIsConsoleServer string - if o.IsConsoleServer != nil { - qrIsConsoleServer = *o.IsConsoleServer + // query param console_server_ports + var qrConsoleServerPorts string + if o.ConsoleServerPorts != nil { + qrConsoleServerPorts = *o.ConsoleServerPorts } - qIsConsoleServer := qrIsConsoleServer - if qIsConsoleServer != "" { - if err := r.SetQueryParam("is_console_server", qIsConsoleServer); err != nil { + qConsoleServerPorts := qrConsoleServerPorts + if qConsoleServerPorts != "" { + if err := r.SetQueryParam("console_server_ports", qConsoleServerPorts); err != nil { return err } } } - if o.IsFullDepth != nil { + if o.IDIn != nil { - // query param is_full_depth - var qrIsFullDepth string - if o.IsFullDepth != nil { - qrIsFullDepth = *o.IsFullDepth + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn } - qIsFullDepth := qrIsFullDepth - if qIsFullDepth != "" { - if err := r.SetQueryParam("is_full_depth", qIsFullDepth); err != nil { + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { return err } } } - if o.IsNetworkDevice != nil { + if o.Interfaces != nil { - // query param is_network_device - var qrIsNetworkDevice string - if o.IsNetworkDevice != nil { - qrIsNetworkDevice = *o.IsNetworkDevice + // query param interfaces + var qrInterfaces string + if o.Interfaces != nil { + qrInterfaces = *o.Interfaces } - qIsNetworkDevice := qrIsNetworkDevice - if qIsNetworkDevice != "" { - if err := r.SetQueryParam("is_network_device", qIsNetworkDevice); err != nil { + qInterfaces := qrInterfaces + if qInterfaces != "" { + if err := r.SetQueryParam("interfaces", qInterfaces); err != nil { return err } } } - if o.IsPdu != nil { + if o.IsFullDepth != nil { - // query param is_pdu - var qrIsPdu string - if o.IsPdu != nil { - qrIsPdu = *o.IsPdu + // query param is_full_depth + var qrIsFullDepth string + if o.IsFullDepth != nil { + qrIsFullDepth = *o.IsFullDepth } - qIsPdu := qrIsPdu - if qIsPdu != "" { - if err := r.SetQueryParam("is_pdu", qIsPdu); err != nil { + qIsFullDepth := qrIsFullDepth + if qIsFullDepth != "" { + if err := r.SetQueryParam("is_full_depth", qIsFullDepth); err != nil { return err } } @@ -504,6 +555,54 @@ func (o *DcimDeviceTypesListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.PassThroughPorts != nil { + + // query param pass_through_ports + var qrPassThroughPorts string + if o.PassThroughPorts != nil { + qrPassThroughPorts = *o.PassThroughPorts + } + qPassThroughPorts := qrPassThroughPorts + if qPassThroughPorts != "" { + if err := r.SetQueryParam("pass_through_ports", qPassThroughPorts); err != nil { + return err + } + } + + } + + if o.PowerOutlets != nil { + + // query param power_outlets + var qrPowerOutlets string + if o.PowerOutlets != nil { + qrPowerOutlets = *o.PowerOutlets + } + qPowerOutlets := qrPowerOutlets + if qPowerOutlets != "" { + if err := r.SetQueryParam("power_outlets", qPowerOutlets); err != nil { + return err + } + } + + } + + if o.PowerPorts != nil { + + // query param power_ports + var qrPowerPorts string + if o.PowerPorts != nil { + qrPowerPorts = *o.PowerPorts + } + qPowerPorts := qrPowerPorts + if qPowerPorts != "" { + if err := r.SetQueryParam("power_ports", qPowerPorts); err != nil { + return err + } + } + + } + if o.Q != nil { // query param q @@ -552,14 +651,30 @@ func (o *DcimDeviceTypesListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.UHeight != nil { // query param u_height - var qrUHeight float64 + var qrUHeight string if o.UHeight != nil { qrUHeight = *o.UHeight } - qUHeight := swag.FormatFloat64(qrUHeight) + qUHeight := qrUHeight if qUHeight != "" { if err := r.SetQueryParam("u_height", qUHeight); err != nil { return err diff --git a/netbox/client/dcim/dcim_device_types_list_responses.go b/netbox/client/dcim/dcim_device_types_list_responses.go index 29254ffe69c10c4c8afbc713c9b973f2a10a6f4a..f53166c39b0c210e6b9d5bedac2878ec73277f67 100644 --- a/netbox/client/dcim/dcim_device_types_list_responses.go +++ b/netbox/client/dcim/dcim_device_types_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceTypesListReader is a Reader for the DcimDeviceTypesList structure. @@ -61,7 +65,7 @@ func NewDcimDeviceTypesListOK() *DcimDeviceTypesListOK { DcimDeviceTypesListOK dcim device types list o k */ type DcimDeviceTypesListOK struct { - Payload *models.DcimDeviceTypesListOKBody + Payload *DcimDeviceTypesListOKBody } func (o *DcimDeviceTypesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimDeviceTypesListOK) Error() string { func (o *DcimDeviceTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimDeviceTypesListOKBody) + o.Payload = new(DcimDeviceTypesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimDeviceTypesListOK) readResponse(response runtime.ClientResponse, co return nil } + +/*DcimDeviceTypesListOKBody dcim device types list o k body +swagger:model DcimDeviceTypesListOKBody +*/ +type DcimDeviceTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.DeviceType `json:"results"` +} + +// Validate validates this dcim device types list o k body +func (o *DcimDeviceTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimDeviceTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimDeviceTypesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceTypesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimDeviceTypesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceTypesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimDeviceTypesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDeviceTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimDeviceTypesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimDeviceTypesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimDeviceTypesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimDeviceTypesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_device_types_partial_update_parameters.go b/netbox/client/dcim/dcim_device_types_partial_update_parameters.go index bec757ce1adb86b891c41fa76716f790be855421..9df67258045024b9ee007532df77ab7cb8725221 100644 --- a/netbox/client/dcim/dcim_device_types_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_device_types_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceTypesPartialUpdateParams creates a new DcimDeviceTypesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_device_types_partial_update_responses.go b/netbox/client/dcim/dcim_device_types_partial_update_responses.go index ac54b2aa1f70fe805b0913d0739ffd40f2752a98..ea348cf23e8dfae673f74fb11f56631543ee8cbd 100644 --- a/netbox/client/dcim/dcim_device_types_partial_update_responses.go +++ b/netbox/client/dcim/dcim_device_types_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceTypesPartialUpdateReader is a Reader for the DcimDeviceTypesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceTypesPartialUpdateOK() *DcimDeviceTypesPartialUpdateOK { DcimDeviceTypesPartialUpdateOK dcim device types partial update o k */ type DcimDeviceTypesPartialUpdateOK struct { - Payload *models.WritableDeviceType + Payload *models.DeviceType } func (o *DcimDeviceTypesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceTypesPartialUpdateOK) Error() string { func (o *DcimDeviceTypesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceType) + o.Payload = new(models.DeviceType) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_device_types_read_parameters.go b/netbox/client/dcim/dcim_device_types_read_parameters.go index e96e83fe067b87aef2ecc0d85df2c5a288eb4777..a4ca6abb10af6176fd27bc6f835418746a558db2 100644 --- a/netbox/client/dcim/dcim_device_types_read_parameters.go +++ b/netbox/client/dcim/dcim_device_types_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_device_types_read_responses.go b/netbox/client/dcim/dcim_device_types_read_responses.go index 0269f0b8d559fbe110dd5386dc503fda650b1747..6747ec81151001d732d1d1af75e55e40d5d720a0 100644 --- a/netbox/client/dcim/dcim_device_types_read_responses.go +++ b/netbox/client/dcim/dcim_device_types_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceTypesReadReader is a Reader for the DcimDeviceTypesRead structure. diff --git a/netbox/client/dcim/dcim_device_types_update_parameters.go b/netbox/client/dcim/dcim_device_types_update_parameters.go index f6d8d647a29e405594e4f3c45ac29a7c52954c3d..c8d250984a7aee94740b705f67d6ad401ea37193 100644 --- a/netbox/client/dcim/dcim_device_types_update_parameters.go +++ b/netbox/client/dcim/dcim_device_types_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDeviceTypesUpdateParams creates a new DcimDeviceTypesUpdateParams object diff --git a/netbox/client/dcim/dcim_device_types_update_responses.go b/netbox/client/dcim/dcim_device_types_update_responses.go index 00df505538825932335fd412eaeac9619c94da95..5de6d7ee0edf3716fb4d6045587b420f527a3c39 100644 --- a/netbox/client/dcim/dcim_device_types_update_responses.go +++ b/netbox/client/dcim/dcim_device_types_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDeviceTypesUpdateReader is a Reader for the DcimDeviceTypesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimDeviceTypesUpdateOK() *DcimDeviceTypesUpdateOK { DcimDeviceTypesUpdateOK dcim device types update o k */ type DcimDeviceTypesUpdateOK struct { - Payload *models.WritableDeviceType + Payload *models.DeviceType } func (o *DcimDeviceTypesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDeviceTypesUpdateOK) Error() string { func (o *DcimDeviceTypesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDeviceType) + o.Payload = new(models.DeviceType) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_devices_create_parameters.go b/netbox/client/dcim/dcim_devices_create_parameters.go index 6385b3bb7e362aa65d511d58633f3afeda57cbf2..230cda865e2d5ebca3070bd3290fef622ecb22c8 100644 --- a/netbox/client/dcim/dcim_devices_create_parameters.go +++ b/netbox/client/dcim/dcim_devices_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDevicesCreateParams creates a new DcimDevicesCreateParams object @@ -79,7 +78,7 @@ for the dcim devices create operation typically these are written to a http.Requ type DcimDevicesCreateParams struct { /*Data*/ - Data *models.WritableDevice + Data *models.WritableDeviceWithConfigContext timeout time.Duration Context context.Context @@ -120,13 +119,13 @@ func (o *DcimDevicesCreateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim devices create params -func (o *DcimDevicesCreateParams) WithData(data *models.WritableDevice) *DcimDevicesCreateParams { +func (o *DcimDevicesCreateParams) WithData(data *models.WritableDeviceWithConfigContext) *DcimDevicesCreateParams { o.SetData(data) return o } // SetData adds the data to the dcim devices create params -func (o *DcimDevicesCreateParams) SetData(data *models.WritableDevice) { +func (o *DcimDevicesCreateParams) SetData(data *models.WritableDeviceWithConfigContext) { o.Data = data } diff --git a/netbox/client/dcim/dcim_devices_create_responses.go b/netbox/client/dcim/dcim_devices_create_responses.go index 5af49381f5eacddbb7d3025a1520c2d8b2b12e08..e42aaabe40e30bfccec5ec8ebc07c14fe3aaccb0 100644 --- a/netbox/client/dcim/dcim_devices_create_responses.go +++ b/netbox/client/dcim/dcim_devices_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDevicesCreateReader is a Reader for the DcimDevicesCreate structure. @@ -61,7 +61,7 @@ func NewDcimDevicesCreateCreated() *DcimDevicesCreateCreated { DcimDevicesCreateCreated dcim devices create created */ type DcimDevicesCreateCreated struct { - Payload *models.WritableDevice + Payload *models.DeviceWithConfigContext } func (o *DcimDevicesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDevicesCreateCreated) Error() string { func (o *DcimDevicesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDevice) + o.Payload = new(models.DeviceWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_devices_delete_parameters.go b/netbox/client/dcim/dcim_devices_delete_parameters.go index 0ad70d782b148dc4fe5bcdf29f4418765e0c186a..1ce94e1fbfb11f80077857d92e23dd1dd5d8df77 100644 --- a/netbox/client/dcim/dcim_devices_delete_parameters.go +++ b/netbox/client/dcim/dcim_devices_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_devices_list_parameters.go b/netbox/client/dcim/dcim_devices_list_parameters.go index 7e18af801957da1a3938cee4bbd845bf076e29fd..6583fd981d35e7ddadd6a9a6b1d19d40d5753a8f 100644 --- a/netbox/client/dcim/dcim_devices_list_parameters.go +++ b/netbox/client/dcim/dcim_devices_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -81,23 +80,27 @@ type DcimDevicesListParams struct { AssetTag *string /*ClusterID*/ ClusterID *string + /*ConsolePorts*/ + ConsolePorts *string + /*ConsoleServerPorts*/ + ConsoleServerPorts *string /*DeviceTypeID*/ DeviceTypeID *string + /*Face*/ + Face *string /*HasPrimaryIP*/ HasPrimaryIP *string + /*ID*/ + ID *string /*IDIn Multiple values may be separated by commas. */ IDIn *string - /*IsConsoleServer*/ - IsConsoleServer *string + /*Interfaces*/ + Interfaces *string /*IsFullDepth*/ IsFullDepth *string - /*IsNetworkDevice*/ - IsNetworkDevice *string - /*IsPdu*/ - IsPdu *string /*Limit Number of results to return per page. @@ -118,18 +121,28 @@ type DcimDevicesListParams struct { */ Offset *int64 + /*PassThroughPorts*/ + PassThroughPorts *string /*Platform*/ Platform *string /*PlatformID*/ PlatformID *string /*Position*/ - Position *float64 + Position *string + /*PowerOutlets*/ + PowerOutlets *string + /*PowerPorts*/ + PowerPorts *string /*Q*/ Q *string /*RackGroupID*/ RackGroupID *string /*RackID*/ RackID *string + /*Region*/ + Region *string + /*RegionID*/ + RegionID *string /*Role*/ Role *string /*RoleID*/ @@ -142,12 +155,24 @@ type DcimDevicesListParams struct { SiteID *string /*Status*/ Status *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string + /*VcPosition*/ + VcPosition *string + /*VcPriority*/ + VcPriority *string /*VirtualChassisID*/ VirtualChassisID *string + /*VirtualChassisMember*/ + VirtualChassisMember *string timeout time.Duration Context context.Context @@ -209,6 +234,28 @@ func (o *DcimDevicesListParams) SetClusterID(clusterID *string) { o.ClusterID = clusterID } +// WithConsolePorts adds the consolePorts to the dcim devices list params +func (o *DcimDevicesListParams) WithConsolePorts(consolePorts *string) *DcimDevicesListParams { + o.SetConsolePorts(consolePorts) + return o +} + +// SetConsolePorts adds the consolePorts to the dcim devices list params +func (o *DcimDevicesListParams) SetConsolePorts(consolePorts *string) { + o.ConsolePorts = consolePorts +} + +// WithConsoleServerPorts adds the consoleServerPorts to the dcim devices list params +func (o *DcimDevicesListParams) WithConsoleServerPorts(consoleServerPorts *string) *DcimDevicesListParams { + o.SetConsoleServerPorts(consoleServerPorts) + return o +} + +// SetConsoleServerPorts adds the consoleServerPorts to the dcim devices list params +func (o *DcimDevicesListParams) SetConsoleServerPorts(consoleServerPorts *string) { + o.ConsoleServerPorts = consoleServerPorts +} + // WithDeviceTypeID adds the deviceTypeID to the dcim devices list params func (o *DcimDevicesListParams) WithDeviceTypeID(deviceTypeID *string) *DcimDevicesListParams { o.SetDeviceTypeID(deviceTypeID) @@ -220,6 +267,17 @@ func (o *DcimDevicesListParams) SetDeviceTypeID(deviceTypeID *string) { o.DeviceTypeID = deviceTypeID } +// WithFace adds the face to the dcim devices list params +func (o *DcimDevicesListParams) WithFace(face *string) *DcimDevicesListParams { + o.SetFace(face) + return o +} + +// SetFace adds the face to the dcim devices list params +func (o *DcimDevicesListParams) SetFace(face *string) { + o.Face = face +} + // WithHasPrimaryIP adds the hasPrimaryIP to the dcim devices list params func (o *DcimDevicesListParams) WithHasPrimaryIP(hasPrimaryIP *string) *DcimDevicesListParams { o.SetHasPrimaryIP(hasPrimaryIP) @@ -231,6 +289,17 @@ func (o *DcimDevicesListParams) SetHasPrimaryIP(hasPrimaryIP *string) { o.HasPrimaryIP = hasPrimaryIP } +// WithID adds the id to the dcim devices list params +func (o *DcimDevicesListParams) WithID(id *string) *DcimDevicesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices list params +func (o *DcimDevicesListParams) SetID(id *string) { + o.ID = id +} + // WithIDIn adds the iDIn to the dcim devices list params func (o *DcimDevicesListParams) WithIDIn(iDIn *string) *DcimDevicesListParams { o.SetIDIn(iDIn) @@ -242,15 +311,15 @@ func (o *DcimDevicesListParams) SetIDIn(iDIn *string) { o.IDIn = iDIn } -// WithIsConsoleServer adds the isConsoleServer to the dcim devices list params -func (o *DcimDevicesListParams) WithIsConsoleServer(isConsoleServer *string) *DcimDevicesListParams { - o.SetIsConsoleServer(isConsoleServer) +// WithInterfaces adds the interfaces to the dcim devices list params +func (o *DcimDevicesListParams) WithInterfaces(interfaces *string) *DcimDevicesListParams { + o.SetInterfaces(interfaces) return o } -// SetIsConsoleServer adds the isConsoleServer to the dcim devices list params -func (o *DcimDevicesListParams) SetIsConsoleServer(isConsoleServer *string) { - o.IsConsoleServer = isConsoleServer +// SetInterfaces adds the interfaces to the dcim devices list params +func (o *DcimDevicesListParams) SetInterfaces(interfaces *string) { + o.Interfaces = interfaces } // WithIsFullDepth adds the isFullDepth to the dcim devices list params @@ -264,28 +333,6 @@ func (o *DcimDevicesListParams) SetIsFullDepth(isFullDepth *string) { o.IsFullDepth = isFullDepth } -// WithIsNetworkDevice adds the isNetworkDevice to the dcim devices list params -func (o *DcimDevicesListParams) WithIsNetworkDevice(isNetworkDevice *string) *DcimDevicesListParams { - o.SetIsNetworkDevice(isNetworkDevice) - return o -} - -// SetIsNetworkDevice adds the isNetworkDevice to the dcim devices list params -func (o *DcimDevicesListParams) SetIsNetworkDevice(isNetworkDevice *string) { - o.IsNetworkDevice = isNetworkDevice -} - -// WithIsPdu adds the isPdu to the dcim devices list params -func (o *DcimDevicesListParams) WithIsPdu(isPdu *string) *DcimDevicesListParams { - o.SetIsPdu(isPdu) - return o -} - -// SetIsPdu adds the isPdu to the dcim devices list params -func (o *DcimDevicesListParams) SetIsPdu(isPdu *string) { - o.IsPdu = isPdu -} - // WithLimit adds the limit to the dcim devices list params func (o *DcimDevicesListParams) WithLimit(limit *int64) *DcimDevicesListParams { o.SetLimit(limit) @@ -363,6 +410,17 @@ func (o *DcimDevicesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithPassThroughPorts adds the passThroughPorts to the dcim devices list params +func (o *DcimDevicesListParams) WithPassThroughPorts(passThroughPorts *string) *DcimDevicesListParams { + o.SetPassThroughPorts(passThroughPorts) + return o +} + +// SetPassThroughPorts adds the passThroughPorts to the dcim devices list params +func (o *DcimDevicesListParams) SetPassThroughPorts(passThroughPorts *string) { + o.PassThroughPorts = passThroughPorts +} + // WithPlatform adds the platform to the dcim devices list params func (o *DcimDevicesListParams) WithPlatform(platform *string) *DcimDevicesListParams { o.SetPlatform(platform) @@ -386,16 +444,38 @@ func (o *DcimDevicesListParams) SetPlatformID(platformID *string) { } // WithPosition adds the position to the dcim devices list params -func (o *DcimDevicesListParams) WithPosition(position *float64) *DcimDevicesListParams { +func (o *DcimDevicesListParams) WithPosition(position *string) *DcimDevicesListParams { o.SetPosition(position) return o } // SetPosition adds the position to the dcim devices list params -func (o *DcimDevicesListParams) SetPosition(position *float64) { +func (o *DcimDevicesListParams) SetPosition(position *string) { o.Position = position } +// WithPowerOutlets adds the powerOutlets to the dcim devices list params +func (o *DcimDevicesListParams) WithPowerOutlets(powerOutlets *string) *DcimDevicesListParams { + o.SetPowerOutlets(powerOutlets) + return o +} + +// SetPowerOutlets adds the powerOutlets to the dcim devices list params +func (o *DcimDevicesListParams) SetPowerOutlets(powerOutlets *string) { + o.PowerOutlets = powerOutlets +} + +// WithPowerPorts adds the powerPorts to the dcim devices list params +func (o *DcimDevicesListParams) WithPowerPorts(powerPorts *string) *DcimDevicesListParams { + o.SetPowerPorts(powerPorts) + return o +} + +// SetPowerPorts adds the powerPorts to the dcim devices list params +func (o *DcimDevicesListParams) SetPowerPorts(powerPorts *string) { + o.PowerPorts = powerPorts +} + // WithQ adds the q to the dcim devices list params func (o *DcimDevicesListParams) WithQ(q *string) *DcimDevicesListParams { o.SetQ(q) @@ -429,6 +509,28 @@ func (o *DcimDevicesListParams) SetRackID(rackID *string) { o.RackID = rackID } +// WithRegion adds the region to the dcim devices list params +func (o *DcimDevicesListParams) WithRegion(region *string) *DcimDevicesListParams { + o.SetRegion(region) + return o +} + +// SetRegion adds the region to the dcim devices list params +func (o *DcimDevicesListParams) SetRegion(region *string) { + o.Region = region +} + +// WithRegionID adds the regionID to the dcim devices list params +func (o *DcimDevicesListParams) WithRegionID(regionID *string) *DcimDevicesListParams { + o.SetRegionID(regionID) + return o +} + +// SetRegionID adds the regionId to the dcim devices list params +func (o *DcimDevicesListParams) SetRegionID(regionID *string) { + o.RegionID = regionID +} + // WithRole adds the role to the dcim devices list params func (o *DcimDevicesListParams) WithRole(role *string) *DcimDevicesListParams { o.SetRole(role) @@ -495,6 +597,17 @@ func (o *DcimDevicesListParams) SetStatus(status *string) { o.Status = status } +// WithTag adds the tag to the dcim devices list params +func (o *DcimDevicesListParams) WithTag(tag *string) *DcimDevicesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim devices list params +func (o *DcimDevicesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the dcim devices list params func (o *DcimDevicesListParams) WithTenant(tenant *string) *DcimDevicesListParams { o.SetTenant(tenant) @@ -506,6 +619,28 @@ func (o *DcimDevicesListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the dcim devices list params +func (o *DcimDevicesListParams) WithTenantGroup(tenantGroup *string) *DcimDevicesListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the dcim devices list params +func (o *DcimDevicesListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the dcim devices list params +func (o *DcimDevicesListParams) WithTenantGroupID(tenantGroupID *string) *DcimDevicesListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the dcim devices list params +func (o *DcimDevicesListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the dcim devices list params func (o *DcimDevicesListParams) WithTenantID(tenantID *string) *DcimDevicesListParams { o.SetTenantID(tenantID) @@ -517,6 +652,28 @@ func (o *DcimDevicesListParams) SetTenantID(tenantID *string) { o.TenantID = tenantID } +// WithVcPosition adds the vcPosition to the dcim devices list params +func (o *DcimDevicesListParams) WithVcPosition(vcPosition *string) *DcimDevicesListParams { + o.SetVcPosition(vcPosition) + return o +} + +// SetVcPosition adds the vcPosition to the dcim devices list params +func (o *DcimDevicesListParams) SetVcPosition(vcPosition *string) { + o.VcPosition = vcPosition +} + +// WithVcPriority adds the vcPriority to the dcim devices list params +func (o *DcimDevicesListParams) WithVcPriority(vcPriority *string) *DcimDevicesListParams { + o.SetVcPriority(vcPriority) + return o +} + +// SetVcPriority adds the vcPriority to the dcim devices list params +func (o *DcimDevicesListParams) SetVcPriority(vcPriority *string) { + o.VcPriority = vcPriority +} + // WithVirtualChassisID adds the virtualChassisID to the dcim devices list params func (o *DcimDevicesListParams) WithVirtualChassisID(virtualChassisID *string) *DcimDevicesListParams { o.SetVirtualChassisID(virtualChassisID) @@ -528,6 +685,17 @@ func (o *DcimDevicesListParams) SetVirtualChassisID(virtualChassisID *string) { o.VirtualChassisID = virtualChassisID } +// WithVirtualChassisMember adds the virtualChassisMember to the dcim devices list params +func (o *DcimDevicesListParams) WithVirtualChassisMember(virtualChassisMember *string) *DcimDevicesListParams { + o.SetVirtualChassisMember(virtualChassisMember) + return o +} + +// SetVirtualChassisMember adds the virtualChassisMember to the dcim devices list params +func (o *DcimDevicesListParams) SetVirtualChassisMember(virtualChassisMember *string) { + o.VirtualChassisMember = virtualChassisMember +} + // WriteToRequest writes these params to a swagger request func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -568,6 +736,38 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.ConsolePorts != nil { + + // query param console_ports + var qrConsolePorts string + if o.ConsolePorts != nil { + qrConsolePorts = *o.ConsolePorts + } + qConsolePorts := qrConsolePorts + if qConsolePorts != "" { + if err := r.SetQueryParam("console_ports", qConsolePorts); err != nil { + return err + } + } + + } + + if o.ConsoleServerPorts != nil { + + // query param console_server_ports + var qrConsoleServerPorts string + if o.ConsoleServerPorts != nil { + qrConsoleServerPorts = *o.ConsoleServerPorts + } + qConsoleServerPorts := qrConsoleServerPorts + if qConsoleServerPorts != "" { + if err := r.SetQueryParam("console_server_ports", qConsoleServerPorts); err != nil { + return err + } + } + + } + if o.DeviceTypeID != nil { // query param device_type_id @@ -584,6 +784,22 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.Face != nil { + + // query param face + var qrFace string + if o.Face != nil { + qrFace = *o.Face + } + qFace := qrFace + if qFace != "" { + if err := r.SetQueryParam("face", qFace); err != nil { + return err + } + } + + } + if o.HasPrimaryIP != nil { // query param has_primary_ip @@ -600,6 +816,22 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.IDIn != nil { // query param id__in @@ -616,16 +848,16 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } - if o.IsConsoleServer != nil { + if o.Interfaces != nil { - // query param is_console_server - var qrIsConsoleServer string - if o.IsConsoleServer != nil { - qrIsConsoleServer = *o.IsConsoleServer + // query param interfaces + var qrInterfaces string + if o.Interfaces != nil { + qrInterfaces = *o.Interfaces } - qIsConsoleServer := qrIsConsoleServer - if qIsConsoleServer != "" { - if err := r.SetQueryParam("is_console_server", qIsConsoleServer); err != nil { + qInterfaces := qrInterfaces + if qInterfaces != "" { + if err := r.SetQueryParam("interfaces", qInterfaces); err != nil { return err } } @@ -648,38 +880,6 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } - if o.IsNetworkDevice != nil { - - // query param is_network_device - var qrIsNetworkDevice string - if o.IsNetworkDevice != nil { - qrIsNetworkDevice = *o.IsNetworkDevice - } - qIsNetworkDevice := qrIsNetworkDevice - if qIsNetworkDevice != "" { - if err := r.SetQueryParam("is_network_device", qIsNetworkDevice); err != nil { - return err - } - } - - } - - if o.IsPdu != nil { - - // query param is_pdu - var qrIsPdu string - if o.IsPdu != nil { - qrIsPdu = *o.IsPdu - } - qIsPdu := qrIsPdu - if qIsPdu != "" { - if err := r.SetQueryParam("is_pdu", qIsPdu); err != nil { - return err - } - } - - } - if o.Limit != nil { // query param limit @@ -792,6 +992,22 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.PassThroughPorts != nil { + + // query param pass_through_ports + var qrPassThroughPorts string + if o.PassThroughPorts != nil { + qrPassThroughPorts = *o.PassThroughPorts + } + qPassThroughPorts := qrPassThroughPorts + if qPassThroughPorts != "" { + if err := r.SetQueryParam("pass_through_ports", qPassThroughPorts); err != nil { + return err + } + } + + } + if o.Platform != nil { // query param platform @@ -827,11 +1043,11 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf if o.Position != nil { // query param position - var qrPosition float64 + var qrPosition string if o.Position != nil { qrPosition = *o.Position } - qPosition := swag.FormatFloat64(qrPosition) + qPosition := qrPosition if qPosition != "" { if err := r.SetQueryParam("position", qPosition); err != nil { return err @@ -840,6 +1056,38 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.PowerOutlets != nil { + + // query param power_outlets + var qrPowerOutlets string + if o.PowerOutlets != nil { + qrPowerOutlets = *o.PowerOutlets + } + qPowerOutlets := qrPowerOutlets + if qPowerOutlets != "" { + if err := r.SetQueryParam("power_outlets", qPowerOutlets); err != nil { + return err + } + } + + } + + if o.PowerPorts != nil { + + // query param power_ports + var qrPowerPorts string + if o.PowerPorts != nil { + qrPowerPorts = *o.PowerPorts + } + qPowerPorts := qrPowerPorts + if qPowerPorts != "" { + if err := r.SetQueryParam("power_ports", qPowerPorts); err != nil { + return err + } + } + + } + if o.Q != nil { // query param q @@ -888,6 +1136,38 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.Region != nil { + + // query param region + var qrRegion string + if o.Region != nil { + qrRegion = *o.Region + } + qRegion := qrRegion + if qRegion != "" { + if err := r.SetQueryParam("region", qRegion); err != nil { + return err + } + } + + } + + if o.RegionID != nil { + + // query param region_id + var qrRegionID string + if o.RegionID != nil { + qrRegionID = *o.RegionID + } + qRegionID := qrRegionID + if qRegionID != "" { + if err := r.SetQueryParam("region_id", qRegionID); err != nil { + return err + } + } + + } + if o.Role != nil { // query param role @@ -984,6 +1264,22 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -1000,6 +1296,38 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id @@ -1016,6 +1344,38 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.VcPosition != nil { + + // query param vc_position + var qrVcPosition string + if o.VcPosition != nil { + qrVcPosition = *o.VcPosition + } + qVcPosition := qrVcPosition + if qVcPosition != "" { + if err := r.SetQueryParam("vc_position", qVcPosition); err != nil { + return err + } + } + + } + + if o.VcPriority != nil { + + // query param vc_priority + var qrVcPriority string + if o.VcPriority != nil { + qrVcPriority = *o.VcPriority + } + qVcPriority := qrVcPriority + if qVcPriority != "" { + if err := r.SetQueryParam("vc_priority", qVcPriority); err != nil { + return err + } + } + + } + if o.VirtualChassisID != nil { // query param virtual_chassis_id @@ -1032,6 +1392,22 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.VirtualChassisMember != nil { + + // query param virtual_chassis_member + var qrVirtualChassisMember string + if o.VirtualChassisMember != nil { + qrVirtualChassisMember = *o.VirtualChassisMember + } + qVirtualChassisMember := qrVirtualChassisMember + if qVirtualChassisMember != "" { + if err := r.SetQueryParam("virtual_chassis_member", qVirtualChassisMember); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_devices_list_responses.go b/netbox/client/dcim/dcim_devices_list_responses.go index 8c2d569bb486549d0a3e39732dfd294c5f8cd3ad..6e7664c9b0e90e148a31b567fb734cd42d7b1417 100644 --- a/netbox/client/dcim/dcim_devices_list_responses.go +++ b/netbox/client/dcim/dcim_devices_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDevicesListReader is a Reader for the DcimDevicesList structure. @@ -61,7 +65,7 @@ func NewDcimDevicesListOK() *DcimDevicesListOK { DcimDevicesListOK dcim devices list o k */ type DcimDevicesListOK struct { - Payload *models.DcimDevicesListOKBody + Payload *DcimDevicesListOKBody } func (o *DcimDevicesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimDevicesListOK) Error() string { func (o *DcimDevicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimDevicesListOKBody) + o.Payload = new(DcimDevicesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimDevicesListOK) readResponse(response runtime.ClientResponse, consum return nil } + +/*DcimDevicesListOKBody dcim devices list o k body +swagger:model DcimDevicesListOKBody +*/ +type DcimDevicesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.DeviceWithConfigContext `json:"results"` +} + +// Validate validates this dcim devices list o k body +func (o *DcimDevicesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimDevicesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimDevicesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimDevicesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimDevicesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDevicesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimDevicesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimDevicesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimDevicesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimDevicesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimDevicesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimDevicesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDevicesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_devices_napalm_parameters.go b/netbox/client/dcim/dcim_devices_napalm_parameters.go index c23967a263df57a407a1909ec7c8cf1ca2c08db7..54a0e4a4a0e1d9cfd58d07872ba55c1ce4aa43a3 100644 --- a/netbox/client/dcim/dcim_devices_napalm_parameters.go +++ b/netbox/client/dcim/dcim_devices_napalm_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_devices_napalm_responses.go b/netbox/client/dcim/dcim_devices_napalm_responses.go index 60a60dc19efe6da108babae3119761d030c324da..ff90746c1647948eb7e6e5d1910b69334cd38669 100644 --- a/netbox/client/dcim/dcim_devices_napalm_responses.go +++ b/netbox/client/dcim/dcim_devices_napalm_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDevicesNapalmReader is a Reader for the DcimDevicesNapalm structure. @@ -61,7 +61,7 @@ func NewDcimDevicesNapalmOK() *DcimDevicesNapalmOK { DcimDevicesNapalmOK dcim devices napalm o k */ type DcimDevicesNapalmOK struct { - Payload *models.Device + Payload *models.DeviceWithConfigContext } func (o *DcimDevicesNapalmOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDevicesNapalmOK) Error() string { func (o *DcimDevicesNapalmOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Device) + o.Payload = new(models.DeviceWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_devices_partial_update_parameters.go b/netbox/client/dcim/dcim_devices_partial_update_parameters.go index 4a3bc2c27b556cf50d405ffad99436079a0dcd62..995f669ede18c5f941e6d9dc749dca84e2b5a52a 100644 --- a/netbox/client/dcim/dcim_devices_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_devices_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDevicesPartialUpdateParams creates a new DcimDevicesPartialUpdateParams object @@ -80,7 +79,7 @@ for the dcim devices partial update operation typically these are written to a h type DcimDevicesPartialUpdateParams struct { /*Data*/ - Data *models.WritableDevice + Data *models.WritableDeviceWithConfigContext /*ID A unique integer value identifying this device. @@ -126,13 +125,13 @@ func (o *DcimDevicesPartialUpdateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim devices partial update params -func (o *DcimDevicesPartialUpdateParams) WithData(data *models.WritableDevice) *DcimDevicesPartialUpdateParams { +func (o *DcimDevicesPartialUpdateParams) WithData(data *models.WritableDeviceWithConfigContext) *DcimDevicesPartialUpdateParams { o.SetData(data) return o } // SetData adds the data to the dcim devices partial update params -func (o *DcimDevicesPartialUpdateParams) SetData(data *models.WritableDevice) { +func (o *DcimDevicesPartialUpdateParams) SetData(data *models.WritableDeviceWithConfigContext) { o.Data = data } diff --git a/netbox/client/dcim/dcim_devices_partial_update_responses.go b/netbox/client/dcim/dcim_devices_partial_update_responses.go index 2193368919a09e12a76f40aac1ae6cc1dc7001ef..872e782dfff00f1ca3578d6966e877f020432120 100644 --- a/netbox/client/dcim/dcim_devices_partial_update_responses.go +++ b/netbox/client/dcim/dcim_devices_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDevicesPartialUpdateReader is a Reader for the DcimDevicesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimDevicesPartialUpdateOK() *DcimDevicesPartialUpdateOK { DcimDevicesPartialUpdateOK dcim devices partial update o k */ type DcimDevicesPartialUpdateOK struct { - Payload *models.WritableDevice + Payload *models.DeviceWithConfigContext } func (o *DcimDevicesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDevicesPartialUpdateOK) Error() string { func (o *DcimDevicesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDevice) + o.Payload = new(models.DeviceWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_devices_read_parameters.go b/netbox/client/dcim/dcim_devices_read_parameters.go index a72431ec23808ec68d9f6a47a5185ce88e8c45cf..0bb86739d7c8dac1efaf49d83e052839d408590a 100644 --- a/netbox/client/dcim/dcim_devices_read_parameters.go +++ b/netbox/client/dcim/dcim_devices_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_devices_read_responses.go b/netbox/client/dcim/dcim_devices_read_responses.go index 25f29c0b742cf4770ba1e7e38321d239c9dd8c83..6ab8e71364e37c17759f8ceef6752130a7235a7d 100644 --- a/netbox/client/dcim/dcim_devices_read_responses.go +++ b/netbox/client/dcim/dcim_devices_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDevicesReadReader is a Reader for the DcimDevicesRead structure. @@ -61,7 +61,7 @@ func NewDcimDevicesReadOK() *DcimDevicesReadOK { DcimDevicesReadOK dcim devices read o k */ type DcimDevicesReadOK struct { - Payload *models.Device + Payload *models.DeviceWithConfigContext } func (o *DcimDevicesReadOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDevicesReadOK) Error() string { func (o *DcimDevicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Device) + o.Payload = new(models.DeviceWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_devices_update_parameters.go b/netbox/client/dcim/dcim_devices_update_parameters.go index f2a84ad5fb729431ae3b261d1352074632771bec..ecd787dc67226e065c19821b2ecb6b70aed28017 100644 --- a/netbox/client/dcim/dcim_devices_update_parameters.go +++ b/netbox/client/dcim/dcim_devices_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimDevicesUpdateParams creates a new DcimDevicesUpdateParams object @@ -80,7 +79,7 @@ for the dcim devices update operation typically these are written to a http.Requ type DcimDevicesUpdateParams struct { /*Data*/ - Data *models.WritableDevice + Data *models.WritableDeviceWithConfigContext /*ID A unique integer value identifying this device. @@ -126,13 +125,13 @@ func (o *DcimDevicesUpdateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim devices update params -func (o *DcimDevicesUpdateParams) WithData(data *models.WritableDevice) *DcimDevicesUpdateParams { +func (o *DcimDevicesUpdateParams) WithData(data *models.WritableDeviceWithConfigContext) *DcimDevicesUpdateParams { o.SetData(data) return o } // SetData adds the data to the dcim devices update params -func (o *DcimDevicesUpdateParams) SetData(data *models.WritableDevice) { +func (o *DcimDevicesUpdateParams) SetData(data *models.WritableDeviceWithConfigContext) { o.Data = data } diff --git a/netbox/client/dcim/dcim_devices_update_responses.go b/netbox/client/dcim/dcim_devices_update_responses.go index 4fae46c5c8832417fc81cfafc66d6f04b4db4a5d..14b068d885930cc2ba76a03801b9f50e190a36ef 100644 --- a/netbox/client/dcim/dcim_devices_update_responses.go +++ b/netbox/client/dcim/dcim_devices_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimDevicesUpdateReader is a Reader for the DcimDevicesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimDevicesUpdateOK() *DcimDevicesUpdateOK { DcimDevicesUpdateOK dcim devices update o k */ type DcimDevicesUpdateOK struct { - Payload *models.WritableDevice + Payload *models.DeviceWithConfigContext } func (o *DcimDevicesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimDevicesUpdateOK) Error() string { func (o *DcimDevicesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableDevice) + o.Payload = new(models.DeviceWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_front_port_templates_create_parameters.go b/netbox/client/dcim/dcim_front_port_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..74cf58d60c0f9b2d663d19b2dd9e4fdfc7ebc40e --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimFrontPortTemplatesCreateParams creates a new DcimFrontPortTemplatesCreateParams object +// with the default values initialized. +func NewDcimFrontPortTemplatesCreateParams() *DcimFrontPortTemplatesCreateParams { + var () + return &DcimFrontPortTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortTemplatesCreateParamsWithTimeout creates a new DcimFrontPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimFrontPortTemplatesCreateParams { + var () + return &DcimFrontPortTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortTemplatesCreateParamsWithContext creates a new DcimFrontPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortTemplatesCreateParamsWithContext(ctx context.Context) *DcimFrontPortTemplatesCreateParams { + var () + return &DcimFrontPortTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortTemplatesCreateParamsWithHTTPClient creates a new DcimFrontPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimFrontPortTemplatesCreateParams { + var () + return &DcimFrontPortTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim front port templates create operation typically these are written to a http.Request +*/ +type DcimFrontPortTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableFrontPortTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front port templates create params +func (o *DcimFrontPortTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimFrontPortTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front port templates create params +func (o *DcimFrontPortTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front port templates create params +func (o *DcimFrontPortTemplatesCreateParams) WithContext(ctx context.Context) *DcimFrontPortTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front port templates create params +func (o *DcimFrontPortTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front port templates create params +func (o *DcimFrontPortTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimFrontPortTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front port templates create params +func (o *DcimFrontPortTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim front port templates create params +func (o *DcimFrontPortTemplatesCreateParams) WithData(data *models.WritableFrontPortTemplate) *DcimFrontPortTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim front port templates create params +func (o *DcimFrontPortTemplatesCreateParams) SetData(data *models.WritableFrontPortTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortTemplatesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_port_templates_create_responses.go b/netbox/client/dcim/dcim_front_port_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a6c082d6ac55954364aca443ea02717b43b78462 --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortTemplatesCreateReader is a Reader for the DcimFrontPortTemplatesCreate structure. +type DcimFrontPortTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimFrontPortTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortTemplatesCreateCreated creates a DcimFrontPortTemplatesCreateCreated with default headers values +func NewDcimFrontPortTemplatesCreateCreated() *DcimFrontPortTemplatesCreateCreated { + return &DcimFrontPortTemplatesCreateCreated{} +} + +/*DcimFrontPortTemplatesCreateCreated handles this case with default header values. + +DcimFrontPortTemplatesCreateCreated dcim front port templates create created +*/ +type DcimFrontPortTemplatesCreateCreated struct { + Payload *models.FrontPortTemplate +} + +func (o *DcimFrontPortTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/front-port-templates/][%d] dcimFrontPortTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimFrontPortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FrontPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_front_port_templates_delete_parameters.go b/netbox/client/dcim/dcim_front_port_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ee0c929a8ddc12aa34ec2f6ce3992a1e0d1d6fb7 --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimFrontPortTemplatesDeleteParams creates a new DcimFrontPortTemplatesDeleteParams object +// with the default values initialized. +func NewDcimFrontPortTemplatesDeleteParams() *DcimFrontPortTemplatesDeleteParams { + var () + return &DcimFrontPortTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortTemplatesDeleteParamsWithTimeout creates a new DcimFrontPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimFrontPortTemplatesDeleteParams { + var () + return &DcimFrontPortTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortTemplatesDeleteParamsWithContext creates a new DcimFrontPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortTemplatesDeleteParamsWithContext(ctx context.Context) *DcimFrontPortTemplatesDeleteParams { + var () + return &DcimFrontPortTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortTemplatesDeleteParamsWithHTTPClient creates a new DcimFrontPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimFrontPortTemplatesDeleteParams { + var () + return &DcimFrontPortTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim front port templates delete operation typically these are written to a http.Request +*/ +type DcimFrontPortTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this front port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front port templates delete params +func (o *DcimFrontPortTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimFrontPortTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front port templates delete params +func (o *DcimFrontPortTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front port templates delete params +func (o *DcimFrontPortTemplatesDeleteParams) WithContext(ctx context.Context) *DcimFrontPortTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front port templates delete params +func (o *DcimFrontPortTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front port templates delete params +func (o *DcimFrontPortTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimFrontPortTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front port templates delete params +func (o *DcimFrontPortTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim front port templates delete params +func (o *DcimFrontPortTemplatesDeleteParams) WithID(id int64) *DcimFrontPortTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front port templates delete params +func (o *DcimFrontPortTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortTemplatesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_delete_responses.go b/netbox/client/dcim/dcim_front_port_templates_delete_responses.go similarity index 51% rename from netbox/client/dcim/dcim_interface_connections_delete_responses.go rename to netbox/client/dcim/dcim_front_port_templates_delete_responses.go index 061d9541bfb6695a8a3b989306b316bd778e6c4a..306b3da4a2a2dec946f7b693e9401cdacc49a0e4 100644 --- a/netbox/client/dcim/dcim_interface_connections_delete_responses.go +++ b/netbox/client/dcim/dcim_front_port_templates_delete_responses.go @@ -27,17 +27,17 @@ import ( strfmt "github.com/go-openapi/strfmt" ) -// DcimInterfaceConnectionsDeleteReader is a Reader for the DcimInterfaceConnectionsDelete structure. -type DcimInterfaceConnectionsDeleteReader struct { +// DcimFrontPortTemplatesDeleteReader is a Reader for the DcimFrontPortTemplatesDelete structure. +type DcimFrontPortTemplatesDeleteReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *DcimInterfaceConnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimFrontPortTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 204: - result := NewDcimInterfaceConnectionsDeleteNoContent() + result := NewDcimFrontPortTemplatesDeleteNoContent() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -48,23 +48,23 @@ func (o *DcimInterfaceConnectionsDeleteReader) ReadResponse(response runtime.Cli } } -// NewDcimInterfaceConnectionsDeleteNoContent creates a DcimInterfaceConnectionsDeleteNoContent with default headers values -func NewDcimInterfaceConnectionsDeleteNoContent() *DcimInterfaceConnectionsDeleteNoContent { - return &DcimInterfaceConnectionsDeleteNoContent{} +// NewDcimFrontPortTemplatesDeleteNoContent creates a DcimFrontPortTemplatesDeleteNoContent with default headers values +func NewDcimFrontPortTemplatesDeleteNoContent() *DcimFrontPortTemplatesDeleteNoContent { + return &DcimFrontPortTemplatesDeleteNoContent{} } -/*DcimInterfaceConnectionsDeleteNoContent handles this case with default header values. +/*DcimFrontPortTemplatesDeleteNoContent handles this case with default header values. -DcimInterfaceConnectionsDeleteNoContent dcim interface connections delete no content +DcimFrontPortTemplatesDeleteNoContent dcim front port templates delete no content */ -type DcimInterfaceConnectionsDeleteNoContent struct { +type DcimFrontPortTemplatesDeleteNoContent struct { } -func (o *DcimInterfaceConnectionsDeleteNoContent) Error() string { - return fmt.Sprintf("[DELETE /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsDeleteNoContent ", 204) +func (o *DcimFrontPortTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/front-port-templates/{id}/][%d] dcimFrontPortTemplatesDeleteNoContent ", 204) } -func (o *DcimInterfaceConnectionsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimFrontPortTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } diff --git a/netbox/client/dcim/dcim_front_port_templates_list_parameters.go b/netbox/client/dcim/dcim_front_port_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a8f775089eb22a0691e4363fb7f05e31e35ba60e --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_list_parameters.go @@ -0,0 +1,339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimFrontPortTemplatesListParams creates a new DcimFrontPortTemplatesListParams object +// with the default values initialized. +func NewDcimFrontPortTemplatesListParams() *DcimFrontPortTemplatesListParams { + var () + return &DcimFrontPortTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortTemplatesListParamsWithTimeout creates a new DcimFrontPortTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortTemplatesListParamsWithTimeout(timeout time.Duration) *DcimFrontPortTemplatesListParams { + var () + return &DcimFrontPortTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortTemplatesListParamsWithContext creates a new DcimFrontPortTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortTemplatesListParamsWithContext(ctx context.Context) *DcimFrontPortTemplatesListParams { + var () + return &DcimFrontPortTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortTemplatesListParamsWithHTTPClient creates a new DcimFrontPortTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortTemplatesListParamsWithHTTPClient(client *http.Client) *DcimFrontPortTemplatesListParams { + var () + return &DcimFrontPortTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim front port templates list operation typically these are written to a http.Request +*/ +type DcimFrontPortTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*ID*/ + ID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithTimeout(timeout time.Duration) *DcimFrontPortTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithContext(ctx context.Context) *DcimFrontPortTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithHTTPClient(client *http.Client) *DcimFrontPortTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimFrontPortTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithID adds the id to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithID(id *string) *DcimFrontPortTemplatesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithLimit(limit *int64) *DcimFrontPortTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithName(name *string) *DcimFrontPortTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithOffset(offset *int64) *DcimFrontPortTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithQ(q *string) *DcimFrontPortTemplatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetQ(q *string) { + o.Q = q +} + +// WithType adds the typeVar to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) WithType(typeVar *string) *DcimFrontPortTemplatesListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim front port templates list params +func (o *DcimFrontPortTemplatesListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_port_templates_list_responses.go b/netbox/client/dcim/dcim_front_port_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4002d3d0246e61d402c3d5edd0e5d9e8853d8906 --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortTemplatesListReader is a Reader for the DcimFrontPortTemplatesList structure. +type DcimFrontPortTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimFrontPortTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortTemplatesListOK creates a DcimFrontPortTemplatesListOK with default headers values +func NewDcimFrontPortTemplatesListOK() *DcimFrontPortTemplatesListOK { + return &DcimFrontPortTemplatesListOK{} +} + +/*DcimFrontPortTemplatesListOK handles this case with default header values. + +DcimFrontPortTemplatesListOK dcim front port templates list o k +*/ +type DcimFrontPortTemplatesListOK struct { + Payload *DcimFrontPortTemplatesListOKBody +} + +func (o *DcimFrontPortTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/front-port-templates/][%d] dcimFrontPortTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimFrontPortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(DcimFrontPortTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*DcimFrontPortTemplatesListOKBody dcim front port templates list o k body +swagger:model DcimFrontPortTemplatesListOKBody +*/ +type DcimFrontPortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.FrontPortTemplate `json:"results"` +} + +// Validate validates this dcim front port templates list o k body +func (o *DcimFrontPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimFrontPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimFrontPortTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimFrontPortTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimFrontPortTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimFrontPortTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimFrontPortTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimFrontPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimFrontPortTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimFrontPortTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimFrontPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimFrontPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimFrontPortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_front_port_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_front_port_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dc2a4529905d34bb7692ffbfc6fc3c10856af025 --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimFrontPortTemplatesPartialUpdateParams creates a new DcimFrontPortTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimFrontPortTemplatesPartialUpdateParams() *DcimFrontPortTemplatesPartialUpdateParams { + var () + return &DcimFrontPortTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortTemplatesPartialUpdateParamsWithTimeout creates a new DcimFrontPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimFrontPortTemplatesPartialUpdateParams { + var () + return &DcimFrontPortTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortTemplatesPartialUpdateParamsWithContext creates a new DcimFrontPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimFrontPortTemplatesPartialUpdateParams { + var () + return &DcimFrontPortTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimFrontPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimFrontPortTemplatesPartialUpdateParams { + var () + return &DcimFrontPortTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim front port templates partial update operation typically these are written to a http.Request +*/ +type DcimFrontPortTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableFrontPortTemplate + /*ID + A unique integer value identifying this front port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimFrontPortTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimFrontPortTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimFrontPortTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) WithData(data *models.WritableFrontPortTemplate) *DcimFrontPortTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) SetData(data *models.WritableFrontPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) WithID(id int64) *DcimFrontPortTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front port templates partial update params +func (o *DcimFrontPortTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortTemplatesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_create_responses.go b/netbox/client/dcim/dcim_front_port_templates_partial_update_responses.go similarity index 54% rename from netbox/client/dcim/dcim_interface_connections_create_responses.go rename to netbox/client/dcim/dcim_front_port_templates_partial_update_responses.go index ca5040ec1e215558a69cb086cc7c59c8042eb95c..a9d4cce8797e9a08083c84e9d21ebe69eb1f3df9 100644 --- a/netbox/client/dcim/dcim_interface_connections_create_responses.go +++ b/netbox/client/dcim/dcim_front_port_templates_partial_update_responses.go @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// DcimInterfaceConnectionsCreateReader is a Reader for the DcimInterfaceConnectionsCreate structure. -type DcimInterfaceConnectionsCreateReader struct { +// DcimFrontPortTemplatesPartialUpdateReader is a Reader for the DcimFrontPortTemplatesPartialUpdate structure. +type DcimFrontPortTemplatesPartialUpdateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *DcimInterfaceConnectionsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimFrontPortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 201: - result := NewDcimInterfaceConnectionsCreateCreated() + case 200: + result := NewDcimFrontPortTemplatesPartialUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *DcimInterfaceConnectionsCreateReader) ReadResponse(response runtime.Cli } } -// NewDcimInterfaceConnectionsCreateCreated creates a DcimInterfaceConnectionsCreateCreated with default headers values -func NewDcimInterfaceConnectionsCreateCreated() *DcimInterfaceConnectionsCreateCreated { - return &DcimInterfaceConnectionsCreateCreated{} +// NewDcimFrontPortTemplatesPartialUpdateOK creates a DcimFrontPortTemplatesPartialUpdateOK with default headers values +func NewDcimFrontPortTemplatesPartialUpdateOK() *DcimFrontPortTemplatesPartialUpdateOK { + return &DcimFrontPortTemplatesPartialUpdateOK{} } -/*DcimInterfaceConnectionsCreateCreated handles this case with default header values. +/*DcimFrontPortTemplatesPartialUpdateOK handles this case with default header values. -DcimInterfaceConnectionsCreateCreated dcim interface connections create created +DcimFrontPortTemplatesPartialUpdateOK dcim front port templates partial update o k */ -type DcimInterfaceConnectionsCreateCreated struct { - Payload *models.WritableInterfaceConnection +type DcimFrontPortTemplatesPartialUpdateOK struct { + Payload *models.FrontPortTemplate } -func (o *DcimInterfaceConnectionsCreateCreated) Error() string { - return fmt.Sprintf("[POST /dcim/interface-connections/][%d] dcimInterfaceConnectionsCreateCreated %+v", 201, o.Payload) +func (o *DcimFrontPortTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/front-port-templates/{id}/][%d] dcimFrontPortTemplatesPartialUpdateOK %+v", 200, o.Payload) } -func (o *DcimInterfaceConnectionsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimFrontPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterfaceConnection) + o.Payload = new(models.FrontPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_front_port_templates_read_parameters.go b/netbox/client/dcim/dcim_front_port_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..eb0437a68a53ce4b563e9d804333048802689bd9 --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimFrontPortTemplatesReadParams creates a new DcimFrontPortTemplatesReadParams object +// with the default values initialized. +func NewDcimFrontPortTemplatesReadParams() *DcimFrontPortTemplatesReadParams { + var () + return &DcimFrontPortTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortTemplatesReadParamsWithTimeout creates a new DcimFrontPortTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimFrontPortTemplatesReadParams { + var () + return &DcimFrontPortTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortTemplatesReadParamsWithContext creates a new DcimFrontPortTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortTemplatesReadParamsWithContext(ctx context.Context) *DcimFrontPortTemplatesReadParams { + var () + return &DcimFrontPortTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortTemplatesReadParamsWithHTTPClient creates a new DcimFrontPortTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimFrontPortTemplatesReadParams { + var () + return &DcimFrontPortTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim front port templates read operation typically these are written to a http.Request +*/ +type DcimFrontPortTemplatesReadParams struct { + + /*ID + A unique integer value identifying this front port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front port templates read params +func (o *DcimFrontPortTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimFrontPortTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front port templates read params +func (o *DcimFrontPortTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front port templates read params +func (o *DcimFrontPortTemplatesReadParams) WithContext(ctx context.Context) *DcimFrontPortTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front port templates read params +func (o *DcimFrontPortTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front port templates read params +func (o *DcimFrontPortTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimFrontPortTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front port templates read params +func (o *DcimFrontPortTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim front port templates read params +func (o *DcimFrontPortTemplatesReadParams) WithID(id int64) *DcimFrontPortTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front port templates read params +func (o *DcimFrontPortTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortTemplatesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_port_templates_read_responses.go b/netbox/client/dcim/dcim_front_port_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..11a8db5e7ab0a932f4f8e4cf021a3cbd413b47a2 --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortTemplatesReadReader is a Reader for the DcimFrontPortTemplatesRead structure. +type DcimFrontPortTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimFrontPortTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortTemplatesReadOK creates a DcimFrontPortTemplatesReadOK with default headers values +func NewDcimFrontPortTemplatesReadOK() *DcimFrontPortTemplatesReadOK { + return &DcimFrontPortTemplatesReadOK{} +} + +/*DcimFrontPortTemplatesReadOK handles this case with default header values. + +DcimFrontPortTemplatesReadOK dcim front port templates read o k +*/ +type DcimFrontPortTemplatesReadOK struct { + Payload *models.FrontPortTemplate +} + +func (o *DcimFrontPortTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/front-port-templates/{id}/][%d] dcimFrontPortTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimFrontPortTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FrontPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_front_port_templates_update_parameters.go b/netbox/client/dcim/dcim_front_port_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..cf9914fe7ae9997e9d7c3feb7d63197139159469 --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimFrontPortTemplatesUpdateParams creates a new DcimFrontPortTemplatesUpdateParams object +// with the default values initialized. +func NewDcimFrontPortTemplatesUpdateParams() *DcimFrontPortTemplatesUpdateParams { + var () + return &DcimFrontPortTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortTemplatesUpdateParamsWithTimeout creates a new DcimFrontPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimFrontPortTemplatesUpdateParams { + var () + return &DcimFrontPortTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortTemplatesUpdateParamsWithContext creates a new DcimFrontPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortTemplatesUpdateParamsWithContext(ctx context.Context) *DcimFrontPortTemplatesUpdateParams { + var () + return &DcimFrontPortTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortTemplatesUpdateParamsWithHTTPClient creates a new DcimFrontPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimFrontPortTemplatesUpdateParams { + var () + return &DcimFrontPortTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim front port templates update operation typically these are written to a http.Request +*/ +type DcimFrontPortTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableFrontPortTemplate + /*ID + A unique integer value identifying this front port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimFrontPortTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) WithContext(ctx context.Context) *DcimFrontPortTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimFrontPortTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) WithData(data *models.WritableFrontPortTemplate) *DcimFrontPortTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) SetData(data *models.WritableFrontPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) WithID(id int64) *DcimFrontPortTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front port templates update params +func (o *DcimFrontPortTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortTemplatesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_port_templates_update_responses.go b/netbox/client/dcim/dcim_front_port_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..95ac13b10159f9880583282a0cee435396d5e4a6 --- /dev/null +++ b/netbox/client/dcim/dcim_front_port_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortTemplatesUpdateReader is a Reader for the DcimFrontPortTemplatesUpdate structure. +type DcimFrontPortTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimFrontPortTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortTemplatesUpdateOK creates a DcimFrontPortTemplatesUpdateOK with default headers values +func NewDcimFrontPortTemplatesUpdateOK() *DcimFrontPortTemplatesUpdateOK { + return &DcimFrontPortTemplatesUpdateOK{} +} + +/*DcimFrontPortTemplatesUpdateOK handles this case with default header values. + +DcimFrontPortTemplatesUpdateOK dcim front port templates update o k +*/ +type DcimFrontPortTemplatesUpdateOK struct { + Payload *models.FrontPortTemplate +} + +func (o *DcimFrontPortTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/front-port-templates/{id}/][%d] dcimFrontPortTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimFrontPortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FrontPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_create_parameters.go b/netbox/client/dcim/dcim_front_ports_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4232d3611c0d5c3caeb9a762e3a1d524c45c307c --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimFrontPortsCreateParams creates a new DcimFrontPortsCreateParams object +// with the default values initialized. +func NewDcimFrontPortsCreateParams() *DcimFrontPortsCreateParams { + var () + return &DcimFrontPortsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortsCreateParamsWithTimeout creates a new DcimFrontPortsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortsCreateParamsWithTimeout(timeout time.Duration) *DcimFrontPortsCreateParams { + var () + return &DcimFrontPortsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortsCreateParamsWithContext creates a new DcimFrontPortsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortsCreateParamsWithContext(ctx context.Context) *DcimFrontPortsCreateParams { + var () + return &DcimFrontPortsCreateParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortsCreateParamsWithHTTPClient creates a new DcimFrontPortsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortsCreateParamsWithHTTPClient(client *http.Client) *DcimFrontPortsCreateParams { + var () + return &DcimFrontPortsCreateParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortsCreateParams contains all the parameters to send to the API endpoint +for the dcim front ports create operation typically these are written to a http.Request +*/ +type DcimFrontPortsCreateParams struct { + + /*Data*/ + Data *models.WritableFrontPort + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front ports create params +func (o *DcimFrontPortsCreateParams) WithTimeout(timeout time.Duration) *DcimFrontPortsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front ports create params +func (o *DcimFrontPortsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front ports create params +func (o *DcimFrontPortsCreateParams) WithContext(ctx context.Context) *DcimFrontPortsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front ports create params +func (o *DcimFrontPortsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front ports create params +func (o *DcimFrontPortsCreateParams) WithHTTPClient(client *http.Client) *DcimFrontPortsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front ports create params +func (o *DcimFrontPortsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim front ports create params +func (o *DcimFrontPortsCreateParams) WithData(data *models.WritableFrontPort) *DcimFrontPortsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim front ports create params +func (o *DcimFrontPortsCreateParams) SetData(data *models.WritableFrontPort) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_create_responses.go b/netbox/client/dcim/dcim_front_ports_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e6b3b4e90d9d98858d393cb26bb248d2310ca990 --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortsCreateReader is a Reader for the DcimFrontPortsCreate structure. +type DcimFrontPortsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimFrontPortsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortsCreateCreated creates a DcimFrontPortsCreateCreated with default headers values +func NewDcimFrontPortsCreateCreated() *DcimFrontPortsCreateCreated { + return &DcimFrontPortsCreateCreated{} +} + +/*DcimFrontPortsCreateCreated handles this case with default header values. + +DcimFrontPortsCreateCreated dcim front ports create created +*/ +type DcimFrontPortsCreateCreated struct { + Payload *models.FrontPort +} + +func (o *DcimFrontPortsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/front-ports/][%d] dcimFrontPortsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimFrontPortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FrontPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_delete_parameters.go b/netbox/client/dcim/dcim_front_ports_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0ca03c01dec6fa8deb0a9c1f699953d2208a8e1d --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimFrontPortsDeleteParams creates a new DcimFrontPortsDeleteParams object +// with the default values initialized. +func NewDcimFrontPortsDeleteParams() *DcimFrontPortsDeleteParams { + var () + return &DcimFrontPortsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortsDeleteParamsWithTimeout creates a new DcimFrontPortsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortsDeleteParamsWithTimeout(timeout time.Duration) *DcimFrontPortsDeleteParams { + var () + return &DcimFrontPortsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortsDeleteParamsWithContext creates a new DcimFrontPortsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortsDeleteParamsWithContext(ctx context.Context) *DcimFrontPortsDeleteParams { + var () + return &DcimFrontPortsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortsDeleteParamsWithHTTPClient creates a new DcimFrontPortsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortsDeleteParamsWithHTTPClient(client *http.Client) *DcimFrontPortsDeleteParams { + var () + return &DcimFrontPortsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortsDeleteParams contains all the parameters to send to the API endpoint +for the dcim front ports delete operation typically these are written to a http.Request +*/ +type DcimFrontPortsDeleteParams struct { + + /*ID + A unique integer value identifying this front port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front ports delete params +func (o *DcimFrontPortsDeleteParams) WithTimeout(timeout time.Duration) *DcimFrontPortsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front ports delete params +func (o *DcimFrontPortsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front ports delete params +func (o *DcimFrontPortsDeleteParams) WithContext(ctx context.Context) *DcimFrontPortsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front ports delete params +func (o *DcimFrontPortsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front ports delete params +func (o *DcimFrontPortsDeleteParams) WithHTTPClient(client *http.Client) *DcimFrontPortsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front ports delete params +func (o *DcimFrontPortsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim front ports delete params +func (o *DcimFrontPortsDeleteParams) WithID(id int64) *DcimFrontPortsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front ports delete params +func (o *DcimFrontPortsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_delete_responses.go b/netbox/client/dcim/dcim_front_ports_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e4ead43d99901879b3bdb1247d98d0c8e6e0a5b9 --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimFrontPortsDeleteReader is a Reader for the DcimFrontPortsDelete structure. +type DcimFrontPortsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimFrontPortsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortsDeleteNoContent creates a DcimFrontPortsDeleteNoContent with default headers values +func NewDcimFrontPortsDeleteNoContent() *DcimFrontPortsDeleteNoContent { + return &DcimFrontPortsDeleteNoContent{} +} + +/*DcimFrontPortsDeleteNoContent handles this case with default header values. + +DcimFrontPortsDeleteNoContent dcim front ports delete no content +*/ +type DcimFrontPortsDeleteNoContent struct { +} + +func (o *DcimFrontPortsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/front-ports/{id}/][%d] dcimFrontPortsDeleteNoContent ", 204) +} + +func (o *DcimFrontPortsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_list_parameters.go b/netbox/client/dcim/dcim_front_ports_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5920e1921248a781072a30e1cb303782d4fadcd0 --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_list_parameters.go @@ -0,0 +1,455 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimFrontPortsListParams creates a new DcimFrontPortsListParams object +// with the default values initialized. +func NewDcimFrontPortsListParams() *DcimFrontPortsListParams { + var () + return &DcimFrontPortsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortsListParamsWithTimeout creates a new DcimFrontPortsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortsListParamsWithTimeout(timeout time.Duration) *DcimFrontPortsListParams { + var () + return &DcimFrontPortsListParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortsListParamsWithContext creates a new DcimFrontPortsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortsListParamsWithContext(ctx context.Context) *DcimFrontPortsListParams { + var () + return &DcimFrontPortsListParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortsListParamsWithHTTPClient creates a new DcimFrontPortsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortsListParamsWithHTTPClient(client *http.Client) *DcimFrontPortsListParams { + var () + return &DcimFrontPortsListParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortsListParams contains all the parameters to send to the API endpoint +for the dcim front ports list operation typically these are written to a http.Request +*/ +type DcimFrontPortsListParams struct { + + /*Cabled*/ + Cabled *string + /*Description*/ + Description *string + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*ID*/ + ID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Tag*/ + Tag *string + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithTimeout(timeout time.Duration) *DcimFrontPortsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithContext(ctx context.Context) *DcimFrontPortsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithHTTPClient(client *http.Client) *DcimFrontPortsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCabled adds the cabled to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithCabled(cabled *string) *DcimFrontPortsListParams { + o.SetCabled(cabled) + return o +} + +// SetCabled adds the cabled to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetCabled(cabled *string) { + o.Cabled = cabled +} + +// WithDescription adds the description to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithDescription(description *string) *DcimFrontPortsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDevice adds the device to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithDevice(device *string) *DcimFrontPortsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithDeviceID(deviceID *string) *DcimFrontPortsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithID adds the id to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithID(id *string) *DcimFrontPortsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithLimit(limit *int64) *DcimFrontPortsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithName(name *string) *DcimFrontPortsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithOffset(offset *int64) *DcimFrontPortsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithQ(q *string) *DcimFrontPortsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithTag(tag *string) *DcimFrontPortsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithType adds the typeVar to the dcim front ports list params +func (o *DcimFrontPortsListParams) WithType(typeVar *string) *DcimFrontPortsListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim front ports list params +func (o *DcimFrontPortsListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cabled != nil { + + // query param cabled + var qrCabled string + if o.Cabled != nil { + qrCabled = *o.Cabled + } + qCabled := qrCabled + if qCabled != "" { + if err := r.SetQueryParam("cabled", qCabled); err != nil { + return err + } + } + + } + + if o.Description != nil { + + // query param description + var qrDescription string + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_list_responses.go b/netbox/client/dcim/dcim_front_ports_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e01e00d0234b7b1b3c6b7127b388f400d1dd8c37 --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortsListReader is a Reader for the DcimFrontPortsList structure. +type DcimFrontPortsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimFrontPortsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortsListOK creates a DcimFrontPortsListOK with default headers values +func NewDcimFrontPortsListOK() *DcimFrontPortsListOK { + return &DcimFrontPortsListOK{} +} + +/*DcimFrontPortsListOK handles this case with default header values. + +DcimFrontPortsListOK dcim front ports list o k +*/ +type DcimFrontPortsListOK struct { + Payload *DcimFrontPortsListOKBody +} + +func (o *DcimFrontPortsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/front-ports/][%d] dcimFrontPortsListOK %+v", 200, o.Payload) +} + +func (o *DcimFrontPortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(DcimFrontPortsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*DcimFrontPortsListOKBody dcim front ports list o k body +swagger:model DcimFrontPortsListOKBody +*/ +type DcimFrontPortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.FrontPort `json:"results"` +} + +// Validate validates this dcim front ports list o k body +func (o *DcimFrontPortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimFrontPortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimFrontPortsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimFrontPortsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimFrontPortsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimFrontPortsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimFrontPortsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimFrontPortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimFrontPortsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimFrontPortsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimFrontPortsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimFrontPortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimFrontPortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_partial_update_parameters.go b/netbox/client/dcim/dcim_front_ports_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0eaf427f143af659dd3584d4b7bb1ad1fdd4ab7f --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimFrontPortsPartialUpdateParams creates a new DcimFrontPortsPartialUpdateParams object +// with the default values initialized. +func NewDcimFrontPortsPartialUpdateParams() *DcimFrontPortsPartialUpdateParams { + var () + return &DcimFrontPortsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortsPartialUpdateParamsWithTimeout creates a new DcimFrontPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimFrontPortsPartialUpdateParams { + var () + return &DcimFrontPortsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortsPartialUpdateParamsWithContext creates a new DcimFrontPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortsPartialUpdateParamsWithContext(ctx context.Context) *DcimFrontPortsPartialUpdateParams { + var () + return &DcimFrontPortsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortsPartialUpdateParamsWithHTTPClient creates a new DcimFrontPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimFrontPortsPartialUpdateParams { + var () + return &DcimFrontPortsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim front ports partial update operation typically these are written to a http.Request +*/ +type DcimFrontPortsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableFrontPort + /*ID + A unique integer value identifying this front port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimFrontPortsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) WithContext(ctx context.Context) *DcimFrontPortsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimFrontPortsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) WithData(data *models.WritableFrontPort) *DcimFrontPortsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) SetData(data *models.WritableFrontPort) { + o.Data = data +} + +// WithID adds the id to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) WithID(id int64) *DcimFrontPortsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front ports partial update params +func (o *DcimFrontPortsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_partial_update_responses.go b/netbox/client/dcim/dcim_front_ports_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..73c84e9261162c08948931ab31f4bb63e04ac0db --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortsPartialUpdateReader is a Reader for the DcimFrontPortsPartialUpdate structure. +type DcimFrontPortsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimFrontPortsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortsPartialUpdateOK creates a DcimFrontPortsPartialUpdateOK with default headers values +func NewDcimFrontPortsPartialUpdateOK() *DcimFrontPortsPartialUpdateOK { + return &DcimFrontPortsPartialUpdateOK{} +} + +/*DcimFrontPortsPartialUpdateOK handles this case with default header values. + +DcimFrontPortsPartialUpdateOK dcim front ports partial update o k +*/ +type DcimFrontPortsPartialUpdateOK struct { + Payload *models.FrontPort +} + +func (o *DcimFrontPortsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/front-ports/{id}/][%d] dcimFrontPortsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimFrontPortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FrontPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_read_parameters.go b/netbox/client/dcim/dcim_front_ports_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b99f8e5556d66fc69de41f458fa37a8c6694b550 --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimFrontPortsReadParams creates a new DcimFrontPortsReadParams object +// with the default values initialized. +func NewDcimFrontPortsReadParams() *DcimFrontPortsReadParams { + var () + return &DcimFrontPortsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortsReadParamsWithTimeout creates a new DcimFrontPortsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortsReadParamsWithTimeout(timeout time.Duration) *DcimFrontPortsReadParams { + var () + return &DcimFrontPortsReadParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortsReadParamsWithContext creates a new DcimFrontPortsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortsReadParamsWithContext(ctx context.Context) *DcimFrontPortsReadParams { + var () + return &DcimFrontPortsReadParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortsReadParamsWithHTTPClient creates a new DcimFrontPortsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortsReadParamsWithHTTPClient(client *http.Client) *DcimFrontPortsReadParams { + var () + return &DcimFrontPortsReadParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortsReadParams contains all the parameters to send to the API endpoint +for the dcim front ports read operation typically these are written to a http.Request +*/ +type DcimFrontPortsReadParams struct { + + /*ID + A unique integer value identifying this front port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front ports read params +func (o *DcimFrontPortsReadParams) WithTimeout(timeout time.Duration) *DcimFrontPortsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front ports read params +func (o *DcimFrontPortsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front ports read params +func (o *DcimFrontPortsReadParams) WithContext(ctx context.Context) *DcimFrontPortsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front ports read params +func (o *DcimFrontPortsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front ports read params +func (o *DcimFrontPortsReadParams) WithHTTPClient(client *http.Client) *DcimFrontPortsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front ports read params +func (o *DcimFrontPortsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim front ports read params +func (o *DcimFrontPortsReadParams) WithID(id int64) *DcimFrontPortsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front ports read params +func (o *DcimFrontPortsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_read_responses.go b/netbox/client/dcim/dcim_front_ports_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cf267230d211b6c0402458d4bd164f1c542ef31a --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortsReadReader is a Reader for the DcimFrontPortsRead structure. +type DcimFrontPortsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimFrontPortsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortsReadOK creates a DcimFrontPortsReadOK with default headers values +func NewDcimFrontPortsReadOK() *DcimFrontPortsReadOK { + return &DcimFrontPortsReadOK{} +} + +/*DcimFrontPortsReadOK handles this case with default header values. + +DcimFrontPortsReadOK dcim front ports read o k +*/ +type DcimFrontPortsReadOK struct { + Payload *models.FrontPort +} + +func (o *DcimFrontPortsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/front-ports/{id}/][%d] dcimFrontPortsReadOK %+v", 200, o.Payload) +} + +func (o *DcimFrontPortsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FrontPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_update_parameters.go b/netbox/client/dcim/dcim_front_ports_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4326b7c3cac8abe884bce6cc1e846a9f42e34b43 --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimFrontPortsUpdateParams creates a new DcimFrontPortsUpdateParams object +// with the default values initialized. +func NewDcimFrontPortsUpdateParams() *DcimFrontPortsUpdateParams { + var () + return &DcimFrontPortsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimFrontPortsUpdateParamsWithTimeout creates a new DcimFrontPortsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimFrontPortsUpdateParamsWithTimeout(timeout time.Duration) *DcimFrontPortsUpdateParams { + var () + return &DcimFrontPortsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimFrontPortsUpdateParamsWithContext creates a new DcimFrontPortsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimFrontPortsUpdateParamsWithContext(ctx context.Context) *DcimFrontPortsUpdateParams { + var () + return &DcimFrontPortsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimFrontPortsUpdateParamsWithHTTPClient creates a new DcimFrontPortsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimFrontPortsUpdateParamsWithHTTPClient(client *http.Client) *DcimFrontPortsUpdateParams { + var () + return &DcimFrontPortsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimFrontPortsUpdateParams contains all the parameters to send to the API endpoint +for the dcim front ports update operation typically these are written to a http.Request +*/ +type DcimFrontPortsUpdateParams struct { + + /*Data*/ + Data *models.WritableFrontPort + /*ID + A unique integer value identifying this front port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) WithTimeout(timeout time.Duration) *DcimFrontPortsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) WithContext(ctx context.Context) *DcimFrontPortsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) WithHTTPClient(client *http.Client) *DcimFrontPortsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) WithData(data *models.WritableFrontPort) *DcimFrontPortsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) SetData(data *models.WritableFrontPort) { + o.Data = data +} + +// WithID adds the id to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) WithID(id int64) *DcimFrontPortsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim front ports update params +func (o *DcimFrontPortsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimFrontPortsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_front_ports_update_responses.go b/netbox/client/dcim/dcim_front_ports_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3adeb8617c8e359e7be79a2b3c3fb0b818b0066c --- /dev/null +++ b/netbox/client/dcim/dcim_front_ports_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimFrontPortsUpdateReader is a Reader for the DcimFrontPortsUpdate structure. +type DcimFrontPortsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimFrontPortsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimFrontPortsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimFrontPortsUpdateOK creates a DcimFrontPortsUpdateOK with default headers values +func NewDcimFrontPortsUpdateOK() *DcimFrontPortsUpdateOK { + return &DcimFrontPortsUpdateOK{} +} + +/*DcimFrontPortsUpdateOK handles this case with default header values. + +DcimFrontPortsUpdateOK dcim front ports update o k +*/ +type DcimFrontPortsUpdateOK struct { + Payload *models.FrontPort +} + +func (o *DcimFrontPortsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/front-ports/{id}/][%d] dcimFrontPortsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimFrontPortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.FrontPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_create_parameters.go b/netbox/client/dcim/dcim_interface_connections_create_parameters.go deleted file mode 100644 index 42310573f9dafcc5d52ef2b07dd79582366dcb5d..0000000000000000000000000000000000000000 --- a/netbox/client/dcim/dcim_interface_connections_create_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package dcim - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/digitalocean/go-netbox/netbox/models" -) - -// NewDcimInterfaceConnectionsCreateParams creates a new DcimInterfaceConnectionsCreateParams object -// with the default values initialized. -func NewDcimInterfaceConnectionsCreateParams() *DcimInterfaceConnectionsCreateParams { - var () - return &DcimInterfaceConnectionsCreateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDcimInterfaceConnectionsCreateParamsWithTimeout creates a new DcimInterfaceConnectionsCreateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDcimInterfaceConnectionsCreateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsCreateParams { - var () - return &DcimInterfaceConnectionsCreateParams{ - - timeout: timeout, - } -} - -// NewDcimInterfaceConnectionsCreateParamsWithContext creates a new DcimInterfaceConnectionsCreateParams object -// with the default values initialized, and the ability to set a context for a request -func NewDcimInterfaceConnectionsCreateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsCreateParams { - var () - return &DcimInterfaceConnectionsCreateParams{ - - Context: ctx, - } -} - -// NewDcimInterfaceConnectionsCreateParamsWithHTTPClient creates a new DcimInterfaceConnectionsCreateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDcimInterfaceConnectionsCreateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsCreateParams { - var () - return &DcimInterfaceConnectionsCreateParams{ - HTTPClient: client, - } -} - -/*DcimInterfaceConnectionsCreateParams contains all the parameters to send to the API endpoint -for the dcim interface connections create operation typically these are written to a http.Request -*/ -type DcimInterfaceConnectionsCreateParams struct { - - /*Data*/ - Data *models.WritableInterfaceConnection - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the dcim interface connections create params -func (o *DcimInterfaceConnectionsCreateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsCreateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the dcim interface connections create params -func (o *DcimInterfaceConnectionsCreateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the dcim interface connections create params -func (o *DcimInterfaceConnectionsCreateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsCreateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the dcim interface connections create params -func (o *DcimInterfaceConnectionsCreateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the dcim interface connections create params -func (o *DcimInterfaceConnectionsCreateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsCreateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the dcim interface connections create params -func (o *DcimInterfaceConnectionsCreateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithData adds the data to the dcim interface connections create params -func (o *DcimInterfaceConnectionsCreateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsCreateParams { - o.SetData(data) - return o -} - -// SetData adds the data to the dcim interface connections create params -func (o *DcimInterfaceConnectionsCreateParams) SetData(data *models.WritableInterfaceConnection) { - o.Data = data -} - -// WriteToRequest writes these params to a swagger request -func (o *DcimInterfaceConnectionsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Data != nil { - if err := r.SetBodyParam(o.Data); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/client/dcim/dcim_interface_connections_delete_parameters.go b/netbox/client/dcim/dcim_interface_connections_delete_parameters.go deleted file mode 100644 index b392d953a572ce1048fb7b35644ad75f6c6d4246..0000000000000000000000000000000000000000 --- a/netbox/client/dcim/dcim_interface_connections_delete_parameters.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package dcim - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewDcimInterfaceConnectionsDeleteParams creates a new DcimInterfaceConnectionsDeleteParams object -// with the default values initialized. -func NewDcimInterfaceConnectionsDeleteParams() *DcimInterfaceConnectionsDeleteParams { - var () - return &DcimInterfaceConnectionsDeleteParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDcimInterfaceConnectionsDeleteParamsWithTimeout creates a new DcimInterfaceConnectionsDeleteParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDcimInterfaceConnectionsDeleteParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsDeleteParams { - var () - return &DcimInterfaceConnectionsDeleteParams{ - - timeout: timeout, - } -} - -// NewDcimInterfaceConnectionsDeleteParamsWithContext creates a new DcimInterfaceConnectionsDeleteParams object -// with the default values initialized, and the ability to set a context for a request -func NewDcimInterfaceConnectionsDeleteParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsDeleteParams { - var () - return &DcimInterfaceConnectionsDeleteParams{ - - Context: ctx, - } -} - -// NewDcimInterfaceConnectionsDeleteParamsWithHTTPClient creates a new DcimInterfaceConnectionsDeleteParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDcimInterfaceConnectionsDeleteParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsDeleteParams { - var () - return &DcimInterfaceConnectionsDeleteParams{ - HTTPClient: client, - } -} - -/*DcimInterfaceConnectionsDeleteParams contains all the parameters to send to the API endpoint -for the dcim interface connections delete operation typically these are written to a http.Request -*/ -type DcimInterfaceConnectionsDeleteParams struct { - - /*ID - A unique integer value identifying this interface connection. - - */ - ID int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the dcim interface connections delete params -func (o *DcimInterfaceConnectionsDeleteParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsDeleteParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the dcim interface connections delete params -func (o *DcimInterfaceConnectionsDeleteParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the dcim interface connections delete params -func (o *DcimInterfaceConnectionsDeleteParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsDeleteParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the dcim interface connections delete params -func (o *DcimInterfaceConnectionsDeleteParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the dcim interface connections delete params -func (o *DcimInterfaceConnectionsDeleteParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsDeleteParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the dcim interface connections delete params -func (o *DcimInterfaceConnectionsDeleteParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the dcim interface connections delete params -func (o *DcimInterfaceConnectionsDeleteParams) WithID(id int64) *DcimInterfaceConnectionsDeleteParams { - o.SetID(id) - return o -} - -// SetID adds the id to the dcim interface connections delete params -func (o *DcimInterfaceConnectionsDeleteParams) SetID(id int64) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DcimInterfaceConnectionsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/client/dcim/dcim_interface_connections_list_parameters.go b/netbox/client/dcim/dcim_interface_connections_list_parameters.go index 5e6c1bdfd4d85359d7caaf26a934b333941d00d1..62452bc9bea8ea5c27d1398ab255cdce9f353a5d 100644 --- a/netbox/client/dcim/dcim_interface_connections_list_parameters.go +++ b/netbox/client/dcim/dcim_interface_connections_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_interface_connections_list_responses.go b/netbox/client/dcim/dcim_interface_connections_list_responses.go index f65d4fba802349b00ce3bc35aeee72532e44a5a7..01c6e5853e8d0fe20c4461185f17821cafbfb65c 100644 --- a/netbox/client/dcim/dcim_interface_connections_list_responses.go +++ b/netbox/client/dcim/dcim_interface_connections_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfaceConnectionsListReader is a Reader for the DcimInterfaceConnectionsList structure. @@ -61,7 +65,7 @@ func NewDcimInterfaceConnectionsListOK() *DcimInterfaceConnectionsListOK { DcimInterfaceConnectionsListOK dcim interface connections list o k */ type DcimInterfaceConnectionsListOK struct { - Payload *models.DcimInterfaceConnectionsListOKBody + Payload *DcimInterfaceConnectionsListOKBody } func (o *DcimInterfaceConnectionsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimInterfaceConnectionsListOK) Error() string { func (o *DcimInterfaceConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimInterfaceConnectionsListOKBody) + o.Payload = new(DcimInterfaceConnectionsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimInterfaceConnectionsListOK) readResponse(response runtime.ClientRes return nil } + +/*DcimInterfaceConnectionsListOKBody dcim interface connections list o k body +swagger:model DcimInterfaceConnectionsListOKBody +*/ +type DcimInterfaceConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.InterfaceConnection `json:"results"` +} + +// Validate validates this dcim interface connections list o k body +func (o *DcimInterfaceConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimInterfaceConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimInterfaceConnectionsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfaceConnectionsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimInterfaceConnectionsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfaceConnectionsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimInterfaceConnectionsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfaceConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimInterfaceConnectionsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimInterfaceConnectionsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimInterfaceConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimInterfaceConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfaceConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go b/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go deleted file mode 100644 index eda3947a0fec7b14e6c5718f94c90a419cd33e03..0000000000000000000000000000000000000000 --- a/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package dcim - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/digitalocean/go-netbox/netbox/models" -) - -// NewDcimInterfaceConnectionsPartialUpdateParams creates a new DcimInterfaceConnectionsPartialUpdateParams object -// with the default values initialized. -func NewDcimInterfaceConnectionsPartialUpdateParams() *DcimInterfaceConnectionsPartialUpdateParams { - var () - return &DcimInterfaceConnectionsPartialUpdateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDcimInterfaceConnectionsPartialUpdateParamsWithTimeout creates a new DcimInterfaceConnectionsPartialUpdateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDcimInterfaceConnectionsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsPartialUpdateParams { - var () - return &DcimInterfaceConnectionsPartialUpdateParams{ - - timeout: timeout, - } -} - -// NewDcimInterfaceConnectionsPartialUpdateParamsWithContext creates a new DcimInterfaceConnectionsPartialUpdateParams object -// with the default values initialized, and the ability to set a context for a request -func NewDcimInterfaceConnectionsPartialUpdateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsPartialUpdateParams { - var () - return &DcimInterfaceConnectionsPartialUpdateParams{ - - Context: ctx, - } -} - -// NewDcimInterfaceConnectionsPartialUpdateParamsWithHTTPClient creates a new DcimInterfaceConnectionsPartialUpdateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDcimInterfaceConnectionsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsPartialUpdateParams { - var () - return &DcimInterfaceConnectionsPartialUpdateParams{ - HTTPClient: client, - } -} - -/*DcimInterfaceConnectionsPartialUpdateParams contains all the parameters to send to the API endpoint -for the dcim interface connections partial update operation typically these are written to a http.Request -*/ -type DcimInterfaceConnectionsPartialUpdateParams struct { - - /*Data*/ - Data *models.WritableInterfaceConnection - /*ID - A unique integer value identifying this interface connection. - - */ - ID int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsPartialUpdateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsPartialUpdateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsPartialUpdateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithData adds the data to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsPartialUpdateParams { - o.SetData(data) - return o -} - -// SetData adds the data to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) SetData(data *models.WritableInterfaceConnection) { - o.Data = data -} - -// WithID adds the id to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) WithID(id int64) *DcimInterfaceConnectionsPartialUpdateParams { - o.SetID(id) - return o -} - -// SetID adds the id to the dcim interface connections partial update params -func (o *DcimInterfaceConnectionsPartialUpdateParams) SetID(id int64) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DcimInterfaceConnectionsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Data != nil { - if err := r.SetBodyParam(o.Data); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go b/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go deleted file mode 100644 index 7666482738d4a31934945403e0cdd180064a9fbc..0000000000000000000000000000000000000000 --- a/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package dcim - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/digitalocean/go-netbox/netbox/models" -) - -// DcimInterfaceConnectionsPartialUpdateReader is a Reader for the DcimInterfaceConnectionsPartialUpdate structure. -type DcimInterfaceConnectionsPartialUpdateReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DcimInterfaceConnectionsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewDcimInterfaceConnectionsPartialUpdateOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewDcimInterfaceConnectionsPartialUpdateOK creates a DcimInterfaceConnectionsPartialUpdateOK with default headers values -func NewDcimInterfaceConnectionsPartialUpdateOK() *DcimInterfaceConnectionsPartialUpdateOK { - return &DcimInterfaceConnectionsPartialUpdateOK{} -} - -/*DcimInterfaceConnectionsPartialUpdateOK handles this case with default header values. - -DcimInterfaceConnectionsPartialUpdateOK dcim interface connections partial update o k -*/ -type DcimInterfaceConnectionsPartialUpdateOK struct { - Payload *models.WritableInterfaceConnection -} - -func (o *DcimInterfaceConnectionsPartialUpdateOK) Error() string { - return fmt.Sprintf("[PATCH /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsPartialUpdateOK %+v", 200, o.Payload) -} - -func (o *DcimInterfaceConnectionsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.WritableInterfaceConnection) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/netbox/client/dcim/dcim_interface_connections_read_parameters.go b/netbox/client/dcim/dcim_interface_connections_read_parameters.go deleted file mode 100644 index e24b256f3777272af30fa87369d04a48de8ede86..0000000000000000000000000000000000000000 --- a/netbox/client/dcim/dcim_interface_connections_read_parameters.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package dcim - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewDcimInterfaceConnectionsReadParams creates a new DcimInterfaceConnectionsReadParams object -// with the default values initialized. -func NewDcimInterfaceConnectionsReadParams() *DcimInterfaceConnectionsReadParams { - var () - return &DcimInterfaceConnectionsReadParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDcimInterfaceConnectionsReadParamsWithTimeout creates a new DcimInterfaceConnectionsReadParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDcimInterfaceConnectionsReadParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsReadParams { - var () - return &DcimInterfaceConnectionsReadParams{ - - timeout: timeout, - } -} - -// NewDcimInterfaceConnectionsReadParamsWithContext creates a new DcimInterfaceConnectionsReadParams object -// with the default values initialized, and the ability to set a context for a request -func NewDcimInterfaceConnectionsReadParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsReadParams { - var () - return &DcimInterfaceConnectionsReadParams{ - - Context: ctx, - } -} - -// NewDcimInterfaceConnectionsReadParamsWithHTTPClient creates a new DcimInterfaceConnectionsReadParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDcimInterfaceConnectionsReadParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsReadParams { - var () - return &DcimInterfaceConnectionsReadParams{ - HTTPClient: client, - } -} - -/*DcimInterfaceConnectionsReadParams contains all the parameters to send to the API endpoint -for the dcim interface connections read operation typically these are written to a http.Request -*/ -type DcimInterfaceConnectionsReadParams struct { - - /*ID - A unique integer value identifying this interface connection. - - */ - ID int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the dcim interface connections read params -func (o *DcimInterfaceConnectionsReadParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsReadParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the dcim interface connections read params -func (o *DcimInterfaceConnectionsReadParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the dcim interface connections read params -func (o *DcimInterfaceConnectionsReadParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsReadParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the dcim interface connections read params -func (o *DcimInterfaceConnectionsReadParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the dcim interface connections read params -func (o *DcimInterfaceConnectionsReadParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsReadParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the dcim interface connections read params -func (o *DcimInterfaceConnectionsReadParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the dcim interface connections read params -func (o *DcimInterfaceConnectionsReadParams) WithID(id int64) *DcimInterfaceConnectionsReadParams { - o.SetID(id) - return o -} - -// SetID adds the id to the dcim interface connections read params -func (o *DcimInterfaceConnectionsReadParams) SetID(id int64) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DcimInterfaceConnectionsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/client/dcim/dcim_interface_connections_update_parameters.go b/netbox/client/dcim/dcim_interface_connections_update_parameters.go deleted file mode 100644 index 85cc6a16f048ea40e17abf4622ffdb6fd4002581..0000000000000000000000000000000000000000 --- a/netbox/client/dcim/dcim_interface_connections_update_parameters.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package dcim - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/digitalocean/go-netbox/netbox/models" -) - -// NewDcimInterfaceConnectionsUpdateParams creates a new DcimInterfaceConnectionsUpdateParams object -// with the default values initialized. -func NewDcimInterfaceConnectionsUpdateParams() *DcimInterfaceConnectionsUpdateParams { - var () - return &DcimInterfaceConnectionsUpdateParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewDcimInterfaceConnectionsUpdateParamsWithTimeout creates a new DcimInterfaceConnectionsUpdateParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewDcimInterfaceConnectionsUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsUpdateParams { - var () - return &DcimInterfaceConnectionsUpdateParams{ - - timeout: timeout, - } -} - -// NewDcimInterfaceConnectionsUpdateParamsWithContext creates a new DcimInterfaceConnectionsUpdateParams object -// with the default values initialized, and the ability to set a context for a request -func NewDcimInterfaceConnectionsUpdateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsUpdateParams { - var () - return &DcimInterfaceConnectionsUpdateParams{ - - Context: ctx, - } -} - -// NewDcimInterfaceConnectionsUpdateParamsWithHTTPClient creates a new DcimInterfaceConnectionsUpdateParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewDcimInterfaceConnectionsUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsUpdateParams { - var () - return &DcimInterfaceConnectionsUpdateParams{ - HTTPClient: client, - } -} - -/*DcimInterfaceConnectionsUpdateParams contains all the parameters to send to the API endpoint -for the dcim interface connections update operation typically these are written to a http.Request -*/ -type DcimInterfaceConnectionsUpdateParams struct { - - /*Data*/ - Data *models.WritableInterfaceConnection - /*ID - A unique integer value identifying this interface connection. - - */ - ID int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsUpdateParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsUpdateParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsUpdateParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithData adds the data to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsUpdateParams { - o.SetData(data) - return o -} - -// SetData adds the data to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) SetData(data *models.WritableInterfaceConnection) { - o.Data = data -} - -// WithID adds the id to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) WithID(id int64) *DcimInterfaceConnectionsUpdateParams { - o.SetID(id) - return o -} - -// SetID adds the id to the dcim interface connections update params -func (o *DcimInterfaceConnectionsUpdateParams) SetID(id int64) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *DcimInterfaceConnectionsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Data != nil { - if err := r.SetBodyParam(o.Data); err != nil { - return err - } - } - - // path param id - if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/client/dcim/dcim_interface_templates_create_parameters.go b/netbox/client/dcim/dcim_interface_templates_create_parameters.go index 6307ae6fa60df9a067b96886857b3f2264ebc155..274f5e2dbf0becb147f0f676eeffabd8e3068345 100644 --- a/netbox/client/dcim/dcim_interface_templates_create_parameters.go +++ b/netbox/client/dcim/dcim_interface_templates_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInterfaceTemplatesCreateParams creates a new DcimInterfaceTemplatesCreateParams object diff --git a/netbox/client/dcim/dcim_interface_templates_create_responses.go b/netbox/client/dcim/dcim_interface_templates_create_responses.go index 150768f5be73b4e701e9937f7bb6da943466094b..7d1c696fc33b6372daf6ea25d26db83706d565aa 100644 --- a/netbox/client/dcim/dcim_interface_templates_create_responses.go +++ b/netbox/client/dcim/dcim_interface_templates_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfaceTemplatesCreateReader is a Reader for the DcimInterfaceTemplatesCreate structure. @@ -61,7 +61,7 @@ func NewDcimInterfaceTemplatesCreateCreated() *DcimInterfaceTemplatesCreateCreat DcimInterfaceTemplatesCreateCreated dcim interface templates create created */ type DcimInterfaceTemplatesCreateCreated struct { - Payload *models.WritableInterfaceTemplate + Payload *models.InterfaceTemplate } func (o *DcimInterfaceTemplatesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInterfaceTemplatesCreateCreated) Error() string { func (o *DcimInterfaceTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterfaceTemplate) + o.Payload = new(models.InterfaceTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_interface_templates_delete_parameters.go b/netbox/client/dcim/dcim_interface_templates_delete_parameters.go index c564d63dbce24e4ec8129f3008cb4e1e3c537329..953871ca3b983f5f2977233045e6706bd40e897e 100644 --- a/netbox/client/dcim/dcim_interface_templates_delete_parameters.go +++ b/netbox/client/dcim/dcim_interface_templates_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_interface_templates_list_parameters.go b/netbox/client/dcim/dcim_interface_templates_list_parameters.go index 44b97fda3c23b707009d18e9270a268058354a95..9c6deccdfbb053fef0d378c00ca330ea0ac8c448 100644 --- a/netbox/client/dcim/dcim_interface_templates_list_parameters.go +++ b/netbox/client/dcim/dcim_interface_templates_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -79,8 +78,8 @@ type DcimInterfaceTemplatesListParams struct { /*DevicetypeID*/ DevicetypeID *string - /*FormFactor*/ - FormFactor *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -95,6 +94,10 @@ type DcimInterfaceTemplatesListParams struct { */ Offset *int64 + /*Q*/ + Q *string + /*Type*/ + Type *string timeout time.Duration Context context.Context @@ -145,15 +148,15 @@ func (o *DcimInterfaceTemplatesListParams) SetDevicetypeID(devicetypeID *string) o.DevicetypeID = devicetypeID } -// WithFormFactor adds the formFactor to the dcim interface templates list params -func (o *DcimInterfaceTemplatesListParams) WithFormFactor(formFactor *string) *DcimInterfaceTemplatesListParams { - o.SetFormFactor(formFactor) +// WithID adds the id to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithID(id *string) *DcimInterfaceTemplatesListParams { + o.SetID(id) return o } -// SetFormFactor adds the formFactor to the dcim interface templates list params -func (o *DcimInterfaceTemplatesListParams) SetFormFactor(formFactor *string) { - o.FormFactor = formFactor +// SetID adds the id to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetID(id *string) { + o.ID = id } // WithLimit adds the limit to the dcim interface templates list params @@ -200,6 +203,28 @@ func (o *DcimInterfaceTemplatesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithQ(q *string) *DcimInterfaceTemplatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetQ(q *string) { + o.Q = q +} + +// WithType adds the typeVar to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithType(typeVar *string) *DcimInterfaceTemplatesListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetType(typeVar *string) { + o.Type = typeVar +} + // WriteToRequest writes these params to a swagger request func (o *DcimInterfaceTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -224,16 +249,16 @@ func (o *DcimInterfaceTemplatesListParams) WriteToRequest(r runtime.ClientReques } - if o.FormFactor != nil { + if o.ID != nil { - // query param form_factor - var qrFormFactor string - if o.FormFactor != nil { - qrFormFactor = *o.FormFactor + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID } - qFormFactor := qrFormFactor - if qFormFactor != "" { - if err := r.SetQueryParam("form_factor", qFormFactor); err != nil { + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { return err } } @@ -304,6 +329,38 @@ func (o *DcimInterfaceTemplatesListParams) WriteToRequest(r runtime.ClientReques } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_interface_templates_list_responses.go b/netbox/client/dcim/dcim_interface_templates_list_responses.go index 8d505de101c7afc6624f4cc4b6f0edce06f98ca4..f4ebe6d36e4700c38342afe64a1ca6233181c064 100644 --- a/netbox/client/dcim/dcim_interface_templates_list_responses.go +++ b/netbox/client/dcim/dcim_interface_templates_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfaceTemplatesListReader is a Reader for the DcimInterfaceTemplatesList structure. @@ -61,7 +65,7 @@ func NewDcimInterfaceTemplatesListOK() *DcimInterfaceTemplatesListOK { DcimInterfaceTemplatesListOK dcim interface templates list o k */ type DcimInterfaceTemplatesListOK struct { - Payload *models.DcimInterfaceTemplatesListOKBody + Payload *DcimInterfaceTemplatesListOKBody } func (o *DcimInterfaceTemplatesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimInterfaceTemplatesListOK) Error() string { func (o *DcimInterfaceTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimInterfaceTemplatesListOKBody) + o.Payload = new(DcimInterfaceTemplatesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimInterfaceTemplatesListOK) readResponse(response runtime.ClientRespo return nil } + +/*DcimInterfaceTemplatesListOKBody dcim interface templates list o k body +swagger:model DcimInterfaceTemplatesListOKBody +*/ +type DcimInterfaceTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.InterfaceTemplate `json:"results"` +} + +// Validate validates this dcim interface templates list o k body +func (o *DcimInterfaceTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimInterfaceTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimInterfaceTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfaceTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimInterfaceTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfaceTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimInterfaceTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfaceTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimInterfaceTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimInterfaceTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimInterfaceTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimInterfaceTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfaceTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go index d231ca8a008c0280c93796b5e5cf12d7b74733e8..291b4c9d5a83d32079070603658f5d88f2f831a2 100644 --- a/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInterfaceTemplatesPartialUpdateParams creates a new DcimInterfaceTemplatesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go b/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go index 771869440c06cef0b7a340094da3c3a39ba10fff..8ccda0e19b018d7e9ea36e59071b48a15290d7c9 100644 --- a/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go +++ b/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfaceTemplatesPartialUpdateReader is a Reader for the DcimInterfaceTemplatesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimInterfaceTemplatesPartialUpdateOK() *DcimInterfaceTemplatesPartialUp DcimInterfaceTemplatesPartialUpdateOK dcim interface templates partial update o k */ type DcimInterfaceTemplatesPartialUpdateOK struct { - Payload *models.WritableInterfaceTemplate + Payload *models.InterfaceTemplate } func (o *DcimInterfaceTemplatesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInterfaceTemplatesPartialUpdateOK) Error() string { func (o *DcimInterfaceTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterfaceTemplate) + o.Payload = new(models.InterfaceTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_interface_templates_read_parameters.go b/netbox/client/dcim/dcim_interface_templates_read_parameters.go index 8446aad03fa29f0b8b0f4d99e3dc38abc4735995..d4d5ac7fd7dd38426646b257ce0251333fb45b41 100644 --- a/netbox/client/dcim/dcim_interface_templates_read_parameters.go +++ b/netbox/client/dcim/dcim_interface_templates_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_interface_templates_read_responses.go b/netbox/client/dcim/dcim_interface_templates_read_responses.go index b670d4e283d3ccc8d1199a5cd0868506cf05a395..531fdb057d6240a597b9bac6848f22e560d70152 100644 --- a/netbox/client/dcim/dcim_interface_templates_read_responses.go +++ b/netbox/client/dcim/dcim_interface_templates_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfaceTemplatesReadReader is a Reader for the DcimInterfaceTemplatesRead structure. diff --git a/netbox/client/dcim/dcim_interface_templates_update_parameters.go b/netbox/client/dcim/dcim_interface_templates_update_parameters.go index 526828e923ebfc44626436c66e7f38d2575fbe2f..dc5fbd781fab8e58e5e9c451e86cc6d3d51540c4 100644 --- a/netbox/client/dcim/dcim_interface_templates_update_parameters.go +++ b/netbox/client/dcim/dcim_interface_templates_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInterfaceTemplatesUpdateParams creates a new DcimInterfaceTemplatesUpdateParams object diff --git a/netbox/client/dcim/dcim_interface_templates_update_responses.go b/netbox/client/dcim/dcim_interface_templates_update_responses.go index 1a14d3b83c95c855f63b0fd1a6934a2976456f58..cc678e19e1be0047ab5eeb11067d4ac9b2e524e6 100644 --- a/netbox/client/dcim/dcim_interface_templates_update_responses.go +++ b/netbox/client/dcim/dcim_interface_templates_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfaceTemplatesUpdateReader is a Reader for the DcimInterfaceTemplatesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimInterfaceTemplatesUpdateOK() *DcimInterfaceTemplatesUpdateOK { DcimInterfaceTemplatesUpdateOK dcim interface templates update o k */ type DcimInterfaceTemplatesUpdateOK struct { - Payload *models.WritableInterfaceTemplate + Payload *models.InterfaceTemplate } func (o *DcimInterfaceTemplatesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInterfaceTemplatesUpdateOK) Error() string { func (o *DcimInterfaceTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterfaceTemplate) + o.Payload = new(models.InterfaceTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_interfaces_create_parameters.go b/netbox/client/dcim/dcim_interfaces_create_parameters.go index 16065f45af95582af4451dd915cd48a88655b2bd..098fc68da53d5e5cca93378a7507d9805e8f1198 100644 --- a/netbox/client/dcim/dcim_interfaces_create_parameters.go +++ b/netbox/client/dcim/dcim_interfaces_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInterfacesCreateParams creates a new DcimInterfacesCreateParams object @@ -79,7 +78,7 @@ for the dcim interfaces create operation typically these are written to a http.R type DcimInterfacesCreateParams struct { /*Data*/ - Data *models.WritableInterface + Data *models.WritableDeviceInterface timeout time.Duration Context context.Context @@ -120,13 +119,13 @@ func (o *DcimInterfacesCreateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim interfaces create params -func (o *DcimInterfacesCreateParams) WithData(data *models.WritableInterface) *DcimInterfacesCreateParams { +func (o *DcimInterfacesCreateParams) WithData(data *models.WritableDeviceInterface) *DcimInterfacesCreateParams { o.SetData(data) return o } // SetData adds the data to the dcim interfaces create params -func (o *DcimInterfacesCreateParams) SetData(data *models.WritableInterface) { +func (o *DcimInterfacesCreateParams) SetData(data *models.WritableDeviceInterface) { o.Data = data } diff --git a/netbox/client/dcim/dcim_interfaces_create_responses.go b/netbox/client/dcim/dcim_interfaces_create_responses.go index ca7ba27ad0eb595d94aaba646937f3022a29f1a2..42d05b5a7a2ddc802d39d2906dcf05ad2b5b0b0c 100644 --- a/netbox/client/dcim/dcim_interfaces_create_responses.go +++ b/netbox/client/dcim/dcim_interfaces_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfacesCreateReader is a Reader for the DcimInterfacesCreate structure. @@ -61,7 +61,7 @@ func NewDcimInterfacesCreateCreated() *DcimInterfacesCreateCreated { DcimInterfacesCreateCreated dcim interfaces create created */ type DcimInterfacesCreateCreated struct { - Payload *models.WritableInterface + Payload *models.DeviceInterface } func (o *DcimInterfacesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInterfacesCreateCreated) Error() string { func (o *DcimInterfacesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterface) + o.Payload = new(models.DeviceInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_interfaces_delete_parameters.go b/netbox/client/dcim/dcim_interfaces_delete_parameters.go index db8a88466f35e25a2eaa9d12b122127e400e03b7..430783f1db7e48a1c8f2df81ee905813cfb9ef60 100644 --- a/netbox/client/dcim/dcim_interfaces_delete_parameters.go +++ b/netbox/client/dcim/dcim_interfaces_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_interfaces_graphs_parameters.go b/netbox/client/dcim/dcim_interfaces_graphs_parameters.go index 53fe1177d346a1e2e17c4366307c10194cc4aa5f..2947fce80b57319358f2d3d7bf15a05e74d8b698 100644 --- a/netbox/client/dcim/dcim_interfaces_graphs_parameters.go +++ b/netbox/client/dcim/dcim_interfaces_graphs_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_interfaces_graphs_responses.go b/netbox/client/dcim/dcim_interfaces_graphs_responses.go index 868c94a1bbedb0f78a05b49cc1d15fd677a497af..e1bc62501848a8d70ed7329101e848335042f20c 100644 --- a/netbox/client/dcim/dcim_interfaces_graphs_responses.go +++ b/netbox/client/dcim/dcim_interfaces_graphs_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfacesGraphsReader is a Reader for the DcimInterfacesGraphs structure. @@ -61,7 +61,7 @@ func NewDcimInterfacesGraphsOK() *DcimInterfacesGraphsOK { DcimInterfacesGraphsOK dcim interfaces graphs o k */ type DcimInterfacesGraphsOK struct { - Payload *models.Interface + Payload *models.DeviceInterface } func (o *DcimInterfacesGraphsOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInterfacesGraphsOK) Error() string { func (o *DcimInterfacesGraphsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Interface) + o.Payload = new(models.DeviceInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_interfaces_list_parameters.go b/netbox/client/dcim/dcim_interfaces_list_parameters.go index a8121cf1a475e22159c80e78f5c7b52212229447..70de9ebacc0c6e2ba66848eeb55d32489364a3a0 100644 --- a/netbox/client/dcim/dcim_interfaces_list_parameters.go +++ b/netbox/client/dcim/dcim_interfaces_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,14 +76,22 @@ for the dcim interfaces list operation typically these are written to a http.Req */ type DcimInterfacesListParams struct { + /*Cabled*/ + Cabled *string + /*ConnectionStatus*/ + ConnectionStatus *string + /*Description*/ + Description *string /*Device*/ Device *string /*DeviceID*/ DeviceID *float64 /*Enabled*/ Enabled *string - /*FormFactor*/ - FormFactor *string + /*ID*/ + ID *string + /*Kind*/ + Kind *string /*LagID*/ LagID *string /*Limit @@ -96,8 +103,10 @@ type DcimInterfacesListParams struct { MacAddress *string /*MgmtOnly*/ MgmtOnly *string + /*Mode*/ + Mode *string /*Mtu*/ - Mtu *float64 + Mtu *string /*Name*/ Name *string /*Offset @@ -105,8 +114,16 @@ type DcimInterfacesListParams struct { */ Offset *int64 + /*Q*/ + Q *string + /*Tag*/ + Tag *string /*Type*/ Type *string + /*Vlan*/ + Vlan *string + /*VlanID*/ + VlanID *string timeout time.Duration Context context.Context @@ -146,6 +163,39 @@ func (o *DcimInterfacesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithCabled adds the cabled to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithCabled(cabled *string) *DcimInterfacesListParams { + o.SetCabled(cabled) + return o +} + +// SetCabled adds the cabled to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetCabled(cabled *string) { + o.Cabled = cabled +} + +// WithConnectionStatus adds the connectionStatus to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithConnectionStatus(connectionStatus *string) *DcimInterfacesListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDescription adds the description to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithDescription(description *string) *DcimInterfacesListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetDescription(description *string) { + o.Description = description +} + // WithDevice adds the device to the dcim interfaces list params func (o *DcimInterfacesListParams) WithDevice(device *string) *DcimInterfacesListParams { o.SetDevice(device) @@ -179,15 +229,26 @@ func (o *DcimInterfacesListParams) SetEnabled(enabled *string) { o.Enabled = enabled } -// WithFormFactor adds the formFactor to the dcim interfaces list params -func (o *DcimInterfacesListParams) WithFormFactor(formFactor *string) *DcimInterfacesListParams { - o.SetFormFactor(formFactor) +// WithID adds the id to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithID(id *string) *DcimInterfacesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetID(id *string) { + o.ID = id +} + +// WithKind adds the kind to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithKind(kind *string) *DcimInterfacesListParams { + o.SetKind(kind) return o } -// SetFormFactor adds the formFactor to the dcim interfaces list params -func (o *DcimInterfacesListParams) SetFormFactor(formFactor *string) { - o.FormFactor = formFactor +// SetKind adds the kind to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetKind(kind *string) { + o.Kind = kind } // WithLagID adds the lagID to the dcim interfaces list params @@ -234,14 +295,25 @@ func (o *DcimInterfacesListParams) SetMgmtOnly(mgmtOnly *string) { o.MgmtOnly = mgmtOnly } +// WithMode adds the mode to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithMode(mode *string) *DcimInterfacesListParams { + o.SetMode(mode) + return o +} + +// SetMode adds the mode to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetMode(mode *string) { + o.Mode = mode +} + // WithMtu adds the mtu to the dcim interfaces list params -func (o *DcimInterfacesListParams) WithMtu(mtu *float64) *DcimInterfacesListParams { +func (o *DcimInterfacesListParams) WithMtu(mtu *string) *DcimInterfacesListParams { o.SetMtu(mtu) return o } // SetMtu adds the mtu to the dcim interfaces list params -func (o *DcimInterfacesListParams) SetMtu(mtu *float64) { +func (o *DcimInterfacesListParams) SetMtu(mtu *string) { o.Mtu = mtu } @@ -267,6 +339,28 @@ func (o *DcimInterfacesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithQ(q *string) *DcimInterfacesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTag(tag *string) *DcimInterfacesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithType adds the typeVar to the dcim interfaces list params func (o *DcimInterfacesListParams) WithType(typeVar *string) *DcimInterfacesListParams { o.SetType(typeVar) @@ -278,6 +372,28 @@ func (o *DcimInterfacesListParams) SetType(typeVar *string) { o.Type = typeVar } +// WithVlan adds the vlan to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithVlan(vlan *string) *DcimInterfacesListParams { + o.SetVlan(vlan) + return o +} + +// SetVlan adds the vlan to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetVlan(vlan *string) { + o.Vlan = vlan +} + +// WithVlanID adds the vlanID to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithVlanID(vlanID *string) *DcimInterfacesListParams { + o.SetVlanID(vlanID) + return o +} + +// SetVlanID adds the vlanId to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetVlanID(vlanID *string) { + o.VlanID = vlanID +} + // WriteToRequest writes these params to a swagger request func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -286,6 +402,54 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.Cabled != nil { + + // query param cabled + var qrCabled string + if o.Cabled != nil { + qrCabled = *o.Cabled + } + qCabled := qrCabled + if qCabled != "" { + if err := r.SetQueryParam("cabled", qCabled); err != nil { + return err + } + } + + } + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Description != nil { + + // query param description + var qrDescription string + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + + } + if o.Device != nil { // query param device @@ -334,16 +498,32 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } - if o.FormFactor != nil { + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Kind != nil { - // query param form_factor - var qrFormFactor string - if o.FormFactor != nil { - qrFormFactor = *o.FormFactor + // query param kind + var qrKind string + if o.Kind != nil { + qrKind = *o.Kind } - qFormFactor := qrFormFactor - if qFormFactor != "" { - if err := r.SetQueryParam("form_factor", qFormFactor); err != nil { + qKind := qrKind + if qKind != "" { + if err := r.SetQueryParam("kind", qKind); err != nil { return err } } @@ -414,14 +594,30 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Mode != nil { + + // query param mode + var qrMode string + if o.Mode != nil { + qrMode = *o.Mode + } + qMode := qrMode + if qMode != "" { + if err := r.SetQueryParam("mode", qMode); err != nil { + return err + } + } + + } + if o.Mtu != nil { // query param mtu - var qrMtu float64 + var qrMtu string if o.Mtu != nil { qrMtu = *o.Mtu } - qMtu := swag.FormatFloat64(qrMtu) + qMtu := qrMtu if qMtu != "" { if err := r.SetQueryParam("mtu", qMtu); err != nil { return err @@ -462,6 +658,38 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Type != nil { // query param type @@ -478,6 +706,38 @@ func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Vlan != nil { + + // query param vlan + var qrVlan string + if o.Vlan != nil { + qrVlan = *o.Vlan + } + qVlan := qrVlan + if qVlan != "" { + if err := r.SetQueryParam("vlan", qVlan); err != nil { + return err + } + } + + } + + if o.VlanID != nil { + + // query param vlan_id + var qrVlanID string + if o.VlanID != nil { + qrVlanID = *o.VlanID + } + qVlanID := qrVlanID + if qVlanID != "" { + if err := r.SetQueryParam("vlan_id", qVlanID); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_interfaces_list_responses.go b/netbox/client/dcim/dcim_interfaces_list_responses.go index 5245ff7e63d9ae6a5765c96254cf50c1c127a7ec..9ab2c08b141b2b6e6b1a65e81d14f42a00346466 100644 --- a/netbox/client/dcim/dcim_interfaces_list_responses.go +++ b/netbox/client/dcim/dcim_interfaces_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfacesListReader is a Reader for the DcimInterfacesList structure. @@ -61,7 +65,7 @@ func NewDcimInterfacesListOK() *DcimInterfacesListOK { DcimInterfacesListOK dcim interfaces list o k */ type DcimInterfacesListOK struct { - Payload *models.DcimInterfacesListOKBody + Payload *DcimInterfacesListOKBody } func (o *DcimInterfacesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimInterfacesListOK) Error() string { func (o *DcimInterfacesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimInterfacesListOKBody) + o.Payload = new(DcimInterfacesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimInterfacesListOK) readResponse(response runtime.ClientResponse, con return nil } + +/*DcimInterfacesListOKBody dcim interfaces list o k body +swagger:model DcimInterfacesListOKBody +*/ +type DcimInterfacesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.DeviceInterface `json:"results"` +} + +// Validate validates this dcim interfaces list o k body +func (o *DcimInterfacesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimInterfacesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimInterfacesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfacesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimInterfacesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfacesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimInterfacesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimInterfacesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimInterfacesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimInterfacesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimInterfacesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimInterfacesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfacesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go b/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go index 169b7e0fbaafa225cdb8e7a9d27c682f5e779a86..840dfe5c698afeacdbbb53ad659efc5c8df06b1c 100644 --- a/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInterfacesPartialUpdateParams creates a new DcimInterfacesPartialUpdateParams object @@ -80,7 +79,7 @@ for the dcim interfaces partial update operation typically these are written to type DcimInterfacesPartialUpdateParams struct { /*Data*/ - Data *models.WritableInterface + Data *models.WritableDeviceInterface /*ID A unique integer value identifying this interface. @@ -126,13 +125,13 @@ func (o *DcimInterfacesPartialUpdateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim interfaces partial update params -func (o *DcimInterfacesPartialUpdateParams) WithData(data *models.WritableInterface) *DcimInterfacesPartialUpdateParams { +func (o *DcimInterfacesPartialUpdateParams) WithData(data *models.WritableDeviceInterface) *DcimInterfacesPartialUpdateParams { o.SetData(data) return o } // SetData adds the data to the dcim interfaces partial update params -func (o *DcimInterfacesPartialUpdateParams) SetData(data *models.WritableInterface) { +func (o *DcimInterfacesPartialUpdateParams) SetData(data *models.WritableDeviceInterface) { o.Data = data } diff --git a/netbox/client/dcim/dcim_interfaces_partial_update_responses.go b/netbox/client/dcim/dcim_interfaces_partial_update_responses.go index 1a84d55a46ad6ce28662c2f06d8de8358ed08453..904b3662fa1d3ef69e01f224b327c2f56a2b898c 100644 --- a/netbox/client/dcim/dcim_interfaces_partial_update_responses.go +++ b/netbox/client/dcim/dcim_interfaces_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfacesPartialUpdateReader is a Reader for the DcimInterfacesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimInterfacesPartialUpdateOK() *DcimInterfacesPartialUpdateOK { DcimInterfacesPartialUpdateOK dcim interfaces partial update o k */ type DcimInterfacesPartialUpdateOK struct { - Payload *models.WritableInterface + Payload *models.DeviceInterface } func (o *DcimInterfacesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInterfacesPartialUpdateOK) Error() string { func (o *DcimInterfacesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterface) + o.Payload = new(models.DeviceInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_interfaces_read_parameters.go b/netbox/client/dcim/dcim_interfaces_read_parameters.go index 82f40bae3483c4cab4588c90329d915a97daac0a..b02e1b84b92aee6a8f9f1157c743350d9f31ad78 100644 --- a/netbox/client/dcim/dcim_interfaces_read_parameters.go +++ b/netbox/client/dcim/dcim_interfaces_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_interfaces_read_responses.go b/netbox/client/dcim/dcim_interfaces_read_responses.go index 415b3b5626cb15a8ab1904c479ba5204377b8da7..b18f6be31ae7491d0f5e6152f192a4dee3fbe55f 100644 --- a/netbox/client/dcim/dcim_interfaces_read_responses.go +++ b/netbox/client/dcim/dcim_interfaces_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfacesReadReader is a Reader for the DcimInterfacesRead structure. @@ -61,7 +61,7 @@ func NewDcimInterfacesReadOK() *DcimInterfacesReadOK { DcimInterfacesReadOK dcim interfaces read o k */ type DcimInterfacesReadOK struct { - Payload *models.Interface + Payload *models.DeviceInterface } func (o *DcimInterfacesReadOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInterfacesReadOK) Error() string { func (o *DcimInterfacesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Interface) + o.Payload = new(models.DeviceInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_interfaces_trace_parameters.go b/netbox/client/dcim/dcim_interfaces_trace_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..86ca468dd3612650267353553d02c42ddf2786cd --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_trace_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimInterfacesTraceParams creates a new DcimInterfacesTraceParams object +// with the default values initialized. +func NewDcimInterfacesTraceParams() *DcimInterfacesTraceParams { + var () + return &DcimInterfacesTraceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesTraceParamsWithTimeout creates a new DcimInterfacesTraceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesTraceParamsWithTimeout(timeout time.Duration) *DcimInterfacesTraceParams { + var () + return &DcimInterfacesTraceParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesTraceParamsWithContext creates a new DcimInterfacesTraceParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesTraceParamsWithContext(ctx context.Context) *DcimInterfacesTraceParams { + var () + return &DcimInterfacesTraceParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesTraceParamsWithHTTPClient creates a new DcimInterfacesTraceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesTraceParamsWithHTTPClient(client *http.Client) *DcimInterfacesTraceParams { + var () + return &DcimInterfacesTraceParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesTraceParams contains all the parameters to send to the API endpoint +for the dcim interfaces trace operation typically these are written to a http.Request +*/ +type DcimInterfacesTraceParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces trace params +func (o *DcimInterfacesTraceParams) WithTimeout(timeout time.Duration) *DcimInterfacesTraceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces trace params +func (o *DcimInterfacesTraceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces trace params +func (o *DcimInterfacesTraceParams) WithContext(ctx context.Context) *DcimInterfacesTraceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces trace params +func (o *DcimInterfacesTraceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces trace params +func (o *DcimInterfacesTraceParams) WithHTTPClient(client *http.Client) *DcimInterfacesTraceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces trace params +func (o *DcimInterfacesTraceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interfaces trace params +func (o *DcimInterfacesTraceParams) WithID(id int64) *DcimInterfacesTraceParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces trace params +func (o *DcimInterfacesTraceParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesTraceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amip_addresses_list_responses.go b/netbox/client/dcim/dcim_interfaces_trace_responses.go similarity index 63% rename from netbox/client/ipam/ip_amip_addresses_list_responses.go rename to netbox/client/dcim/dcim_interfaces_trace_responses.go index 6d9a024a5ad7f40c6a728a7c644e4ae45fd4fc17..b73c9a89d67fd8f225512cb5ba2f747843550268 100644 --- a/netbox/client/ipam/ip_amip_addresses_list_responses.go +++ b/netbox/client/dcim/dcim_interfaces_trace_responses.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package ipam +package dcim // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// IPAMIPAddressesListReader is a Reader for the IPAMIPAddressesList structure. -type IPAMIPAddressesListReader struct { +// DcimInterfacesTraceReader is a Reader for the DcimInterfacesTrace structure. +type DcimInterfacesTraceReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IPAMIPAddressesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimInterfacesTraceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIPAMIPAddressesListOK() + result := NewDcimInterfacesTraceOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *IPAMIPAddressesListReader) ReadResponse(response runtime.ClientResponse } } -// NewIPAMIPAddressesListOK creates a IPAMIPAddressesListOK with default headers values -func NewIPAMIPAddressesListOK() *IPAMIPAddressesListOK { - return &IPAMIPAddressesListOK{} +// NewDcimInterfacesTraceOK creates a DcimInterfacesTraceOK with default headers values +func NewDcimInterfacesTraceOK() *DcimInterfacesTraceOK { + return &DcimInterfacesTraceOK{} } -/*IPAMIPAddressesListOK handles this case with default header values. +/*DcimInterfacesTraceOK handles this case with default header values. -IPAMIPAddressesListOK ipam Ip addresses list o k +DcimInterfacesTraceOK dcim interfaces trace o k */ -type IPAMIPAddressesListOK struct { - Payload *models.IPAMIPAddressesListOKBody +type DcimInterfacesTraceOK struct { + Payload *models.DeviceInterface } -func (o *IPAMIPAddressesListOK) Error() string { - return fmt.Sprintf("[GET /ipam/ip-addresses/][%d] ipamIpAddressesListOK %+v", 200, o.Payload) +func (o *DcimInterfacesTraceOK) Error() string { + return fmt.Sprintf("[GET /dcim/interfaces/{id}/trace/][%d] dcimInterfacesTraceOK %+v", 200, o.Payload) } -func (o *IPAMIPAddressesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimInterfacesTraceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.IPAMIPAddressesListOKBody) + o.Payload = new(models.DeviceInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_interfaces_update_parameters.go b/netbox/client/dcim/dcim_interfaces_update_parameters.go index 24fd20fce7c4c83cc4cad35f7d9dd88e64180187..d5a1e8896f17b430639bb30df6ab6d3d31347388 100644 --- a/netbox/client/dcim/dcim_interfaces_update_parameters.go +++ b/netbox/client/dcim/dcim_interfaces_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInterfacesUpdateParams creates a new DcimInterfacesUpdateParams object @@ -80,7 +79,7 @@ for the dcim interfaces update operation typically these are written to a http.R type DcimInterfacesUpdateParams struct { /*Data*/ - Data *models.WritableInterface + Data *models.WritableDeviceInterface /*ID A unique integer value identifying this interface. @@ -126,13 +125,13 @@ func (o *DcimInterfacesUpdateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim interfaces update params -func (o *DcimInterfacesUpdateParams) WithData(data *models.WritableInterface) *DcimInterfacesUpdateParams { +func (o *DcimInterfacesUpdateParams) WithData(data *models.WritableDeviceInterface) *DcimInterfacesUpdateParams { o.SetData(data) return o } // SetData adds the data to the dcim interfaces update params -func (o *DcimInterfacesUpdateParams) SetData(data *models.WritableInterface) { +func (o *DcimInterfacesUpdateParams) SetData(data *models.WritableDeviceInterface) { o.Data = data } diff --git a/netbox/client/dcim/dcim_interfaces_update_responses.go b/netbox/client/dcim/dcim_interfaces_update_responses.go index f96bc0a4eed72f168b52bb1e0352b72e6ec38ad1..3f7fab48ecc3b849a2ec390439969cfa1ea3db0c 100644 --- a/netbox/client/dcim/dcim_interfaces_update_responses.go +++ b/netbox/client/dcim/dcim_interfaces_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInterfacesUpdateReader is a Reader for the DcimInterfacesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimInterfacesUpdateOK() *DcimInterfacesUpdateOK { DcimInterfacesUpdateOK dcim interfaces update o k */ type DcimInterfacesUpdateOK struct { - Payload *models.WritableInterface + Payload *models.DeviceInterface } func (o *DcimInterfacesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInterfacesUpdateOK) Error() string { func (o *DcimInterfacesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterface) + o.Payload = new(models.DeviceInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_inventory_items_create_parameters.go b/netbox/client/dcim/dcim_inventory_items_create_parameters.go index 3319bf784e54df40b97f940b363131405fd70a61..fc263027e4aa747ffcc13d610e5fbd1a42d438bb 100644 --- a/netbox/client/dcim/dcim_inventory_items_create_parameters.go +++ b/netbox/client/dcim/dcim_inventory_items_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInventoryItemsCreateParams creates a new DcimInventoryItemsCreateParams object diff --git a/netbox/client/dcim/dcim_inventory_items_create_responses.go b/netbox/client/dcim/dcim_inventory_items_create_responses.go index 3dac366b18b082a3d5c48e7938fb5047b8ac7409..f5f927c795e3b8b91d902a045cfd756ee75950c7 100644 --- a/netbox/client/dcim/dcim_inventory_items_create_responses.go +++ b/netbox/client/dcim/dcim_inventory_items_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInventoryItemsCreateReader is a Reader for the DcimInventoryItemsCreate structure. @@ -61,7 +61,7 @@ func NewDcimInventoryItemsCreateCreated() *DcimInventoryItemsCreateCreated { DcimInventoryItemsCreateCreated dcim inventory items create created */ type DcimInventoryItemsCreateCreated struct { - Payload *models.WritableInventoryItem + Payload *models.InventoryItem } func (o *DcimInventoryItemsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInventoryItemsCreateCreated) Error() string { func (o *DcimInventoryItemsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInventoryItem) + o.Payload = new(models.InventoryItem) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_inventory_items_delete_parameters.go b/netbox/client/dcim/dcim_inventory_items_delete_parameters.go index 2ba49c27bd1b0df8868205d161a0341da1e616e7..56f5e92198a330bbb3a8da28287525afb17de5f9 100644 --- a/netbox/client/dcim/dcim_inventory_items_delete_parameters.go +++ b/netbox/client/dcim/dcim_inventory_items_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_inventory_items_list_parameters.go b/netbox/client/dcim/dcim_inventory_items_list_parameters.go index 2df96201e1b3e4d0a7fb783e061d5722f13fdd67..38a2d22f903887ae9081325f2f27d30dee63cd43 100644 --- a/netbox/client/dcim/dcim_inventory_items_list_parameters.go +++ b/netbox/client/dcim/dcim_inventory_items_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -85,6 +84,8 @@ type DcimInventoryItemsListParams struct { DeviceID *string /*Discovered*/ Discovered *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -109,6 +110,8 @@ type DcimInventoryItemsListParams struct { Q *string /*Serial*/ Serial *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -192,6 +195,17 @@ func (o *DcimInventoryItemsListParams) SetDiscovered(discovered *string) { o.Discovered = discovered } +// WithID adds the id to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithID(id *string) *DcimInventoryItemsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim inventory items list params func (o *DcimInventoryItemsListParams) WithLimit(limit *int64) *DcimInventoryItemsListParams { o.SetLimit(limit) @@ -291,6 +305,17 @@ func (o *DcimInventoryItemsListParams) SetSerial(serial *string) { o.Serial = serial } +// WithTag adds the tag to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithTag(tag *string) *DcimInventoryItemsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *DcimInventoryItemsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -363,6 +388,22 @@ func (o *DcimInventoryItemsListParams) WriteToRequest(r runtime.ClientRequest, r } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -507,6 +548,22 @@ func (o *DcimInventoryItemsListParams) WriteToRequest(r runtime.ClientRequest, r } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_inventory_items_list_responses.go b/netbox/client/dcim/dcim_inventory_items_list_responses.go index 0aea08a0d4cbd5a6323b843fdf20acbd7c3ef8ab..d160380f2d858f97231cfa7578c090e9e69c1b56 100644 --- a/netbox/client/dcim/dcim_inventory_items_list_responses.go +++ b/netbox/client/dcim/dcim_inventory_items_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInventoryItemsListReader is a Reader for the DcimInventoryItemsList structure. @@ -61,7 +65,7 @@ func NewDcimInventoryItemsListOK() *DcimInventoryItemsListOK { DcimInventoryItemsListOK dcim inventory items list o k */ type DcimInventoryItemsListOK struct { - Payload *models.DcimInventoryItemsListOKBody + Payload *DcimInventoryItemsListOKBody } func (o *DcimInventoryItemsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimInventoryItemsListOK) Error() string { func (o *DcimInventoryItemsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimInventoryItemsListOKBody) + o.Payload = new(DcimInventoryItemsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimInventoryItemsListOK) readResponse(response runtime.ClientResponse, return nil } + +/*DcimInventoryItemsListOKBody dcim inventory items list o k body +swagger:model DcimInventoryItemsListOKBody +*/ +type DcimInventoryItemsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.InventoryItem `json:"results"` +} + +// Validate validates this dcim inventory items list o k body +func (o *DcimInventoryItemsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimInventoryItemsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimInventoryItemsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimInventoryItemsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimInventoryItemsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimInventoryItemsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimInventoryItemsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimInventoryItemsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimInventoryItemsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimInventoryItemsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimInventoryItemsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimInventoryItemsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInventoryItemsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go b/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go index 81ab220fae109efe44f4593b8b30fbdb72186c0a..1ca8f0559822523ed5e36f9b6d4e61d1967a4d08 100644 --- a/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInventoryItemsPartialUpdateParams creates a new DcimInventoryItemsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go b/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go index 54bb7e41e8ab356c1500f8c34f029be0e3d3c92f..b8f186f0c72db0ee766dcf812ea82b4df316332b 100644 --- a/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go +++ b/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInventoryItemsPartialUpdateReader is a Reader for the DcimInventoryItemsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimInventoryItemsPartialUpdateOK() *DcimInventoryItemsPartialUpdateOK { DcimInventoryItemsPartialUpdateOK dcim inventory items partial update o k */ type DcimInventoryItemsPartialUpdateOK struct { - Payload *models.WritableInventoryItem + Payload *models.InventoryItem } func (o *DcimInventoryItemsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInventoryItemsPartialUpdateOK) Error() string { func (o *DcimInventoryItemsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInventoryItem) + o.Payload = new(models.InventoryItem) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_inventory_items_read_parameters.go b/netbox/client/dcim/dcim_inventory_items_read_parameters.go index a0161a983ba41c8910b6f640f38552046465a68b..35d41b990537c9e030cc0d100b4e32872af23e3a 100644 --- a/netbox/client/dcim/dcim_inventory_items_read_parameters.go +++ b/netbox/client/dcim/dcim_inventory_items_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_inventory_items_read_responses.go b/netbox/client/dcim/dcim_inventory_items_read_responses.go index 4e07cce0cb47b9df5e0d62d6ff5765f8ff55243b..846c14a1d7471c25ec597f88340737357c12cf1f 100644 --- a/netbox/client/dcim/dcim_inventory_items_read_responses.go +++ b/netbox/client/dcim/dcim_inventory_items_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInventoryItemsReadReader is a Reader for the DcimInventoryItemsRead structure. diff --git a/netbox/client/dcim/dcim_inventory_items_update_parameters.go b/netbox/client/dcim/dcim_inventory_items_update_parameters.go index cc74879379d1477d8acd1eb0f1d3d65ee5115d8e..f0ea6c1526153d5f1934b07934957f529677ebf1 100644 --- a/netbox/client/dcim/dcim_inventory_items_update_parameters.go +++ b/netbox/client/dcim/dcim_inventory_items_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimInventoryItemsUpdateParams creates a new DcimInventoryItemsUpdateParams object diff --git a/netbox/client/dcim/dcim_inventory_items_update_responses.go b/netbox/client/dcim/dcim_inventory_items_update_responses.go index b915f00b042f7bc058e4e518c680588fb09be792..b650721b7484472db970114d4392600a2eaa6883 100644 --- a/netbox/client/dcim/dcim_inventory_items_update_responses.go +++ b/netbox/client/dcim/dcim_inventory_items_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimInventoryItemsUpdateReader is a Reader for the DcimInventoryItemsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimInventoryItemsUpdateOK() *DcimInventoryItemsUpdateOK { DcimInventoryItemsUpdateOK dcim inventory items update o k */ type DcimInventoryItemsUpdateOK struct { - Payload *models.WritableInventoryItem + Payload *models.InventoryItem } func (o *DcimInventoryItemsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimInventoryItemsUpdateOK) Error() string { func (o *DcimInventoryItemsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInventoryItem) + o.Payload = new(models.InventoryItem) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_manufacturers_create_parameters.go b/netbox/client/dcim/dcim_manufacturers_create_parameters.go index 200dc0a29d9cdfa32dad598e1eceebb2de8f570b..543fa150311aaa8fd28beabfa5ea699132133f61 100644 --- a/netbox/client/dcim/dcim_manufacturers_create_parameters.go +++ b/netbox/client/dcim/dcim_manufacturers_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimManufacturersCreateParams creates a new DcimManufacturersCreateParams object diff --git a/netbox/client/dcim/dcim_manufacturers_create_responses.go b/netbox/client/dcim/dcim_manufacturers_create_responses.go index f0afa25a85dbea5482e891956b073a79f6f21a69..ce5f7afbc1624062249ba3a871a15c945a8769d0 100644 --- a/netbox/client/dcim/dcim_manufacturers_create_responses.go +++ b/netbox/client/dcim/dcim_manufacturers_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimManufacturersCreateReader is a Reader for the DcimManufacturersCreate structure. diff --git a/netbox/client/dcim/dcim_manufacturers_delete_parameters.go b/netbox/client/dcim/dcim_manufacturers_delete_parameters.go index 01472a9786b5d4515ae8c8af5082fd00716e5c41..bcfda7f4f9f489d0f946ace38d2ebbbff71e517f 100644 --- a/netbox/client/dcim/dcim_manufacturers_delete_parameters.go +++ b/netbox/client/dcim/dcim_manufacturers_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_manufacturers_list_parameters.go b/netbox/client/dcim/dcim_manufacturers_list_parameters.go index d741f3e3f48e1227421321581a84382d2c642bfa..cdf24b2793bd4137bd3aed66f2a6e45836824d8f 100644 --- a/netbox/client/dcim/dcim_manufacturers_list_parameters.go +++ b/netbox/client/dcim/dcim_manufacturers_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the dcim manufacturers list operation typically these are written to a http. */ type DcimManufacturersListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type DcimManufacturersListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -130,6 +133,17 @@ func (o *DcimManufacturersListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithID(id *string) *DcimManufacturersListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim manufacturers list params func (o *DcimManufacturersListParams) WithLimit(limit *int64) *DcimManufacturersListParams { o.SetLimit(limit) @@ -163,6 +177,17 @@ func (o *DcimManufacturersListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithQ(q *string) *DcimManufacturersListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the dcim manufacturers list params func (o *DcimManufacturersListParams) WithSlug(slug *string) *DcimManufacturersListParams { o.SetSlug(slug) @@ -182,6 +207,22 @@ func (o *DcimManufacturersListParams) WriteToRequest(r runtime.ClientRequest, re } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -230,6 +271,22 @@ func (o *DcimManufacturersListParams) WriteToRequest(r runtime.ClientRequest, re } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/dcim/dcim_manufacturers_list_responses.go b/netbox/client/dcim/dcim_manufacturers_list_responses.go index ac2d046e6b26e6ba45aa8758de5487d2891af347..9a48b9f9cd127b201afbeacb7ab7b41a2de15db5 100644 --- a/netbox/client/dcim/dcim_manufacturers_list_responses.go +++ b/netbox/client/dcim/dcim_manufacturers_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimManufacturersListReader is a Reader for the DcimManufacturersList structure. @@ -61,7 +65,7 @@ func NewDcimManufacturersListOK() *DcimManufacturersListOK { DcimManufacturersListOK dcim manufacturers list o k */ type DcimManufacturersListOK struct { - Payload *models.DcimManufacturersListOKBody + Payload *DcimManufacturersListOKBody } func (o *DcimManufacturersListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimManufacturersListOK) Error() string { func (o *DcimManufacturersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimManufacturersListOKBody) + o.Payload = new(DcimManufacturersListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimManufacturersListOK) readResponse(response runtime.ClientResponse, return nil } + +/*DcimManufacturersListOKBody dcim manufacturers list o k body +swagger:model DcimManufacturersListOKBody +*/ +type DcimManufacturersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Manufacturer `json:"results"` +} + +// Validate validates this dcim manufacturers list o k body +func (o *DcimManufacturersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimManufacturersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimManufacturersListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimManufacturersListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimManufacturersListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimManufacturersListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimManufacturersListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimManufacturersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimManufacturersListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimManufacturersListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimManufacturersListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimManufacturersListOKBody) UnmarshalBinary(b []byte) error { + var res DcimManufacturersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go b/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go index 03d10e494be8fc501b9291f0a0add5e74a9ba425..9b03589dddc20d23d6e76ccc3d1b08feca43e69e 100644 --- a/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimManufacturersPartialUpdateParams creates a new DcimManufacturersPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go b/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go index 6e5826a59a39ce01cc6d80ab3e6f1639981b0bb3..97a3733328a49c79fc642c5837d55dd49a0ccf3b 100644 --- a/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go +++ b/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimManufacturersPartialUpdateReader is a Reader for the DcimManufacturersPartialUpdate structure. diff --git a/netbox/client/dcim/dcim_manufacturers_read_parameters.go b/netbox/client/dcim/dcim_manufacturers_read_parameters.go index 1b54dbf9247891bc3419c7d5a8d3a1981369504b..89fb83306025ce149eec6e6ae599bd28cf2c6401 100644 --- a/netbox/client/dcim/dcim_manufacturers_read_parameters.go +++ b/netbox/client/dcim/dcim_manufacturers_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_manufacturers_read_responses.go b/netbox/client/dcim/dcim_manufacturers_read_responses.go index 14405775f1b0b3c9f6f1a49fb66aa1ecd577d5ac..fe3950561cc4974f35f93c32dedc0653d29e84e1 100644 --- a/netbox/client/dcim/dcim_manufacturers_read_responses.go +++ b/netbox/client/dcim/dcim_manufacturers_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimManufacturersReadReader is a Reader for the DcimManufacturersRead structure. diff --git a/netbox/client/dcim/dcim_manufacturers_update_parameters.go b/netbox/client/dcim/dcim_manufacturers_update_parameters.go index 2782ce7c4e44dfe4b0bc417cf0ee498d42662f77..ab136ff83d46a00e0c4f1e8ce323f740192b9b4a 100644 --- a/netbox/client/dcim/dcim_manufacturers_update_parameters.go +++ b/netbox/client/dcim/dcim_manufacturers_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimManufacturersUpdateParams creates a new DcimManufacturersUpdateParams object diff --git a/netbox/client/dcim/dcim_manufacturers_update_responses.go b/netbox/client/dcim/dcim_manufacturers_update_responses.go index 4d7da120532c6d1a4bcd304576804bad573d4919..64b2004cf7a0a0a0a709ff0d1bf110672487e795 100644 --- a/netbox/client/dcim/dcim_manufacturers_update_responses.go +++ b/netbox/client/dcim/dcim_manufacturers_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimManufacturersUpdateReader is a Reader for the DcimManufacturersUpdate structure. diff --git a/netbox/client/dcim/dcim_platforms_create_parameters.go b/netbox/client/dcim/dcim_platforms_create_parameters.go index c3036b406692475ef5e876a1674f4b2c55b8cfb1..56e7dcb4aab14798f223497729c268eb3da0f596 100644 --- a/netbox/client/dcim/dcim_platforms_create_parameters.go +++ b/netbox/client/dcim/dcim_platforms_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPlatformsCreateParams creates a new DcimPlatformsCreateParams object diff --git a/netbox/client/dcim/dcim_platforms_create_responses.go b/netbox/client/dcim/dcim_platforms_create_responses.go index 845083347cb47e726deb3e64095b66f1f4f4fee0..5de3e8fc3e42d7d188495eefd075ef9539b7d0f8 100644 --- a/netbox/client/dcim/dcim_platforms_create_responses.go +++ b/netbox/client/dcim/dcim_platforms_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPlatformsCreateReader is a Reader for the DcimPlatformsCreate structure. @@ -61,7 +61,7 @@ func NewDcimPlatformsCreateCreated() *DcimPlatformsCreateCreated { DcimPlatformsCreateCreated dcim platforms create created */ type DcimPlatformsCreateCreated struct { - Payload *models.WritablePlatform + Payload *models.Platform } func (o *DcimPlatformsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPlatformsCreateCreated) Error() string { func (o *DcimPlatformsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePlatform) + o.Payload = new(models.Platform) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_platforms_delete_parameters.go b/netbox/client/dcim/dcim_platforms_delete_parameters.go index 4807f4191edb9678d7648cab344c74d76234e3d5..9174d08f021ec01bdf602137aab5c5684c2ee276 100644 --- a/netbox/client/dcim/dcim_platforms_delete_parameters.go +++ b/netbox/client/dcim/dcim_platforms_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_platforms_list_parameters.go b/netbox/client/dcim/dcim_platforms_list_parameters.go index 85b2afd4c1ab3c8add1cd34b9a053066222b4379..317606160b6458fa696dc83d9da46299c2182719 100644 --- a/netbox/client/dcim/dcim_platforms_list_parameters.go +++ b/netbox/client/dcim/dcim_platforms_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the dcim platforms list operation typically these are written to a http.Requ */ type DcimPlatformsListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -88,11 +89,15 @@ type DcimPlatformsListParams struct { ManufacturerID *string /*Name*/ Name *string + /*NapalmDriver*/ + NapalmDriver *string /*Offset The initial index from which to return the results. */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -134,6 +139,17 @@ func (o *DcimPlatformsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the dcim platforms list params +func (o *DcimPlatformsListParams) WithID(id *string) *DcimPlatformsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms list params +func (o *DcimPlatformsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim platforms list params func (o *DcimPlatformsListParams) WithLimit(limit *int64) *DcimPlatformsListParams { o.SetLimit(limit) @@ -178,6 +194,17 @@ func (o *DcimPlatformsListParams) SetName(name *string) { o.Name = name } +// WithNapalmDriver adds the napalmDriver to the dcim platforms list params +func (o *DcimPlatformsListParams) WithNapalmDriver(napalmDriver *string) *DcimPlatformsListParams { + o.SetNapalmDriver(napalmDriver) + return o +} + +// SetNapalmDriver adds the napalmDriver to the dcim platforms list params +func (o *DcimPlatformsListParams) SetNapalmDriver(napalmDriver *string) { + o.NapalmDriver = napalmDriver +} + // WithOffset adds the offset to the dcim platforms list params func (o *DcimPlatformsListParams) WithOffset(offset *int64) *DcimPlatformsListParams { o.SetOffset(offset) @@ -189,6 +216,17 @@ func (o *DcimPlatformsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim platforms list params +func (o *DcimPlatformsListParams) WithQ(q *string) *DcimPlatformsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim platforms list params +func (o *DcimPlatformsListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the dcim platforms list params func (o *DcimPlatformsListParams) WithSlug(slug *string) *DcimPlatformsListParams { o.SetSlug(slug) @@ -208,6 +246,22 @@ func (o *DcimPlatformsListParams) WriteToRequest(r runtime.ClientRequest, reg st } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -272,6 +326,22 @@ func (o *DcimPlatformsListParams) WriteToRequest(r runtime.ClientRequest, reg st } + if o.NapalmDriver != nil { + + // query param napalm_driver + var qrNapalmDriver string + if o.NapalmDriver != nil { + qrNapalmDriver = *o.NapalmDriver + } + qNapalmDriver := qrNapalmDriver + if qNapalmDriver != "" { + if err := r.SetQueryParam("napalm_driver", qNapalmDriver); err != nil { + return err + } + } + + } + if o.Offset != nil { // query param offset @@ -288,6 +358,22 @@ func (o *DcimPlatformsListParams) WriteToRequest(r runtime.ClientRequest, reg st } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/dcim/dcim_platforms_list_responses.go b/netbox/client/dcim/dcim_platforms_list_responses.go index a1613b8f6e72be466737fbd39e2f14d93b7c30e4..ba314750204d7169258263194f61374e8203d35e 100644 --- a/netbox/client/dcim/dcim_platforms_list_responses.go +++ b/netbox/client/dcim/dcim_platforms_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPlatformsListReader is a Reader for the DcimPlatformsList structure. @@ -61,7 +65,7 @@ func NewDcimPlatformsListOK() *DcimPlatformsListOK { DcimPlatformsListOK dcim platforms list o k */ type DcimPlatformsListOK struct { - Payload *models.DcimPlatformsListOKBody + Payload *DcimPlatformsListOKBody } func (o *DcimPlatformsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimPlatformsListOK) Error() string { func (o *DcimPlatformsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimPlatformsListOKBody) + o.Payload = new(DcimPlatformsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimPlatformsListOK) readResponse(response runtime.ClientResponse, cons return nil } + +/*DcimPlatformsListOKBody dcim platforms list o k body +swagger:model DcimPlatformsListOKBody +*/ +type DcimPlatformsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Platform `json:"results"` +} + +// Validate validates this dcim platforms list o k body +func (o *DcimPlatformsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimPlatformsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimPlatformsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimPlatformsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimPlatformsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPlatformsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimPlatformsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPlatformsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimPlatformsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimPlatformsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimPlatformsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimPlatformsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPlatformsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_platforms_partial_update_parameters.go b/netbox/client/dcim/dcim_platforms_partial_update_parameters.go index 38d50da402c2ca74ad611f2183d4d50af01d85a3..b71d4ce49d2d5cc35773489d9f16467f300f786c 100644 --- a/netbox/client/dcim/dcim_platforms_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_platforms_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPlatformsPartialUpdateParams creates a new DcimPlatformsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_platforms_partial_update_responses.go b/netbox/client/dcim/dcim_platforms_partial_update_responses.go index aad00710f17d78980ae673b9b1fa6e3479980384..38c9eb8c58a6027b763240d47ba92ccf822e83c1 100644 --- a/netbox/client/dcim/dcim_platforms_partial_update_responses.go +++ b/netbox/client/dcim/dcim_platforms_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPlatformsPartialUpdateReader is a Reader for the DcimPlatformsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPlatformsPartialUpdateOK() *DcimPlatformsPartialUpdateOK { DcimPlatformsPartialUpdateOK dcim platforms partial update o k */ type DcimPlatformsPartialUpdateOK struct { - Payload *models.WritablePlatform + Payload *models.Platform } func (o *DcimPlatformsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPlatformsPartialUpdateOK) Error() string { func (o *DcimPlatformsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePlatform) + o.Payload = new(models.Platform) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_platforms_read_parameters.go b/netbox/client/dcim/dcim_platforms_read_parameters.go index dac4a65531c09416eeff01eac0739f918259a710..580c744aefe07aaff14b8aecc6f184fd4a725965 100644 --- a/netbox/client/dcim/dcim_platforms_read_parameters.go +++ b/netbox/client/dcim/dcim_platforms_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_platforms_read_responses.go b/netbox/client/dcim/dcim_platforms_read_responses.go index 67220bae8570b9296968abd42799add568db379f..987897c61743bcdc154b3d5a3553faea2ad7ba1a 100644 --- a/netbox/client/dcim/dcim_platforms_read_responses.go +++ b/netbox/client/dcim/dcim_platforms_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPlatformsReadReader is a Reader for the DcimPlatformsRead structure. diff --git a/netbox/client/dcim/dcim_platforms_update_parameters.go b/netbox/client/dcim/dcim_platforms_update_parameters.go index 08123e1378f3b7003baadef97064f8b0a8e526d1..8fac75378a5c8da46f02ab1d715e25e23914084b 100644 --- a/netbox/client/dcim/dcim_platforms_update_parameters.go +++ b/netbox/client/dcim/dcim_platforms_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPlatformsUpdateParams creates a new DcimPlatformsUpdateParams object diff --git a/netbox/client/dcim/dcim_platforms_update_responses.go b/netbox/client/dcim/dcim_platforms_update_responses.go index e6c694257e6f3e1e816d695c2ac7646c1eae904b..388697fd2e033f142e4691e2f640c8839393a252 100644 --- a/netbox/client/dcim/dcim_platforms_update_responses.go +++ b/netbox/client/dcim/dcim_platforms_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPlatformsUpdateReader is a Reader for the DcimPlatformsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPlatformsUpdateOK() *DcimPlatformsUpdateOK { DcimPlatformsUpdateOK dcim platforms update o k */ type DcimPlatformsUpdateOK struct { - Payload *models.WritablePlatform + Payload *models.Platform } func (o *DcimPlatformsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPlatformsUpdateOK) Error() string { func (o *DcimPlatformsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePlatform) + o.Payload = new(models.Platform) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_connections_list_parameters.go b/netbox/client/dcim/dcim_power_connections_list_parameters.go index 2926f1e53d0b55c1fef05b40542843c53685d5cd..951fe1bd903a4f1618af569dda3f563d918c23c4 100644 --- a/netbox/client/dcim/dcim_power_connections_list_parameters.go +++ b/netbox/client/dcim/dcim_power_connections_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_connections_list_responses.go b/netbox/client/dcim/dcim_power_connections_list_responses.go index ac4a5dc724c5d72152ec1a2686242d8a09706af8..ca93f762b99663207b6e3dc8fc654130dea53bd6 100644 --- a/netbox/client/dcim/dcim_power_connections_list_responses.go +++ b/netbox/client/dcim/dcim_power_connections_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerConnectionsListReader is a Reader for the DcimPowerConnectionsList structure. @@ -61,7 +65,7 @@ func NewDcimPowerConnectionsListOK() *DcimPowerConnectionsListOK { DcimPowerConnectionsListOK dcim power connections list o k */ type DcimPowerConnectionsListOK struct { - Payload *models.DcimPowerConnectionsListOKBody + Payload *DcimPowerConnectionsListOKBody } func (o *DcimPowerConnectionsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimPowerConnectionsListOK) Error() string { func (o *DcimPowerConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimPowerConnectionsListOKBody) + o.Payload = new(DcimPowerConnectionsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimPowerConnectionsListOK) readResponse(response runtime.ClientRespons return nil } + +/*DcimPowerConnectionsListOKBody dcim power connections list o k body +swagger:model DcimPowerConnectionsListOKBody +*/ +type DcimPowerConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.PowerPort `json:"results"` +} + +// Validate validates this dcim power connections list o k body +func (o *DcimPowerConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimPowerConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerConnectionsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerConnectionsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerConnectionsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerConnectionsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerConnectionsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerConnectionsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimPowerConnectionsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimPowerConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimPowerConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_create_parameters.go b/netbox/client/dcim/dcim_power_feeds_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0f60f969e7bf1f57b058f4d01d8546e9de6a6575 --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerFeedsCreateParams creates a new DcimPowerFeedsCreateParams object +// with the default values initialized. +func NewDcimPowerFeedsCreateParams() *DcimPowerFeedsCreateParams { + var () + return &DcimPowerFeedsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerFeedsCreateParamsWithTimeout creates a new DcimPowerFeedsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerFeedsCreateParamsWithTimeout(timeout time.Duration) *DcimPowerFeedsCreateParams { + var () + return &DcimPowerFeedsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerFeedsCreateParamsWithContext creates a new DcimPowerFeedsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerFeedsCreateParamsWithContext(ctx context.Context) *DcimPowerFeedsCreateParams { + var () + return &DcimPowerFeedsCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerFeedsCreateParamsWithHTTPClient creates a new DcimPowerFeedsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerFeedsCreateParamsWithHTTPClient(client *http.Client) *DcimPowerFeedsCreateParams { + var () + return &DcimPowerFeedsCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerFeedsCreateParams contains all the parameters to send to the API endpoint +for the dcim power feeds create operation typically these are written to a http.Request +*/ +type DcimPowerFeedsCreateParams struct { + + /*Data*/ + Data *models.WritablePowerFeed + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power feeds create params +func (o *DcimPowerFeedsCreateParams) WithTimeout(timeout time.Duration) *DcimPowerFeedsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power feeds create params +func (o *DcimPowerFeedsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power feeds create params +func (o *DcimPowerFeedsCreateParams) WithContext(ctx context.Context) *DcimPowerFeedsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power feeds create params +func (o *DcimPowerFeedsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power feeds create params +func (o *DcimPowerFeedsCreateParams) WithHTTPClient(client *http.Client) *DcimPowerFeedsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power feeds create params +func (o *DcimPowerFeedsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power feeds create params +func (o *DcimPowerFeedsCreateParams) WithData(data *models.WritablePowerFeed) *DcimPowerFeedsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power feeds create params +func (o *DcimPowerFeedsCreateParams) SetData(data *models.WritablePowerFeed) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerFeedsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_create_responses.go b/netbox/client/dcim/dcim_power_feeds_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8a7625044c8da243556f0ae12e7ed79a0084cfa9 --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerFeedsCreateReader is a Reader for the DcimPowerFeedsCreate structure. +type DcimPowerFeedsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerFeedsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerFeedsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerFeedsCreateCreated creates a DcimPowerFeedsCreateCreated with default headers values +func NewDcimPowerFeedsCreateCreated() *DcimPowerFeedsCreateCreated { + return &DcimPowerFeedsCreateCreated{} +} + +/*DcimPowerFeedsCreateCreated handles this case with default header values. + +DcimPowerFeedsCreateCreated dcim power feeds create created +*/ +type DcimPowerFeedsCreateCreated struct { + Payload *models.PowerFeed +} + +func (o *DcimPowerFeedsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-feeds/][%d] dcimPowerFeedsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerFeedsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerFeed) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_delete_parameters.go b/netbox/client/dcim/dcim_power_feeds_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..03f22ce4c27dcd6262b70b950fe8e3fd92945bf6 --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerFeedsDeleteParams creates a new DcimPowerFeedsDeleteParams object +// with the default values initialized. +func NewDcimPowerFeedsDeleteParams() *DcimPowerFeedsDeleteParams { + var () + return &DcimPowerFeedsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerFeedsDeleteParamsWithTimeout creates a new DcimPowerFeedsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerFeedsDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerFeedsDeleteParams { + var () + return &DcimPowerFeedsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerFeedsDeleteParamsWithContext creates a new DcimPowerFeedsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerFeedsDeleteParamsWithContext(ctx context.Context) *DcimPowerFeedsDeleteParams { + var () + return &DcimPowerFeedsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerFeedsDeleteParamsWithHTTPClient creates a new DcimPowerFeedsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerFeedsDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerFeedsDeleteParams { + var () + return &DcimPowerFeedsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerFeedsDeleteParams contains all the parameters to send to the API endpoint +for the dcim power feeds delete operation typically these are written to a http.Request +*/ +type DcimPowerFeedsDeleteParams struct { + + /*ID + A unique integer value identifying this power feed. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power feeds delete params +func (o *DcimPowerFeedsDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerFeedsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power feeds delete params +func (o *DcimPowerFeedsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power feeds delete params +func (o *DcimPowerFeedsDeleteParams) WithContext(ctx context.Context) *DcimPowerFeedsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power feeds delete params +func (o *DcimPowerFeedsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power feeds delete params +func (o *DcimPowerFeedsDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerFeedsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power feeds delete params +func (o *DcimPowerFeedsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power feeds delete params +func (o *DcimPowerFeedsDeleteParams) WithID(id int64) *DcimPowerFeedsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power feeds delete params +func (o *DcimPowerFeedsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerFeedsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_delete_responses.go b/netbox/client/dcim/dcim_power_feeds_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cb5e1cb8fa6f79fdbd158bff7b14b0c650b84037 --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimPowerFeedsDeleteReader is a Reader for the DcimPowerFeedsDelete structure. +type DcimPowerFeedsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerFeedsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerFeedsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerFeedsDeleteNoContent creates a DcimPowerFeedsDeleteNoContent with default headers values +func NewDcimPowerFeedsDeleteNoContent() *DcimPowerFeedsDeleteNoContent { + return &DcimPowerFeedsDeleteNoContent{} +} + +/*DcimPowerFeedsDeleteNoContent handles this case with default header values. + +DcimPowerFeedsDeleteNoContent dcim power feeds delete no content +*/ +type DcimPowerFeedsDeleteNoContent struct { +} + +func (o *DcimPowerFeedsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-feeds/{id}/][%d] dcimPowerFeedsDeleteNoContent ", 204) +} + +func (o *DcimPowerFeedsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_list_parameters.go b/netbox/client/dcim/dcim_power_feeds_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..20099cb0364c5f328da73427a3261dc57c4b2637 --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_list_parameters.go @@ -0,0 +1,632 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerFeedsListParams creates a new DcimPowerFeedsListParams object +// with the default values initialized. +func NewDcimPowerFeedsListParams() *DcimPowerFeedsListParams { + var () + return &DcimPowerFeedsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerFeedsListParamsWithTimeout creates a new DcimPowerFeedsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerFeedsListParamsWithTimeout(timeout time.Duration) *DcimPowerFeedsListParams { + var () + return &DcimPowerFeedsListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerFeedsListParamsWithContext creates a new DcimPowerFeedsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerFeedsListParamsWithContext(ctx context.Context) *DcimPowerFeedsListParams { + var () + return &DcimPowerFeedsListParams{ + + Context: ctx, + } +} + +// NewDcimPowerFeedsListParamsWithHTTPClient creates a new DcimPowerFeedsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerFeedsListParamsWithHTTPClient(client *http.Client) *DcimPowerFeedsListParams { + var () + return &DcimPowerFeedsListParams{ + HTTPClient: client, + } +} + +/*DcimPowerFeedsListParams contains all the parameters to send to the API endpoint +for the dcim power feeds list operation typically these are written to a http.Request +*/ +type DcimPowerFeedsListParams struct { + + /*Amperage*/ + Amperage *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MaxUtilization*/ + MaxUtilization *string + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Phase*/ + Phase *string + /*PowerPanelID*/ + PowerPanelID *string + /*Q*/ + Q *string + /*RackID*/ + RackID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Supply*/ + Supply *string + /*Tag*/ + Tag *string + /*Type*/ + Type *string + /*Voltage*/ + Voltage *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithTimeout(timeout time.Duration) *DcimPowerFeedsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithContext(ctx context.Context) *DcimPowerFeedsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithHTTPClient(client *http.Client) *DcimPowerFeedsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAmperage adds the amperage to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithAmperage(amperage *string) *DcimPowerFeedsListParams { + o.SetAmperage(amperage) + return o +} + +// SetAmperage adds the amperage to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetAmperage(amperage *string) { + o.Amperage = amperage +} + +// WithIDIn adds the iDIn to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithIDIn(iDIn *string) *DcimPowerFeedsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithLimit(limit *int64) *DcimPowerFeedsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMaxUtilization adds the maxUtilization to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithMaxUtilization(maxUtilization *string) *DcimPowerFeedsListParams { + o.SetMaxUtilization(maxUtilization) + return o +} + +// SetMaxUtilization adds the maxUtilization to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetMaxUtilization(maxUtilization *string) { + o.MaxUtilization = maxUtilization +} + +// WithName adds the name to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithName(name *string) *DcimPowerFeedsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithOffset(offset *int64) *DcimPowerFeedsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPhase adds the phase to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithPhase(phase *string) *DcimPowerFeedsListParams { + o.SetPhase(phase) + return o +} + +// SetPhase adds the phase to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetPhase(phase *string) { + o.Phase = phase +} + +// WithPowerPanelID adds the powerPanelID to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithPowerPanelID(powerPanelID *string) *DcimPowerFeedsListParams { + o.SetPowerPanelID(powerPanelID) + return o +} + +// SetPowerPanelID adds the powerPanelId to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetPowerPanelID(powerPanelID *string) { + o.PowerPanelID = powerPanelID +} + +// WithQ adds the q to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithQ(q *string) *DcimPowerFeedsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRackID adds the rackID to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithRackID(rackID *string) *DcimPowerFeedsListParams { + o.SetRackID(rackID) + return o +} + +// SetRackID adds the rackId to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetRackID(rackID *string) { + o.RackID = rackID +} + +// WithSite adds the site to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithSite(site *string) *DcimPowerFeedsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithSiteID(siteID *string) *DcimPowerFeedsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithStatus(status *string) *DcimPowerFeedsListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetStatus(status *string) { + o.Status = status +} + +// WithSupply adds the supply to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithSupply(supply *string) *DcimPowerFeedsListParams { + o.SetSupply(supply) + return o +} + +// SetSupply adds the supply to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetSupply(supply *string) { + o.Supply = supply +} + +// WithTag adds the tag to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithTag(tag *string) *DcimPowerFeedsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithType adds the typeVar to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithType(typeVar *string) *DcimPowerFeedsListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithVoltage adds the voltage to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) WithVoltage(voltage *string) *DcimPowerFeedsListParams { + o.SetVoltage(voltage) + return o +} + +// SetVoltage adds the voltage to the dcim power feeds list params +func (o *DcimPowerFeedsListParams) SetVoltage(voltage *string) { + o.Voltage = voltage +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerFeedsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Amperage != nil { + + // query param amperage + var qrAmperage string + if o.Amperage != nil { + qrAmperage = *o.Amperage + } + qAmperage := qrAmperage + if qAmperage != "" { + if err := r.SetQueryParam("amperage", qAmperage); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.MaxUtilization != nil { + + // query param max_utilization + var qrMaxUtilization string + if o.MaxUtilization != nil { + qrMaxUtilization = *o.MaxUtilization + } + qMaxUtilization := qrMaxUtilization + if qMaxUtilization != "" { + if err := r.SetQueryParam("max_utilization", qMaxUtilization); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Phase != nil { + + // query param phase + var qrPhase string + if o.Phase != nil { + qrPhase = *o.Phase + } + qPhase := qrPhase + if qPhase != "" { + if err := r.SetQueryParam("phase", qPhase); err != nil { + return err + } + } + + } + + if o.PowerPanelID != nil { + + // query param power_panel_id + var qrPowerPanelID string + if o.PowerPanelID != nil { + qrPowerPanelID = *o.PowerPanelID + } + qPowerPanelID := qrPowerPanelID + if qPowerPanelID != "" { + if err := r.SetQueryParam("power_panel_id", qPowerPanelID); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.RackID != nil { + + // query param rack_id + var qrRackID string + if o.RackID != nil { + qrRackID = *o.RackID + } + qRackID := qrRackID + if qRackID != "" { + if err := r.SetQueryParam("rack_id", qRackID); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Status != nil { + + // query param status + var qrStatus string + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + + } + + if o.Supply != nil { + + // query param supply + var qrSupply string + if o.Supply != nil { + qrSupply = *o.Supply + } + qSupply := qrSupply + if qSupply != "" { + if err := r.SetQueryParam("supply", qSupply); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if o.Voltage != nil { + + // query param voltage + var qrVoltage string + if o.Voltage != nil { + qrVoltage = *o.Voltage + } + qVoltage := qrVoltage + if qVoltage != "" { + if err := r.SetQueryParam("voltage", qVoltage); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_list_responses.go b/netbox/client/dcim/dcim_power_feeds_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fe361359ad07c2432f903fb179487b423b51bbbe --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerFeedsListReader is a Reader for the DcimPowerFeedsList structure. +type DcimPowerFeedsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerFeedsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerFeedsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerFeedsListOK creates a DcimPowerFeedsListOK with default headers values +func NewDcimPowerFeedsListOK() *DcimPowerFeedsListOK { + return &DcimPowerFeedsListOK{} +} + +/*DcimPowerFeedsListOK handles this case with default header values. + +DcimPowerFeedsListOK dcim power feeds list o k +*/ +type DcimPowerFeedsListOK struct { + Payload *DcimPowerFeedsListOKBody +} + +func (o *DcimPowerFeedsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-feeds/][%d] dcimPowerFeedsListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerFeedsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(DcimPowerFeedsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*DcimPowerFeedsListOKBody dcim power feeds list o k body +swagger:model DcimPowerFeedsListOKBody +*/ +type DcimPowerFeedsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.PowerFeed `json:"results"` +} + +// Validate validates this dcim power feeds list o k body +func (o *DcimPowerFeedsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimPowerFeedsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerFeedsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerFeedsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerFeedsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerFeedsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerFeedsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerFeedsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerFeedsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimPowerFeedsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimPowerFeedsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimPowerFeedsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerFeedsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_partial_update_parameters.go b/netbox/client/dcim/dcim_power_feeds_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9156d6f4e0b86a37c083d84e9aeff723e286d1e3 --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerFeedsPartialUpdateParams creates a new DcimPowerFeedsPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerFeedsPartialUpdateParams() *DcimPowerFeedsPartialUpdateParams { + var () + return &DcimPowerFeedsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerFeedsPartialUpdateParamsWithTimeout creates a new DcimPowerFeedsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerFeedsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerFeedsPartialUpdateParams { + var () + return &DcimPowerFeedsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerFeedsPartialUpdateParamsWithContext creates a new DcimPowerFeedsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerFeedsPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerFeedsPartialUpdateParams { + var () + return &DcimPowerFeedsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerFeedsPartialUpdateParamsWithHTTPClient creates a new DcimPowerFeedsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerFeedsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerFeedsPartialUpdateParams { + var () + return &DcimPowerFeedsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerFeedsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power feeds partial update operation typically these are written to a http.Request +*/ +type DcimPowerFeedsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerFeed + /*ID + A unique integer value identifying this power feed. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerFeedsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerFeedsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerFeedsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) WithData(data *models.WritablePowerFeed) *DcimPowerFeedsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) SetData(data *models.WritablePowerFeed) { + o.Data = data +} + +// WithID adds the id to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) WithID(id int64) *DcimPowerFeedsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power feeds partial update params +func (o *DcimPowerFeedsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerFeedsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_partial_update_responses.go b/netbox/client/dcim/dcim_power_feeds_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fe1205379f6cc730a51719ed0a41a48e4a84454c --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerFeedsPartialUpdateReader is a Reader for the DcimPowerFeedsPartialUpdate structure. +type DcimPowerFeedsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerFeedsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerFeedsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerFeedsPartialUpdateOK creates a DcimPowerFeedsPartialUpdateOK with default headers values +func NewDcimPowerFeedsPartialUpdateOK() *DcimPowerFeedsPartialUpdateOK { + return &DcimPowerFeedsPartialUpdateOK{} +} + +/*DcimPowerFeedsPartialUpdateOK handles this case with default header values. + +DcimPowerFeedsPartialUpdateOK dcim power feeds partial update o k +*/ +type DcimPowerFeedsPartialUpdateOK struct { + Payload *models.PowerFeed +} + +func (o *DcimPowerFeedsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-feeds/{id}/][%d] dcimPowerFeedsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerFeedsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerFeed) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_read_parameters.go b/netbox/client/dcim/dcim_power_feeds_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2680a455c9c12838c5dbe6d18e3f93d83fcffd0e --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerFeedsReadParams creates a new DcimPowerFeedsReadParams object +// with the default values initialized. +func NewDcimPowerFeedsReadParams() *DcimPowerFeedsReadParams { + var () + return &DcimPowerFeedsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerFeedsReadParamsWithTimeout creates a new DcimPowerFeedsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerFeedsReadParamsWithTimeout(timeout time.Duration) *DcimPowerFeedsReadParams { + var () + return &DcimPowerFeedsReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerFeedsReadParamsWithContext creates a new DcimPowerFeedsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerFeedsReadParamsWithContext(ctx context.Context) *DcimPowerFeedsReadParams { + var () + return &DcimPowerFeedsReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerFeedsReadParamsWithHTTPClient creates a new DcimPowerFeedsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerFeedsReadParamsWithHTTPClient(client *http.Client) *DcimPowerFeedsReadParams { + var () + return &DcimPowerFeedsReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerFeedsReadParams contains all the parameters to send to the API endpoint +for the dcim power feeds read operation typically these are written to a http.Request +*/ +type DcimPowerFeedsReadParams struct { + + /*ID + A unique integer value identifying this power feed. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power feeds read params +func (o *DcimPowerFeedsReadParams) WithTimeout(timeout time.Duration) *DcimPowerFeedsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power feeds read params +func (o *DcimPowerFeedsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power feeds read params +func (o *DcimPowerFeedsReadParams) WithContext(ctx context.Context) *DcimPowerFeedsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power feeds read params +func (o *DcimPowerFeedsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power feeds read params +func (o *DcimPowerFeedsReadParams) WithHTTPClient(client *http.Client) *DcimPowerFeedsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power feeds read params +func (o *DcimPowerFeedsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power feeds read params +func (o *DcimPowerFeedsReadParams) WithID(id int64) *DcimPowerFeedsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power feeds read params +func (o *DcimPowerFeedsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerFeedsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_read_responses.go b/netbox/client/dcim/dcim_power_feeds_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1b52fb7716e4c03b0de19064db989999c3c94dea --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerFeedsReadReader is a Reader for the DcimPowerFeedsRead structure. +type DcimPowerFeedsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerFeedsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerFeedsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerFeedsReadOK creates a DcimPowerFeedsReadOK with default headers values +func NewDcimPowerFeedsReadOK() *DcimPowerFeedsReadOK { + return &DcimPowerFeedsReadOK{} +} + +/*DcimPowerFeedsReadOK handles this case with default header values. + +DcimPowerFeedsReadOK dcim power feeds read o k +*/ +type DcimPowerFeedsReadOK struct { + Payload *models.PowerFeed +} + +func (o *DcimPowerFeedsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-feeds/{id}/][%d] dcimPowerFeedsReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerFeedsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerFeed) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_update_parameters.go b/netbox/client/dcim/dcim_power_feeds_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..515686b2349560b8439383af1efd5a7c4db1c35a --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerFeedsUpdateParams creates a new DcimPowerFeedsUpdateParams object +// with the default values initialized. +func NewDcimPowerFeedsUpdateParams() *DcimPowerFeedsUpdateParams { + var () + return &DcimPowerFeedsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerFeedsUpdateParamsWithTimeout creates a new DcimPowerFeedsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerFeedsUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerFeedsUpdateParams { + var () + return &DcimPowerFeedsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerFeedsUpdateParamsWithContext creates a new DcimPowerFeedsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerFeedsUpdateParamsWithContext(ctx context.Context) *DcimPowerFeedsUpdateParams { + var () + return &DcimPowerFeedsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerFeedsUpdateParamsWithHTTPClient creates a new DcimPowerFeedsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerFeedsUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerFeedsUpdateParams { + var () + return &DcimPowerFeedsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerFeedsUpdateParams contains all the parameters to send to the API endpoint +for the dcim power feeds update operation typically these are written to a http.Request +*/ +type DcimPowerFeedsUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerFeed + /*ID + A unique integer value identifying this power feed. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerFeedsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) WithContext(ctx context.Context) *DcimPowerFeedsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerFeedsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) WithData(data *models.WritablePowerFeed) *DcimPowerFeedsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) SetData(data *models.WritablePowerFeed) { + o.Data = data +} + +// WithID adds the id to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) WithID(id int64) *DcimPowerFeedsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power feeds update params +func (o *DcimPowerFeedsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerFeedsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_feeds_update_responses.go b/netbox/client/dcim/dcim_power_feeds_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..376200a1f421874a79ea42df1719aa4006a3247f --- /dev/null +++ b/netbox/client/dcim/dcim_power_feeds_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerFeedsUpdateReader is a Reader for the DcimPowerFeedsUpdate structure. +type DcimPowerFeedsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerFeedsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerFeedsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerFeedsUpdateOK creates a DcimPowerFeedsUpdateOK with default headers values +func NewDcimPowerFeedsUpdateOK() *DcimPowerFeedsUpdateOK { + return &DcimPowerFeedsUpdateOK{} +} + +/*DcimPowerFeedsUpdateOK handles this case with default header values. + +DcimPowerFeedsUpdateOK dcim power feeds update o k +*/ +type DcimPowerFeedsUpdateOK struct { + Payload *models.PowerFeed +} + +func (o *DcimPowerFeedsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-feeds/{id}/][%d] dcimPowerFeedsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerFeedsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerFeed) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go index e714e22a47918a1aca744a2d91fa1cb857dd4316..195f4ae70f27709f86886f792fb539937bc0c6a8 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerOutletTemplatesCreateParams creates a new DcimPowerOutletTemplatesCreateParams object diff --git a/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go index 0dd2e5a802d445290096dde3efaee7e62452c790..aabf688614b7902730973e260cda08a24df0c488 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletTemplatesCreateReader is a Reader for the DcimPowerOutletTemplatesCreate structure. @@ -61,7 +61,7 @@ func NewDcimPowerOutletTemplatesCreateCreated() *DcimPowerOutletTemplatesCreateC DcimPowerOutletTemplatesCreateCreated dcim power outlet templates create created */ type DcimPowerOutletTemplatesCreateCreated struct { - Payload *models.WritablePowerOutletTemplate + Payload *models.PowerOutletTemplate } func (o *DcimPowerOutletTemplatesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerOutletTemplatesCreateCreated) Error() string { func (o *DcimPowerOutletTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerOutletTemplate) + o.Payload = new(models.PowerOutletTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go index e26bb3b386583124735dceff9dc77a6cd0df8f59..55e719e89c10ee5ede7818a303a8f319ce888927 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go index 860a335aa4974914e9f0e95e32edd0f81613110e..18dc4df3bf30ab97fe74cc16472485e631831a44 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -79,6 +78,10 @@ type DcimPowerOutletTemplatesListParams struct { /*DevicetypeID*/ DevicetypeID *string + /*FeedLeg*/ + FeedLeg *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -91,6 +94,8 @@ type DcimPowerOutletTemplatesListParams struct { */ Offset *int64 + /*Q*/ + Q *string timeout time.Duration Context context.Context @@ -141,6 +146,28 @@ func (o *DcimPowerOutletTemplatesListParams) SetDevicetypeID(devicetypeID *strin o.DevicetypeID = devicetypeID } +// WithFeedLeg adds the feedLeg to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithFeedLeg(feedLeg *string) *DcimPowerOutletTemplatesListParams { + o.SetFeedLeg(feedLeg) + return o +} + +// SetFeedLeg adds the feedLeg to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetFeedLeg(feedLeg *string) { + o.FeedLeg = feedLeg +} + +// WithID adds the id to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithID(id *string) *DcimPowerOutletTemplatesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim power outlet templates list params func (o *DcimPowerOutletTemplatesListParams) WithLimit(limit *int64) *DcimPowerOutletTemplatesListParams { o.SetLimit(limit) @@ -174,6 +201,17 @@ func (o *DcimPowerOutletTemplatesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithQ(q *string) *DcimPowerOutletTemplatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetQ(q *string) { + o.Q = q +} + // WriteToRequest writes these params to a swagger request func (o *DcimPowerOutletTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -198,6 +236,38 @@ func (o *DcimPowerOutletTemplatesListParams) WriteToRequest(r runtime.ClientRequ } + if o.FeedLeg != nil { + + // query param feed_leg + var qrFeedLeg string + if o.FeedLeg != nil { + qrFeedLeg = *o.FeedLeg + } + qFeedLeg := qrFeedLeg + if qFeedLeg != "" { + if err := r.SetQueryParam("feed_leg", qFeedLeg); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -246,6 +316,22 @@ func (o *DcimPowerOutletTemplatesListParams) WriteToRequest(r runtime.ClientRequ } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go index f57d14aa73c69566a61c2de69bde8eed022624fc..4982c906bce2747161578602e8a0005b17d3c5a9 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletTemplatesListReader is a Reader for the DcimPowerOutletTemplatesList structure. @@ -61,7 +65,7 @@ func NewDcimPowerOutletTemplatesListOK() *DcimPowerOutletTemplatesListOK { DcimPowerOutletTemplatesListOK dcim power outlet templates list o k */ type DcimPowerOutletTemplatesListOK struct { - Payload *models.DcimPowerOutletTemplatesListOKBody + Payload *DcimPowerOutletTemplatesListOKBody } func (o *DcimPowerOutletTemplatesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimPowerOutletTemplatesListOK) Error() string { func (o *DcimPowerOutletTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimPowerOutletTemplatesListOKBody) + o.Payload = new(DcimPowerOutletTemplatesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimPowerOutletTemplatesListOK) readResponse(response runtime.ClientRes return nil } + +/*DcimPowerOutletTemplatesListOKBody dcim power outlet templates list o k body +swagger:model DcimPowerOutletTemplatesListOKBody +*/ +type DcimPowerOutletTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.PowerOutletTemplate `json:"results"` +} + +// Validate validates this dcim power outlet templates list o k body +func (o *DcimPowerOutletTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimPowerOutletTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerOutletTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerOutletTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerOutletTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerOutletTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerOutletTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerOutletTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerOutletTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimPowerOutletTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimPowerOutletTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimPowerOutletTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerOutletTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go index 36a52c3483381863cd3daec44ba7267e4a390fbe..37e7d1ed3f1884425dc334a013259a5efcf4c639 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerOutletTemplatesPartialUpdateParams creates a new DcimPowerOutletTemplatesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go index 8d573bfb424ac0e8af755ecca4fbc66289e1ad2c..309c94cb5d993eb7a12885c8118d49fbb8a21a7f 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletTemplatesPartialUpdateReader is a Reader for the DcimPowerOutletTemplatesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPowerOutletTemplatesPartialUpdateOK() *DcimPowerOutletTemplatesParti DcimPowerOutletTemplatesPartialUpdateOK dcim power outlet templates partial update o k */ type DcimPowerOutletTemplatesPartialUpdateOK struct { - Payload *models.WritablePowerOutletTemplate + Payload *models.PowerOutletTemplate } func (o *DcimPowerOutletTemplatesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerOutletTemplatesPartialUpdateOK) Error() string { func (o *DcimPowerOutletTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerOutletTemplate) + o.Payload = new(models.PowerOutletTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go index 7290f3cddf7fb0c054366d31d095e6df761d8e73..5ea711430cd85e1699a68f5949fdf0c0ece8f7a0 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go index ce8d931496b17d4a8cdbc5cb00ac1223010841e9..ffc0460ce6d5a4a33676bd42e0db9ea9a3bc5f61 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletTemplatesReadReader is a Reader for the DcimPowerOutletTemplatesRead structure. diff --git a/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go index 54029064bf810e8cc05c93e6b4e4f5c89e5b8881..45c7330d6da79012ae19bb7ea903f76e10d2e790 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerOutletTemplatesUpdateParams creates a new DcimPowerOutletTemplatesUpdateParams object diff --git a/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go index b933d3371dcf7303d0833b61a8705a02e2dca701..36d05cd8fa2f593e7cb980c69dac6264c534a6f3 100644 --- a/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go +++ b/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletTemplatesUpdateReader is a Reader for the DcimPowerOutletTemplatesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPowerOutletTemplatesUpdateOK() *DcimPowerOutletTemplatesUpdateOK { DcimPowerOutletTemplatesUpdateOK dcim power outlet templates update o k */ type DcimPowerOutletTemplatesUpdateOK struct { - Payload *models.WritablePowerOutletTemplate + Payload *models.PowerOutletTemplate } func (o *DcimPowerOutletTemplatesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerOutletTemplatesUpdateOK) Error() string { func (o *DcimPowerOutletTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerOutletTemplate) + o.Payload = new(models.PowerOutletTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_outlets_create_parameters.go b/netbox/client/dcim/dcim_power_outlets_create_parameters.go index 177b9e295906d7a64ad2f85d915870e1484b3e4e..9dcec45b722548f6f6d066773bad5351e81e223d 100644 --- a/netbox/client/dcim/dcim_power_outlets_create_parameters.go +++ b/netbox/client/dcim/dcim_power_outlets_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerOutletsCreateParams creates a new DcimPowerOutletsCreateParams object diff --git a/netbox/client/dcim/dcim_power_outlets_create_responses.go b/netbox/client/dcim/dcim_power_outlets_create_responses.go index 972ccc204ee54e424ad897af36c0f58e555f889f..ae9e0479a5192e9d0e825c2842a1921a72ed3dd4 100644 --- a/netbox/client/dcim/dcim_power_outlets_create_responses.go +++ b/netbox/client/dcim/dcim_power_outlets_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletsCreateReader is a Reader for the DcimPowerOutletsCreate structure. @@ -61,7 +61,7 @@ func NewDcimPowerOutletsCreateCreated() *DcimPowerOutletsCreateCreated { DcimPowerOutletsCreateCreated dcim power outlets create created */ type DcimPowerOutletsCreateCreated struct { - Payload *models.WritablePowerOutlet + Payload *models.PowerOutlet } func (o *DcimPowerOutletsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerOutletsCreateCreated) Error() string { func (o *DcimPowerOutletsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerOutlet) + o.Payload = new(models.PowerOutlet) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_outlets_delete_parameters.go b/netbox/client/dcim/dcim_power_outlets_delete_parameters.go index 017807aea9be348405f5440cd5b38d83be18df4b..1ba95c820ed8fa97c8c4a1988fad5b91b7b8f5c7 100644 --- a/netbox/client/dcim/dcim_power_outlets_delete_parameters.go +++ b/netbox/client/dcim/dcim_power_outlets_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_outlets_list_parameters.go b/netbox/client/dcim/dcim_power_outlets_list_parameters.go index e83ce7db321c6e05a03d425018c14cf251a6cd70..f9dc337307711929be9b9b278cb72bbeecc73274 100644 --- a/netbox/client/dcim/dcim_power_outlets_list_parameters.go +++ b/netbox/client/dcim/dcim_power_outlets_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,10 +76,20 @@ for the dcim power outlets list operation typically these are written to a http. */ type DcimPowerOutletsListParams struct { + /*Cabled*/ + Cabled *string + /*ConnectionStatus*/ + ConnectionStatus *string + /*Description*/ + Description *string /*Device*/ Device *string /*DeviceID*/ DeviceID *string + /*FeedLeg*/ + FeedLeg *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -93,6 +102,10 @@ type DcimPowerOutletsListParams struct { */ Offset *int64 + /*Q*/ + Q *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -132,6 +145,39 @@ func (o *DcimPowerOutletsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithCabled adds the cabled to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithCabled(cabled *string) *DcimPowerOutletsListParams { + o.SetCabled(cabled) + return o +} + +// SetCabled adds the cabled to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetCabled(cabled *string) { + o.Cabled = cabled +} + +// WithConnectionStatus adds the connectionStatus to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithConnectionStatus(connectionStatus *string) *DcimPowerOutletsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDescription adds the description to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithDescription(description *string) *DcimPowerOutletsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetDescription(description *string) { + o.Description = description +} + // WithDevice adds the device to the dcim power outlets list params func (o *DcimPowerOutletsListParams) WithDevice(device *string) *DcimPowerOutletsListParams { o.SetDevice(device) @@ -154,6 +200,28 @@ func (o *DcimPowerOutletsListParams) SetDeviceID(deviceID *string) { o.DeviceID = deviceID } +// WithFeedLeg adds the feedLeg to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithFeedLeg(feedLeg *string) *DcimPowerOutletsListParams { + o.SetFeedLeg(feedLeg) + return o +} + +// SetFeedLeg adds the feedLeg to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetFeedLeg(feedLeg *string) { + o.FeedLeg = feedLeg +} + +// WithID adds the id to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithID(id *string) *DcimPowerOutletsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim power outlets list params func (o *DcimPowerOutletsListParams) WithLimit(limit *int64) *DcimPowerOutletsListParams { o.SetLimit(limit) @@ -187,6 +255,28 @@ func (o *DcimPowerOutletsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithQ(q *string) *DcimPowerOutletsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithTag(tag *string) *DcimPowerOutletsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *DcimPowerOutletsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -195,6 +285,54 @@ func (o *DcimPowerOutletsListParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + if o.Cabled != nil { + + // query param cabled + var qrCabled string + if o.Cabled != nil { + qrCabled = *o.Cabled + } + qCabled := qrCabled + if qCabled != "" { + if err := r.SetQueryParam("cabled", qCabled); err != nil { + return err + } + } + + } + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Description != nil { + + // query param description + var qrDescription string + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + + } + if o.Device != nil { // query param device @@ -227,6 +365,38 @@ func (o *DcimPowerOutletsListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.FeedLeg != nil { + + // query param feed_leg + var qrFeedLeg string + if o.FeedLeg != nil { + qrFeedLeg = *o.FeedLeg + } + qFeedLeg := qrFeedLeg + if qFeedLeg != "" { + if err := r.SetQueryParam("feed_leg", qFeedLeg); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -275,6 +445,38 @@ func (o *DcimPowerOutletsListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_power_outlets_list_responses.go b/netbox/client/dcim/dcim_power_outlets_list_responses.go index cbe524922780e2887eef003ebefd6c34f62a9aa3..15af58a5566082b63c4d42635dedd90a59d96911 100644 --- a/netbox/client/dcim/dcim_power_outlets_list_responses.go +++ b/netbox/client/dcim/dcim_power_outlets_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletsListReader is a Reader for the DcimPowerOutletsList structure. @@ -61,7 +65,7 @@ func NewDcimPowerOutletsListOK() *DcimPowerOutletsListOK { DcimPowerOutletsListOK dcim power outlets list o k */ type DcimPowerOutletsListOK struct { - Payload *models.DcimPowerOutletsListOKBody + Payload *DcimPowerOutletsListOKBody } func (o *DcimPowerOutletsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimPowerOutletsListOK) Error() string { func (o *DcimPowerOutletsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimPowerOutletsListOKBody) + o.Payload = new(DcimPowerOutletsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimPowerOutletsListOK) readResponse(response runtime.ClientResponse, c return nil } + +/*DcimPowerOutletsListOKBody dcim power outlets list o k body +swagger:model DcimPowerOutletsListOKBody +*/ +type DcimPowerOutletsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.PowerOutlet `json:"results"` +} + +// Validate validates this dcim power outlets list o k body +func (o *DcimPowerOutletsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimPowerOutletsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerOutletsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerOutletsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerOutletsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerOutletsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerOutletsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerOutletsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerOutletsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimPowerOutletsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimPowerOutletsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimPowerOutletsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerOutletsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go b/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go index 42e1924f77876a62447cd5fcc19bb65c08f218c3..ebda3b84d1394dd98404ded6516f8f90bfc122d4 100644 --- a/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerOutletsPartialUpdateParams creates a new DcimPowerOutletsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go b/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go index 0dda720d53104ca108b20db770af735d71fd457e..e6d1845c435a55368a4369e40c19d38c926381a8 100644 --- a/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go +++ b/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletsPartialUpdateReader is a Reader for the DcimPowerOutletsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPowerOutletsPartialUpdateOK() *DcimPowerOutletsPartialUpdateOK { DcimPowerOutletsPartialUpdateOK dcim power outlets partial update o k */ type DcimPowerOutletsPartialUpdateOK struct { - Payload *models.WritablePowerOutlet + Payload *models.PowerOutlet } func (o *DcimPowerOutletsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerOutletsPartialUpdateOK) Error() string { func (o *DcimPowerOutletsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerOutlet) + o.Payload = new(models.PowerOutlet) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_outlets_read_parameters.go b/netbox/client/dcim/dcim_power_outlets_read_parameters.go index bd517a55aec2c7b0a6b77a8cc3847418438e0d39..6c35e05961c015bfb5391d4f7d22917ed7d4e71a 100644 --- a/netbox/client/dcim/dcim_power_outlets_read_parameters.go +++ b/netbox/client/dcim/dcim_power_outlets_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_outlets_read_responses.go b/netbox/client/dcim/dcim_power_outlets_read_responses.go index 468ff3dcb4c174d1f305035b572bfaf6465e68cc..9684e2948c8f69f9471268625e8a81cebed69302 100644 --- a/netbox/client/dcim/dcim_power_outlets_read_responses.go +++ b/netbox/client/dcim/dcim_power_outlets_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletsReadReader is a Reader for the DcimPowerOutletsRead structure. diff --git a/netbox/client/dcim/dcim_power_outlets_trace_parameters.go b/netbox/client/dcim/dcim_power_outlets_trace_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..90d8ca44cabaa11875a3d18fa801e02726162dad --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_trace_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerOutletsTraceParams creates a new DcimPowerOutletsTraceParams object +// with the default values initialized. +func NewDcimPowerOutletsTraceParams() *DcimPowerOutletsTraceParams { + var () + return &DcimPowerOutletsTraceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsTraceParamsWithTimeout creates a new DcimPowerOutletsTraceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsTraceParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsTraceParams { + var () + return &DcimPowerOutletsTraceParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsTraceParamsWithContext creates a new DcimPowerOutletsTraceParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsTraceParamsWithContext(ctx context.Context) *DcimPowerOutletsTraceParams { + var () + return &DcimPowerOutletsTraceParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsTraceParamsWithHTTPClient creates a new DcimPowerOutletsTraceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsTraceParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsTraceParams { + var () + return &DcimPowerOutletsTraceParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsTraceParams contains all the parameters to send to the API endpoint +for the dcim power outlets trace operation typically these are written to a http.Request +*/ +type DcimPowerOutletsTraceParams struct { + + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets trace params +func (o *DcimPowerOutletsTraceParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsTraceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets trace params +func (o *DcimPowerOutletsTraceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets trace params +func (o *DcimPowerOutletsTraceParams) WithContext(ctx context.Context) *DcimPowerOutletsTraceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets trace params +func (o *DcimPowerOutletsTraceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets trace params +func (o *DcimPowerOutletsTraceParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsTraceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets trace params +func (o *DcimPowerOutletsTraceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlets trace params +func (o *DcimPowerOutletsTraceParams) WithID(id int64) *DcimPowerOutletsTraceParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets trace params +func (o *DcimPowerOutletsTraceParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsTraceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_trace_responses.go b/netbox/client/dcim/dcim_power_outlets_trace_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4375110b1fe3f4aa0dac3b88ab3a5b837f2e03a6 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_trace_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerOutletsTraceReader is a Reader for the DcimPowerOutletsTrace structure. +type DcimPowerOutletsTraceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsTraceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsTraceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerOutletsTraceOK creates a DcimPowerOutletsTraceOK with default headers values +func NewDcimPowerOutletsTraceOK() *DcimPowerOutletsTraceOK { + return &DcimPowerOutletsTraceOK{} +} + +/*DcimPowerOutletsTraceOK handles this case with default header values. + +DcimPowerOutletsTraceOK dcim power outlets trace o k +*/ +type DcimPowerOutletsTraceOK struct { + Payload *models.PowerOutlet +} + +func (o *DcimPowerOutletsTraceOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlets/{id}/trace/][%d] dcimPowerOutletsTraceOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsTraceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_update_parameters.go b/netbox/client/dcim/dcim_power_outlets_update_parameters.go index 2f0e1aad18c6d7229d6323d547a99876d89609c7..b4553c51240da96f828e18a149bcac1094f1cdf6 100644 --- a/netbox/client/dcim/dcim_power_outlets_update_parameters.go +++ b/netbox/client/dcim/dcim_power_outlets_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerOutletsUpdateParams creates a new DcimPowerOutletsUpdateParams object diff --git a/netbox/client/dcim/dcim_power_outlets_update_responses.go b/netbox/client/dcim/dcim_power_outlets_update_responses.go index 5a26117f1244476b967d750ce92b56ae35bec256..ac12d4e2dcc86c3a3f07ddbd4cfd235bf7be2309 100644 --- a/netbox/client/dcim/dcim_power_outlets_update_responses.go +++ b/netbox/client/dcim/dcim_power_outlets_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerOutletsUpdateReader is a Reader for the DcimPowerOutletsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPowerOutletsUpdateOK() *DcimPowerOutletsUpdateOK { DcimPowerOutletsUpdateOK dcim power outlets update o k */ type DcimPowerOutletsUpdateOK struct { - Payload *models.WritablePowerOutlet + Payload *models.PowerOutlet } func (o *DcimPowerOutletsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerOutletsUpdateOK) Error() string { func (o *DcimPowerOutletsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerOutlet) + o.Payload = new(models.PowerOutlet) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_panels_create_parameters.go b/netbox/client/dcim/dcim_power_panels_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..57601724d521f2c4bbed29f4b169e7862085e24e --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPanelsCreateParams creates a new DcimPowerPanelsCreateParams object +// with the default values initialized. +func NewDcimPowerPanelsCreateParams() *DcimPowerPanelsCreateParams { + var () + return &DcimPowerPanelsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPanelsCreateParamsWithTimeout creates a new DcimPowerPanelsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPanelsCreateParamsWithTimeout(timeout time.Duration) *DcimPowerPanelsCreateParams { + var () + return &DcimPowerPanelsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPanelsCreateParamsWithContext creates a new DcimPowerPanelsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPanelsCreateParamsWithContext(ctx context.Context) *DcimPowerPanelsCreateParams { + var () + return &DcimPowerPanelsCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPanelsCreateParamsWithHTTPClient creates a new DcimPowerPanelsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPanelsCreateParamsWithHTTPClient(client *http.Client) *DcimPowerPanelsCreateParams { + var () + return &DcimPowerPanelsCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPanelsCreateParams contains all the parameters to send to the API endpoint +for the dcim power panels create operation typically these are written to a http.Request +*/ +type DcimPowerPanelsCreateParams struct { + + /*Data*/ + Data *models.WritablePowerPanel + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power panels create params +func (o *DcimPowerPanelsCreateParams) WithTimeout(timeout time.Duration) *DcimPowerPanelsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power panels create params +func (o *DcimPowerPanelsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power panels create params +func (o *DcimPowerPanelsCreateParams) WithContext(ctx context.Context) *DcimPowerPanelsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power panels create params +func (o *DcimPowerPanelsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power panels create params +func (o *DcimPowerPanelsCreateParams) WithHTTPClient(client *http.Client) *DcimPowerPanelsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power panels create params +func (o *DcimPowerPanelsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power panels create params +func (o *DcimPowerPanelsCreateParams) WithData(data *models.WritablePowerPanel) *DcimPowerPanelsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power panels create params +func (o *DcimPowerPanelsCreateParams) SetData(data *models.WritablePowerPanel) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPanelsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_create_responses.go b/netbox/client/dcim/dcim_power_panels_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d2a31c94549e1c191090a5d7b9bee1da1ee77cb5 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPanelsCreateReader is a Reader for the DcimPowerPanelsCreate structure. +type DcimPowerPanelsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPanelsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerPanelsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPanelsCreateCreated creates a DcimPowerPanelsCreateCreated with default headers values +func NewDcimPowerPanelsCreateCreated() *DcimPowerPanelsCreateCreated { + return &DcimPowerPanelsCreateCreated{} +} + +/*DcimPowerPanelsCreateCreated handles this case with default header values. + +DcimPowerPanelsCreateCreated dcim power panels create created +*/ +type DcimPowerPanelsCreateCreated struct { + Payload *models.PowerPanel +} + +func (o *DcimPowerPanelsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-panels/][%d] dcimPowerPanelsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerPanelsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerPanel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_delete_parameters.go b/netbox/client/dcim/dcim_power_panels_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b70a767730cf54ce8abe87b58c573c28353feb58 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPanelsDeleteParams creates a new DcimPowerPanelsDeleteParams object +// with the default values initialized. +func NewDcimPowerPanelsDeleteParams() *DcimPowerPanelsDeleteParams { + var () + return &DcimPowerPanelsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPanelsDeleteParamsWithTimeout creates a new DcimPowerPanelsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPanelsDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerPanelsDeleteParams { + var () + return &DcimPowerPanelsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPanelsDeleteParamsWithContext creates a new DcimPowerPanelsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPanelsDeleteParamsWithContext(ctx context.Context) *DcimPowerPanelsDeleteParams { + var () + return &DcimPowerPanelsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerPanelsDeleteParamsWithHTTPClient creates a new DcimPowerPanelsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPanelsDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerPanelsDeleteParams { + var () + return &DcimPowerPanelsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerPanelsDeleteParams contains all the parameters to send to the API endpoint +for the dcim power panels delete operation typically these are written to a http.Request +*/ +type DcimPowerPanelsDeleteParams struct { + + /*ID + A unique integer value identifying this power panel. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power panels delete params +func (o *DcimPowerPanelsDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerPanelsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power panels delete params +func (o *DcimPowerPanelsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power panels delete params +func (o *DcimPowerPanelsDeleteParams) WithContext(ctx context.Context) *DcimPowerPanelsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power panels delete params +func (o *DcimPowerPanelsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power panels delete params +func (o *DcimPowerPanelsDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerPanelsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power panels delete params +func (o *DcimPowerPanelsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power panels delete params +func (o *DcimPowerPanelsDeleteParams) WithID(id int64) *DcimPowerPanelsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power panels delete params +func (o *DcimPowerPanelsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPanelsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_delete_responses.go b/netbox/client/dcim/dcim_power_panels_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e7a415f3607827179fe3b9af0100ab73e57ba224 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimPowerPanelsDeleteReader is a Reader for the DcimPowerPanelsDelete structure. +type DcimPowerPanelsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPanelsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerPanelsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPanelsDeleteNoContent creates a DcimPowerPanelsDeleteNoContent with default headers values +func NewDcimPowerPanelsDeleteNoContent() *DcimPowerPanelsDeleteNoContent { + return &DcimPowerPanelsDeleteNoContent{} +} + +/*DcimPowerPanelsDeleteNoContent handles this case with default header values. + +DcimPowerPanelsDeleteNoContent dcim power panels delete no content +*/ +type DcimPowerPanelsDeleteNoContent struct { +} + +func (o *DcimPowerPanelsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-panels/{id}/][%d] dcimPowerPanelsDeleteNoContent ", 204) +} + +func (o *DcimPowerPanelsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_list_parameters.go b/netbox/client/dcim/dcim_power_panels_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8cff74377cea258db5f79d0fd32c5d7badf386f8 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_list_parameters.go @@ -0,0 +1,371 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPanelsListParams creates a new DcimPowerPanelsListParams object +// with the default values initialized. +func NewDcimPowerPanelsListParams() *DcimPowerPanelsListParams { + var () + return &DcimPowerPanelsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPanelsListParamsWithTimeout creates a new DcimPowerPanelsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPanelsListParamsWithTimeout(timeout time.Duration) *DcimPowerPanelsListParams { + var () + return &DcimPowerPanelsListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPanelsListParamsWithContext creates a new DcimPowerPanelsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPanelsListParamsWithContext(ctx context.Context) *DcimPowerPanelsListParams { + var () + return &DcimPowerPanelsListParams{ + + Context: ctx, + } +} + +// NewDcimPowerPanelsListParamsWithHTTPClient creates a new DcimPowerPanelsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPanelsListParamsWithHTTPClient(client *http.Client) *DcimPowerPanelsListParams { + var () + return &DcimPowerPanelsListParams{ + HTTPClient: client, + } +} + +/*DcimPowerPanelsListParams contains all the parameters to send to the API endpoint +for the dcim power panels list operation typically these are written to a http.Request +*/ +type DcimPowerPanelsListParams struct { + + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*RackGroupID*/ + RackGroupID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithTimeout(timeout time.Duration) *DcimPowerPanelsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithContext(ctx context.Context) *DcimPowerPanelsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithHTTPClient(client *http.Client) *DcimPowerPanelsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIDIn adds the iDIn to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithIDIn(iDIn *string) *DcimPowerPanelsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetIDIn(iDIn *string) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithLimit(limit *int64) *DcimPowerPanelsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithName(name *string) *DcimPowerPanelsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithOffset(offset *int64) *DcimPowerPanelsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithQ(q *string) *DcimPowerPanelsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRackGroupID adds the rackGroupID to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithRackGroupID(rackGroupID *string) *DcimPowerPanelsListParams { + o.SetRackGroupID(rackGroupID) + return o +} + +// SetRackGroupID adds the rackGroupId to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetRackGroupID(rackGroupID *string) { + o.RackGroupID = rackGroupID +} + +// WithSite adds the site to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithSite(site *string) *DcimPowerPanelsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim power panels list params +func (o *DcimPowerPanelsListParams) WithSiteID(siteID *string) *DcimPowerPanelsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim power panels list params +func (o *DcimPowerPanelsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPanelsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IDIn != nil { + + // query param id__in + var qrIDIn string + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := qrIDIn + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.RackGroupID != nil { + + // query param rack_group_id + var qrRackGroupID string + if o.RackGroupID != nil { + qrRackGroupID = *o.RackGroupID + } + qRackGroupID := qrRackGroupID + if qRackGroupID != "" { + if err := r.SetQueryParam("rack_group_id", qRackGroupID); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_list_responses.go b/netbox/client/dcim/dcim_power_panels_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..de9814140dedd440478f7f2f175cbbf036df4b12 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPanelsListReader is a Reader for the DcimPowerPanelsList structure. +type DcimPowerPanelsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPanelsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPanelsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPanelsListOK creates a DcimPowerPanelsListOK with default headers values +func NewDcimPowerPanelsListOK() *DcimPowerPanelsListOK { + return &DcimPowerPanelsListOK{} +} + +/*DcimPowerPanelsListOK handles this case with default header values. + +DcimPowerPanelsListOK dcim power panels list o k +*/ +type DcimPowerPanelsListOK struct { + Payload *DcimPowerPanelsListOKBody +} + +func (o *DcimPowerPanelsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-panels/][%d] dcimPowerPanelsListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPanelsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(DcimPowerPanelsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*DcimPowerPanelsListOKBody dcim power panels list o k body +swagger:model DcimPowerPanelsListOKBody +*/ +type DcimPowerPanelsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.PowerPanel `json:"results"` +} + +// Validate validates this dcim power panels list o k body +func (o *DcimPowerPanelsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimPowerPanelsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerPanelsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPanelsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerPanelsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPanelsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerPanelsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPanelsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerPanelsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimPowerPanelsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimPowerPanelsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimPowerPanelsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerPanelsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_partial_update_parameters.go b/netbox/client/dcim/dcim_power_panels_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8199fce97cb240fa52ef70eb40fbe61ff1e5e036 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPanelsPartialUpdateParams creates a new DcimPowerPanelsPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerPanelsPartialUpdateParams() *DcimPowerPanelsPartialUpdateParams { + var () + return &DcimPowerPanelsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPanelsPartialUpdateParamsWithTimeout creates a new DcimPowerPanelsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPanelsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPanelsPartialUpdateParams { + var () + return &DcimPowerPanelsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPanelsPartialUpdateParamsWithContext creates a new DcimPowerPanelsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPanelsPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerPanelsPartialUpdateParams { + var () + return &DcimPowerPanelsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPanelsPartialUpdateParamsWithHTTPClient creates a new DcimPowerPanelsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPanelsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPanelsPartialUpdateParams { + var () + return &DcimPowerPanelsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPanelsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power panels partial update operation typically these are written to a http.Request +*/ +type DcimPowerPanelsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPanel + /*ID + A unique integer value identifying this power panel. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPanelsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerPanelsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPanelsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) WithData(data *models.WritablePowerPanel) *DcimPowerPanelsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) SetData(data *models.WritablePowerPanel) { + o.Data = data +} + +// WithID adds the id to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) WithID(id int64) *DcimPowerPanelsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power panels partial update params +func (o *DcimPowerPanelsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPanelsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_read_responses.go b/netbox/client/dcim/dcim_power_panels_partial_update_responses.go similarity index 60% rename from netbox/client/dcim/dcim_interface_connections_read_responses.go rename to netbox/client/dcim/dcim_power_panels_partial_update_responses.go index 9cf2e622d917e062fad0153095f6826466fc1592..8988b24cd030e496f11234ba6f4c98714323f722 100644 --- a/netbox/client/dcim/dcim_interface_connections_read_responses.go +++ b/netbox/client/dcim/dcim_power_panels_partial_update_responses.go @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// DcimInterfaceConnectionsReadReader is a Reader for the DcimInterfaceConnectionsRead structure. -type DcimInterfaceConnectionsReadReader struct { +// DcimPowerPanelsPartialUpdateReader is a Reader for the DcimPowerPanelsPartialUpdate structure. +type DcimPowerPanelsPartialUpdateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *DcimInterfaceConnectionsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimPowerPanelsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewDcimInterfaceConnectionsReadOK() + result := NewDcimPowerPanelsPartialUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *DcimInterfaceConnectionsReadReader) ReadResponse(response runtime.Clien } } -// NewDcimInterfaceConnectionsReadOK creates a DcimInterfaceConnectionsReadOK with default headers values -func NewDcimInterfaceConnectionsReadOK() *DcimInterfaceConnectionsReadOK { - return &DcimInterfaceConnectionsReadOK{} +// NewDcimPowerPanelsPartialUpdateOK creates a DcimPowerPanelsPartialUpdateOK with default headers values +func NewDcimPowerPanelsPartialUpdateOK() *DcimPowerPanelsPartialUpdateOK { + return &DcimPowerPanelsPartialUpdateOK{} } -/*DcimInterfaceConnectionsReadOK handles this case with default header values. +/*DcimPowerPanelsPartialUpdateOK handles this case with default header values. -DcimInterfaceConnectionsReadOK dcim interface connections read o k +DcimPowerPanelsPartialUpdateOK dcim power panels partial update o k */ -type DcimInterfaceConnectionsReadOK struct { - Payload *models.InterfaceConnection +type DcimPowerPanelsPartialUpdateOK struct { + Payload *models.PowerPanel } -func (o *DcimInterfaceConnectionsReadOK) Error() string { - return fmt.Sprintf("[GET /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsReadOK %+v", 200, o.Payload) +func (o *DcimPowerPanelsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-panels/{id}/][%d] dcimPowerPanelsPartialUpdateOK %+v", 200, o.Payload) } -func (o *DcimInterfaceConnectionsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimPowerPanelsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.InterfaceConnection) + o.Payload = new(models.PowerPanel) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_panels_read_parameters.go b/netbox/client/dcim/dcim_power_panels_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ec95e830aeb15b7ee8177d474a79e23ae4382f04 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPanelsReadParams creates a new DcimPowerPanelsReadParams object +// with the default values initialized. +func NewDcimPowerPanelsReadParams() *DcimPowerPanelsReadParams { + var () + return &DcimPowerPanelsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPanelsReadParamsWithTimeout creates a new DcimPowerPanelsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPanelsReadParamsWithTimeout(timeout time.Duration) *DcimPowerPanelsReadParams { + var () + return &DcimPowerPanelsReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPanelsReadParamsWithContext creates a new DcimPowerPanelsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPanelsReadParamsWithContext(ctx context.Context) *DcimPowerPanelsReadParams { + var () + return &DcimPowerPanelsReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerPanelsReadParamsWithHTTPClient creates a new DcimPowerPanelsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPanelsReadParamsWithHTTPClient(client *http.Client) *DcimPowerPanelsReadParams { + var () + return &DcimPowerPanelsReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerPanelsReadParams contains all the parameters to send to the API endpoint +for the dcim power panels read operation typically these are written to a http.Request +*/ +type DcimPowerPanelsReadParams struct { + + /*ID + A unique integer value identifying this power panel. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power panels read params +func (o *DcimPowerPanelsReadParams) WithTimeout(timeout time.Duration) *DcimPowerPanelsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power panels read params +func (o *DcimPowerPanelsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power panels read params +func (o *DcimPowerPanelsReadParams) WithContext(ctx context.Context) *DcimPowerPanelsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power panels read params +func (o *DcimPowerPanelsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power panels read params +func (o *DcimPowerPanelsReadParams) WithHTTPClient(client *http.Client) *DcimPowerPanelsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power panels read params +func (o *DcimPowerPanelsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power panels read params +func (o *DcimPowerPanelsReadParams) WithID(id int64) *DcimPowerPanelsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power panels read params +func (o *DcimPowerPanelsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPanelsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_read_responses.go b/netbox/client/dcim/dcim_power_panels_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fd9d8f38e330808d60984874780a708da7a141b6 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPanelsReadReader is a Reader for the DcimPowerPanelsRead structure. +type DcimPowerPanelsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPanelsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPanelsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPanelsReadOK creates a DcimPowerPanelsReadOK with default headers values +func NewDcimPowerPanelsReadOK() *DcimPowerPanelsReadOK { + return &DcimPowerPanelsReadOK{} +} + +/*DcimPowerPanelsReadOK handles this case with default header values. + +DcimPowerPanelsReadOK dcim power panels read o k +*/ +type DcimPowerPanelsReadOK struct { + Payload *models.PowerPanel +} + +func (o *DcimPowerPanelsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-panels/{id}/][%d] dcimPowerPanelsReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPanelsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerPanel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_update_parameters.go b/netbox/client/dcim/dcim_power_panels_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e7b59e40c844115716ed78033e37f242c6b6cc43 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimPowerPanelsUpdateParams creates a new DcimPowerPanelsUpdateParams object +// with the default values initialized. +func NewDcimPowerPanelsUpdateParams() *DcimPowerPanelsUpdateParams { + var () + return &DcimPowerPanelsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPanelsUpdateParamsWithTimeout creates a new DcimPowerPanelsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPanelsUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPanelsUpdateParams { + var () + return &DcimPowerPanelsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPanelsUpdateParamsWithContext creates a new DcimPowerPanelsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPanelsUpdateParamsWithContext(ctx context.Context) *DcimPowerPanelsUpdateParams { + var () + return &DcimPowerPanelsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPanelsUpdateParamsWithHTTPClient creates a new DcimPowerPanelsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPanelsUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPanelsUpdateParams { + var () + return &DcimPowerPanelsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPanelsUpdateParams contains all the parameters to send to the API endpoint +for the dcim power panels update operation typically these are written to a http.Request +*/ +type DcimPowerPanelsUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPanel + /*ID + A unique integer value identifying this power panel. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPanelsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) WithContext(ctx context.Context) *DcimPowerPanelsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPanelsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) WithData(data *models.WritablePowerPanel) *DcimPowerPanelsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) SetData(data *models.WritablePowerPanel) { + o.Data = data +} + +// WithID adds the id to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) WithID(id int64) *DcimPowerPanelsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power panels update params +func (o *DcimPowerPanelsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPanelsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_panels_update_responses.go b/netbox/client/dcim/dcim_power_panels_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..11d00da1211404fc20aebe7ca90f8efbb9c64c87 --- /dev/null +++ b/netbox/client/dcim/dcim_power_panels_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPanelsUpdateReader is a Reader for the DcimPowerPanelsUpdate structure. +type DcimPowerPanelsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPanelsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPanelsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPanelsUpdateOK creates a DcimPowerPanelsUpdateOK with default headers values +func NewDcimPowerPanelsUpdateOK() *DcimPowerPanelsUpdateOK { + return &DcimPowerPanelsUpdateOK{} +} + +/*DcimPowerPanelsUpdateOK handles this case with default header values. + +DcimPowerPanelsUpdateOK dcim power panels update o k +*/ +type DcimPowerPanelsUpdateOK struct { + Payload *models.PowerPanel +} + +func (o *DcimPowerPanelsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-panels/{id}/][%d] dcimPowerPanelsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPanelsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerPanel) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_create_parameters.go b/netbox/client/dcim/dcim_power_port_templates_create_parameters.go index fe10b218fb9cca02d7cea2c07e2dc12207f7c645..55ee45b2b91d5bb446f15bd0819224950c30885e 100644 --- a/netbox/client/dcim/dcim_power_port_templates_create_parameters.go +++ b/netbox/client/dcim/dcim_power_port_templates_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerPortTemplatesCreateParams creates a new DcimPowerPortTemplatesCreateParams object diff --git a/netbox/client/dcim/dcim_power_port_templates_create_responses.go b/netbox/client/dcim/dcim_power_port_templates_create_responses.go index 93040a27a6573ca1e73f857ff56251bdf300abd7..a680efc3ee9a1990b2c540ce0a407d9034266a76 100644 --- a/netbox/client/dcim/dcim_power_port_templates_create_responses.go +++ b/netbox/client/dcim/dcim_power_port_templates_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortTemplatesCreateReader is a Reader for the DcimPowerPortTemplatesCreate structure. @@ -61,7 +61,7 @@ func NewDcimPowerPortTemplatesCreateCreated() *DcimPowerPortTemplatesCreateCreat DcimPowerPortTemplatesCreateCreated dcim power port templates create created */ type DcimPowerPortTemplatesCreateCreated struct { - Payload *models.WritablePowerPortTemplate + Payload *models.PowerPortTemplate } func (o *DcimPowerPortTemplatesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerPortTemplatesCreateCreated) Error() string { func (o *DcimPowerPortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerPortTemplate) + o.Payload = new(models.PowerPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go b/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go index 81469b362871491c3b83d55ad6123cf4ea75933c..bb8758a6e98917857664ecfc45a808a556e0951f 100644 --- a/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go +++ b/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_port_templates_list_parameters.go b/netbox/client/dcim/dcim_power_port_templates_list_parameters.go index 0cd93cc5de6f49b05aba8de1b5ceff83906f03e8..ae74d3679b26ceca2e402420fc62b176884eadcf 100644 --- a/netbox/client/dcim/dcim_power_port_templates_list_parameters.go +++ b/netbox/client/dcim/dcim_power_port_templates_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,13 +76,19 @@ for the dcim power port templates list operation typically these are written to */ type DcimPowerPortTemplatesListParams struct { + /*AllocatedDraw*/ + AllocatedDraw *string /*DevicetypeID*/ DevicetypeID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. */ Limit *int64 + /*MaximumDraw*/ + MaximumDraw *string /*Name*/ Name *string /*Offset @@ -91,6 +96,8 @@ type DcimPowerPortTemplatesListParams struct { */ Offset *int64 + /*Q*/ + Q *string timeout time.Duration Context context.Context @@ -130,6 +137,17 @@ func (o *DcimPowerPortTemplatesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAllocatedDraw adds the allocatedDraw to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithAllocatedDraw(allocatedDraw *string) *DcimPowerPortTemplatesListParams { + o.SetAllocatedDraw(allocatedDraw) + return o +} + +// SetAllocatedDraw adds the allocatedDraw to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetAllocatedDraw(allocatedDraw *string) { + o.AllocatedDraw = allocatedDraw +} + // WithDevicetypeID adds the devicetypeID to the dcim power port templates list params func (o *DcimPowerPortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimPowerPortTemplatesListParams { o.SetDevicetypeID(devicetypeID) @@ -141,6 +159,17 @@ func (o *DcimPowerPortTemplatesListParams) SetDevicetypeID(devicetypeID *string) o.DevicetypeID = devicetypeID } +// WithID adds the id to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithID(id *string) *DcimPowerPortTemplatesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim power port templates list params func (o *DcimPowerPortTemplatesListParams) WithLimit(limit *int64) *DcimPowerPortTemplatesListParams { o.SetLimit(limit) @@ -152,6 +181,17 @@ func (o *DcimPowerPortTemplatesListParams) SetLimit(limit *int64) { o.Limit = limit } +// WithMaximumDraw adds the maximumDraw to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithMaximumDraw(maximumDraw *string) *DcimPowerPortTemplatesListParams { + o.SetMaximumDraw(maximumDraw) + return o +} + +// SetMaximumDraw adds the maximumDraw to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetMaximumDraw(maximumDraw *string) { + o.MaximumDraw = maximumDraw +} + // WithName adds the name to the dcim power port templates list params func (o *DcimPowerPortTemplatesListParams) WithName(name *string) *DcimPowerPortTemplatesListParams { o.SetName(name) @@ -174,6 +214,17 @@ func (o *DcimPowerPortTemplatesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithQ(q *string) *DcimPowerPortTemplatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetQ(q *string) { + o.Q = q +} + // WriteToRequest writes these params to a swagger request func (o *DcimPowerPortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -182,6 +233,22 @@ func (o *DcimPowerPortTemplatesListParams) WriteToRequest(r runtime.ClientReques } var res []error + if o.AllocatedDraw != nil { + + // query param allocated_draw + var qrAllocatedDraw string + if o.AllocatedDraw != nil { + qrAllocatedDraw = *o.AllocatedDraw + } + qAllocatedDraw := qrAllocatedDraw + if qAllocatedDraw != "" { + if err := r.SetQueryParam("allocated_draw", qAllocatedDraw); err != nil { + return err + } + } + + } + if o.DevicetypeID != nil { // query param devicetype_id @@ -198,6 +265,22 @@ func (o *DcimPowerPortTemplatesListParams) WriteToRequest(r runtime.ClientReques } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -214,6 +297,22 @@ func (o *DcimPowerPortTemplatesListParams) WriteToRequest(r runtime.ClientReques } + if o.MaximumDraw != nil { + + // query param maximum_draw + var qrMaximumDraw string + if o.MaximumDraw != nil { + qrMaximumDraw = *o.MaximumDraw + } + qMaximumDraw := qrMaximumDraw + if qMaximumDraw != "" { + if err := r.SetQueryParam("maximum_draw", qMaximumDraw); err != nil { + return err + } + } + + } + if o.Name != nil { // query param name @@ -246,6 +345,22 @@ func (o *DcimPowerPortTemplatesListParams) WriteToRequest(r runtime.ClientReques } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_power_port_templates_list_responses.go b/netbox/client/dcim/dcim_power_port_templates_list_responses.go index 83daf9e70ced270c33fa0cd96bf2ec2fac41c071..5669090a3938616bdf71005e5e6973cdd832fcdb 100644 --- a/netbox/client/dcim/dcim_power_port_templates_list_responses.go +++ b/netbox/client/dcim/dcim_power_port_templates_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortTemplatesListReader is a Reader for the DcimPowerPortTemplatesList structure. @@ -61,7 +65,7 @@ func NewDcimPowerPortTemplatesListOK() *DcimPowerPortTemplatesListOK { DcimPowerPortTemplatesListOK dcim power port templates list o k */ type DcimPowerPortTemplatesListOK struct { - Payload *models.DcimPowerPortTemplatesListOKBody + Payload *DcimPowerPortTemplatesListOKBody } func (o *DcimPowerPortTemplatesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimPowerPortTemplatesListOK) Error() string { func (o *DcimPowerPortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimPowerPortTemplatesListOKBody) + o.Payload = new(DcimPowerPortTemplatesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimPowerPortTemplatesListOK) readResponse(response runtime.ClientRespo return nil } + +/*DcimPowerPortTemplatesListOKBody dcim power port templates list o k body +swagger:model DcimPowerPortTemplatesListOKBody +*/ +type DcimPowerPortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.PowerPortTemplate `json:"results"` +} + +// Validate validates this dcim power port templates list o k body +func (o *DcimPowerPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimPowerPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerPortTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPortTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerPortTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPortTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerPortTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerPortTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimPowerPortTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimPowerPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimPowerPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerPortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go index a79fd7afa2c23fe711f2bdbbb1fa8496704f6cde..88567197529f811741f7efee74f44e4affcea1d2 100644 --- a/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerPortTemplatesPartialUpdateParams creates a new DcimPowerPortTemplatesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go b/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go index 9746c7e4fb410bab4453ae1a50259b9183d8a04f..e194e0cbd673b7813ba24aaaf519b76a3cb1db98 100644 --- a/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go +++ b/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortTemplatesPartialUpdateReader is a Reader for the DcimPowerPortTemplatesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPowerPortTemplatesPartialUpdateOK() *DcimPowerPortTemplatesPartialUp DcimPowerPortTemplatesPartialUpdateOK dcim power port templates partial update o k */ type DcimPowerPortTemplatesPartialUpdateOK struct { - Payload *models.WritablePowerPortTemplate + Payload *models.PowerPortTemplate } func (o *DcimPowerPortTemplatesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerPortTemplatesPartialUpdateOK) Error() string { func (o *DcimPowerPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerPortTemplate) + o.Payload = new(models.PowerPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_port_templates_read_parameters.go b/netbox/client/dcim/dcim_power_port_templates_read_parameters.go index a8dd7bb817fc68ce217a722ef534d8428c3a946b..3ffbc5c14902a115f35080f9d9a9105dd7d8a18f 100644 --- a/netbox/client/dcim/dcim_power_port_templates_read_parameters.go +++ b/netbox/client/dcim/dcim_power_port_templates_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_port_templates_read_responses.go b/netbox/client/dcim/dcim_power_port_templates_read_responses.go index 45171707e06fa0202dd96e8d67eebfd8b7f35c9b..6f3f0f82ff1c187ab7057d637b04fcb9fe7b01f9 100644 --- a/netbox/client/dcim/dcim_power_port_templates_read_responses.go +++ b/netbox/client/dcim/dcim_power_port_templates_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortTemplatesReadReader is a Reader for the DcimPowerPortTemplatesRead structure. diff --git a/netbox/client/dcim/dcim_power_port_templates_update_parameters.go b/netbox/client/dcim/dcim_power_port_templates_update_parameters.go index f1820eba8a9054340bd62ff5164892d5b9a52aac..365fede92429cfe66ef766150e3fe6e9dec8456b 100644 --- a/netbox/client/dcim/dcim_power_port_templates_update_parameters.go +++ b/netbox/client/dcim/dcim_power_port_templates_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerPortTemplatesUpdateParams creates a new DcimPowerPortTemplatesUpdateParams object diff --git a/netbox/client/dcim/dcim_power_port_templates_update_responses.go b/netbox/client/dcim/dcim_power_port_templates_update_responses.go index d19d45749d90d6bcaf02f1f365efdcc91ef93b37..c2ea97c6ae1676518799a74b6121c6a34889c81c 100644 --- a/netbox/client/dcim/dcim_power_port_templates_update_responses.go +++ b/netbox/client/dcim/dcim_power_port_templates_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortTemplatesUpdateReader is a Reader for the DcimPowerPortTemplatesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPowerPortTemplatesUpdateOK() *DcimPowerPortTemplatesUpdateOK { DcimPowerPortTemplatesUpdateOK dcim power port templates update o k */ type DcimPowerPortTemplatesUpdateOK struct { - Payload *models.WritablePowerPortTemplate + Payload *models.PowerPortTemplate } func (o *DcimPowerPortTemplatesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerPortTemplatesUpdateOK) Error() string { func (o *DcimPowerPortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerPortTemplate) + o.Payload = new(models.PowerPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_ports_create_parameters.go b/netbox/client/dcim/dcim_power_ports_create_parameters.go index da44b48b3ffbe47e1e7a5fd72b4c257d0c8bb413..ee98c17c40ef877f5834555d5f42bd66aa365c87 100644 --- a/netbox/client/dcim/dcim_power_ports_create_parameters.go +++ b/netbox/client/dcim/dcim_power_ports_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerPortsCreateParams creates a new DcimPowerPortsCreateParams object diff --git a/netbox/client/dcim/dcim_power_ports_create_responses.go b/netbox/client/dcim/dcim_power_ports_create_responses.go index fd7c4b2261ec6ebc9f2644c465be93a3b3ac41e8..f93fe5c6f7bba3899c58f93279cd03b0d59d78e9 100644 --- a/netbox/client/dcim/dcim_power_ports_create_responses.go +++ b/netbox/client/dcim/dcim_power_ports_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortsCreateReader is a Reader for the DcimPowerPortsCreate structure. @@ -61,7 +61,7 @@ func NewDcimPowerPortsCreateCreated() *DcimPowerPortsCreateCreated { DcimPowerPortsCreateCreated dcim power ports create created */ type DcimPowerPortsCreateCreated struct { - Payload *models.WritablePowerPort + Payload *models.PowerPort } func (o *DcimPowerPortsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerPortsCreateCreated) Error() string { func (o *DcimPowerPortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerPort) + o.Payload = new(models.PowerPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_ports_delete_parameters.go b/netbox/client/dcim/dcim_power_ports_delete_parameters.go index 04455a3e3f3d4f9a1a2d9eb20865c86d3cb98f1c..ceae98e25beebaf3c5691d2646ebd1f280d907b2 100644 --- a/netbox/client/dcim/dcim_power_ports_delete_parameters.go +++ b/netbox/client/dcim/dcim_power_ports_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_ports_list_parameters.go b/netbox/client/dcim/dcim_power_ports_list_parameters.go index 6db800c1f76a256bf8afa111de99a517b3357760..9cfa519938a7abd214ba8582968f941d226b599d 100644 --- a/netbox/client/dcim/dcim_power_ports_list_parameters.go +++ b/netbox/client/dcim/dcim_power_ports_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,15 +76,27 @@ for the dcim power ports list operation typically these are written to a http.Re */ type DcimPowerPortsListParams struct { + /*AllocatedDraw*/ + AllocatedDraw *string + /*Cabled*/ + Cabled *string + /*ConnectionStatus*/ + ConnectionStatus *string + /*Description*/ + Description *string /*Device*/ Device *string /*DeviceID*/ DeviceID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. */ Limit *int64 + /*MaximumDraw*/ + MaximumDraw *string /*Name*/ Name *string /*Offset @@ -93,6 +104,10 @@ type DcimPowerPortsListParams struct { */ Offset *int64 + /*Q*/ + Q *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -132,6 +147,50 @@ func (o *DcimPowerPortsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAllocatedDraw adds the allocatedDraw to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithAllocatedDraw(allocatedDraw *string) *DcimPowerPortsListParams { + o.SetAllocatedDraw(allocatedDraw) + return o +} + +// SetAllocatedDraw adds the allocatedDraw to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetAllocatedDraw(allocatedDraw *string) { + o.AllocatedDraw = allocatedDraw +} + +// WithCabled adds the cabled to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithCabled(cabled *string) *DcimPowerPortsListParams { + o.SetCabled(cabled) + return o +} + +// SetCabled adds the cabled to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetCabled(cabled *string) { + o.Cabled = cabled +} + +// WithConnectionStatus adds the connectionStatus to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithConnectionStatus(connectionStatus *string) *DcimPowerPortsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDescription adds the description to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithDescription(description *string) *DcimPowerPortsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetDescription(description *string) { + o.Description = description +} + // WithDevice adds the device to the dcim power ports list params func (o *DcimPowerPortsListParams) WithDevice(device *string) *DcimPowerPortsListParams { o.SetDevice(device) @@ -154,6 +213,17 @@ func (o *DcimPowerPortsListParams) SetDeviceID(deviceID *string) { o.DeviceID = deviceID } +// WithID adds the id to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithID(id *string) *DcimPowerPortsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim power ports list params func (o *DcimPowerPortsListParams) WithLimit(limit *int64) *DcimPowerPortsListParams { o.SetLimit(limit) @@ -165,6 +235,17 @@ func (o *DcimPowerPortsListParams) SetLimit(limit *int64) { o.Limit = limit } +// WithMaximumDraw adds the maximumDraw to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithMaximumDraw(maximumDraw *string) *DcimPowerPortsListParams { + o.SetMaximumDraw(maximumDraw) + return o +} + +// SetMaximumDraw adds the maximumDraw to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetMaximumDraw(maximumDraw *string) { + o.MaximumDraw = maximumDraw +} + // WithName adds the name to the dcim power ports list params func (o *DcimPowerPortsListParams) WithName(name *string) *DcimPowerPortsListParams { o.SetName(name) @@ -187,6 +268,28 @@ func (o *DcimPowerPortsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithQ(q *string) *DcimPowerPortsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithTag(tag *string) *DcimPowerPortsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *DcimPowerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -195,6 +298,70 @@ func (o *DcimPowerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.AllocatedDraw != nil { + + // query param allocated_draw + var qrAllocatedDraw string + if o.AllocatedDraw != nil { + qrAllocatedDraw = *o.AllocatedDraw + } + qAllocatedDraw := qrAllocatedDraw + if qAllocatedDraw != "" { + if err := r.SetQueryParam("allocated_draw", qAllocatedDraw); err != nil { + return err + } + } + + } + + if o.Cabled != nil { + + // query param cabled + var qrCabled string + if o.Cabled != nil { + qrCabled = *o.Cabled + } + qCabled := qrCabled + if qCabled != "" { + if err := r.SetQueryParam("cabled", qCabled); err != nil { + return err + } + } + + } + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Description != nil { + + // query param description + var qrDescription string + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + + } + if o.Device != nil { // query param device @@ -227,6 +394,22 @@ func (o *DcimPowerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -243,6 +426,22 @@ func (o *DcimPowerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.MaximumDraw != nil { + + // query param maximum_draw + var qrMaximumDraw string + if o.MaximumDraw != nil { + qrMaximumDraw = *o.MaximumDraw + } + qMaximumDraw := qrMaximumDraw + if qMaximumDraw != "" { + if err := r.SetQueryParam("maximum_draw", qMaximumDraw); err != nil { + return err + } + } + + } + if o.Name != nil { // query param name @@ -275,6 +474,38 @@ func (o *DcimPowerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_power_ports_list_responses.go b/netbox/client/dcim/dcim_power_ports_list_responses.go index d4ba8d41836fa43783e289f8cb5cd87b9b669be2..e4abe4e135f746f24b111f4634178722240b2e9a 100644 --- a/netbox/client/dcim/dcim_power_ports_list_responses.go +++ b/netbox/client/dcim/dcim_power_ports_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortsListReader is a Reader for the DcimPowerPortsList structure. @@ -61,7 +65,7 @@ func NewDcimPowerPortsListOK() *DcimPowerPortsListOK { DcimPowerPortsListOK dcim power ports list o k */ type DcimPowerPortsListOK struct { - Payload *models.DcimPowerPortsListOKBody + Payload *DcimPowerPortsListOKBody } func (o *DcimPowerPortsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimPowerPortsListOK) Error() string { func (o *DcimPowerPortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimPowerPortsListOKBody) + o.Payload = new(DcimPowerPortsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimPowerPortsListOK) readResponse(response runtime.ClientResponse, con return nil } + +/*DcimPowerPortsListOKBody dcim power ports list o k body +swagger:model DcimPowerPortsListOKBody +*/ +type DcimPowerPortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.PowerPort `json:"results"` +} + +// Validate validates this dcim power ports list o k body +func (o *DcimPowerPortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimPowerPortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerPortsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPortsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerPortsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPortsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimPowerPortsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimPowerPortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimPowerPortsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimPowerPortsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimPowerPortsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimPowerPortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerPortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go b/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go index 25e0a5ec331a44f530b78ac6a9dab94fc7ea6ddb..cc8421a3354ee7880190237564007bc5a422738e 100644 --- a/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerPortsPartialUpdateParams creates a new DcimPowerPortsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_power_ports_partial_update_responses.go b/netbox/client/dcim/dcim_power_ports_partial_update_responses.go index 398fea9794e226b709b3e4418245d10b3fdffc4f..28d819f9d7ee5dc14252cb6734192da998c8ed1e 100644 --- a/netbox/client/dcim/dcim_power_ports_partial_update_responses.go +++ b/netbox/client/dcim/dcim_power_ports_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortsPartialUpdateReader is a Reader for the DcimPowerPortsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPowerPortsPartialUpdateOK() *DcimPowerPortsPartialUpdateOK { DcimPowerPortsPartialUpdateOK dcim power ports partial update o k */ type DcimPowerPortsPartialUpdateOK struct { - Payload *models.WritablePowerPort + Payload *models.PowerPort } func (o *DcimPowerPortsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerPortsPartialUpdateOK) Error() string { func (o *DcimPowerPortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerPort) + o.Payload = new(models.PowerPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_power_ports_read_parameters.go b/netbox/client/dcim/dcim_power_ports_read_parameters.go index 0916143c3e8247a3e17a31d6add1bb526eee67c5..2f15594d06f41d500cd1e364b692fb33aa97b020 100644 --- a/netbox/client/dcim/dcim_power_ports_read_parameters.go +++ b/netbox/client/dcim/dcim_power_ports_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_power_ports_read_responses.go b/netbox/client/dcim/dcim_power_ports_read_responses.go index a85e47852425eebf6fe326ae3225732af0e47e4a..4fff6aa0cc9cd9c69b3d74065df5debe0721827e 100644 --- a/netbox/client/dcim/dcim_power_ports_read_responses.go +++ b/netbox/client/dcim/dcim_power_ports_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortsReadReader is a Reader for the DcimPowerPortsRead structure. diff --git a/netbox/client/dcim/dcim_power_ports_trace_parameters.go b/netbox/client/dcim/dcim_power_ports_trace_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2af675a93361cd8bfdd1acc97c6ec1d695dcf543 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_trace_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimPowerPortsTraceParams creates a new DcimPowerPortsTraceParams object +// with the default values initialized. +func NewDcimPowerPortsTraceParams() *DcimPowerPortsTraceParams { + var () + return &DcimPowerPortsTraceParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsTraceParamsWithTimeout creates a new DcimPowerPortsTraceParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsTraceParamsWithTimeout(timeout time.Duration) *DcimPowerPortsTraceParams { + var () + return &DcimPowerPortsTraceParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsTraceParamsWithContext creates a new DcimPowerPortsTraceParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsTraceParamsWithContext(ctx context.Context) *DcimPowerPortsTraceParams { + var () + return &DcimPowerPortsTraceParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsTraceParamsWithHTTPClient creates a new DcimPowerPortsTraceParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsTraceParamsWithHTTPClient(client *http.Client) *DcimPowerPortsTraceParams { + var () + return &DcimPowerPortsTraceParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsTraceParams contains all the parameters to send to the API endpoint +for the dcim power ports trace operation typically these are written to a http.Request +*/ +type DcimPowerPortsTraceParams struct { + + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports trace params +func (o *DcimPowerPortsTraceParams) WithTimeout(timeout time.Duration) *DcimPowerPortsTraceParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports trace params +func (o *DcimPowerPortsTraceParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports trace params +func (o *DcimPowerPortsTraceParams) WithContext(ctx context.Context) *DcimPowerPortsTraceParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports trace params +func (o *DcimPowerPortsTraceParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports trace params +func (o *DcimPowerPortsTraceParams) WithHTTPClient(client *http.Client) *DcimPowerPortsTraceParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports trace params +func (o *DcimPowerPortsTraceParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power ports trace params +func (o *DcimPowerPortsTraceParams) WithID(id int64) *DcimPowerPortsTraceParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports trace params +func (o *DcimPowerPortsTraceParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsTraceParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_trace_responses.go b/netbox/client/dcim/dcim_power_ports_trace_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..db37651c4c6fd43b54dfd4e307d3425fe69fb63b --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_trace_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimPowerPortsTraceReader is a Reader for the DcimPowerPortsTrace structure. +type DcimPowerPortsTraceReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsTraceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsTraceOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimPowerPortsTraceOK creates a DcimPowerPortsTraceOK with default headers values +func NewDcimPowerPortsTraceOK() *DcimPowerPortsTraceOK { + return &DcimPowerPortsTraceOK{} +} + +/*DcimPowerPortsTraceOK handles this case with default header values. + +DcimPowerPortsTraceOK dcim power ports trace o k +*/ +type DcimPowerPortsTraceOK struct { + Payload *models.PowerPort +} + +func (o *DcimPowerPortsTraceOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-ports/{id}/trace/][%d] dcimPowerPortsTraceOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsTraceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_update_parameters.go b/netbox/client/dcim/dcim_power_ports_update_parameters.go index 05299ddb34b9438f9843a0d9f5f68f6567446d39..86c3ec15d33d57079b52df0d4987fe3368cc02db 100644 --- a/netbox/client/dcim/dcim_power_ports_update_parameters.go +++ b/netbox/client/dcim/dcim_power_ports_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimPowerPortsUpdateParams creates a new DcimPowerPortsUpdateParams object diff --git a/netbox/client/dcim/dcim_power_ports_update_responses.go b/netbox/client/dcim/dcim_power_ports_update_responses.go index db4b090820dd9635099099c4177a5fe379f64ba7..b6d1971e8946ac8b3190ea5521565c4f533ca5c2 100644 --- a/netbox/client/dcim/dcim_power_ports_update_responses.go +++ b/netbox/client/dcim/dcim_power_ports_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimPowerPortsUpdateReader is a Reader for the DcimPowerPortsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimPowerPortsUpdateOK() *DcimPowerPortsUpdateOK { DcimPowerPortsUpdateOK dcim power ports update o k */ type DcimPowerPortsUpdateOK struct { - Payload *models.WritablePowerPort + Payload *models.PowerPort } func (o *DcimPowerPortsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimPowerPortsUpdateOK) Error() string { func (o *DcimPowerPortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePowerPort) + o.Payload = new(models.PowerPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rack_groups_create_parameters.go b/netbox/client/dcim/dcim_rack_groups_create_parameters.go index fe004c2dd1b11cdd94908f45383ab51ad32a45f9..494d2f644bc700ec7d25e9030924a4b6f60bbcc8 100644 --- a/netbox/client/dcim/dcim_rack_groups_create_parameters.go +++ b/netbox/client/dcim/dcim_rack_groups_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackGroupsCreateParams creates a new DcimRackGroupsCreateParams object diff --git a/netbox/client/dcim/dcim_rack_groups_create_responses.go b/netbox/client/dcim/dcim_rack_groups_create_responses.go index 651256a83e7c1c8829d8b44f062fea84c574b182..1e09e55d37b87f582efdbf45fa7b2cbeec561575 100644 --- a/netbox/client/dcim/dcim_rack_groups_create_responses.go +++ b/netbox/client/dcim/dcim_rack_groups_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackGroupsCreateReader is a Reader for the DcimRackGroupsCreate structure. @@ -61,7 +61,7 @@ func NewDcimRackGroupsCreateCreated() *DcimRackGroupsCreateCreated { DcimRackGroupsCreateCreated dcim rack groups create created */ type DcimRackGroupsCreateCreated struct { - Payload *models.WritableRackGroup + Payload *models.RackGroup } func (o *DcimRackGroupsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRackGroupsCreateCreated) Error() string { func (o *DcimRackGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRackGroup) + o.Payload = new(models.RackGroup) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rack_groups_delete_parameters.go b/netbox/client/dcim/dcim_rack_groups_delete_parameters.go index 407e8fd316d9a71f25789e882809e4aca0bc2fcd..126fe00701e0391d25096b7da35baec5df9b098b 100644 --- a/netbox/client/dcim/dcim_rack_groups_delete_parameters.go +++ b/netbox/client/dcim/dcim_rack_groups_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_rack_groups_list_parameters.go b/netbox/client/dcim/dcim_rack_groups_list_parameters.go index dedc12c9e1d3ae85433a2619470bc8b04d7d3ebb..dbea3aa6da1e67d19039eca1880e890230680629 100644 --- a/netbox/client/dcim/dcim_rack_groups_list_parameters.go +++ b/netbox/client/dcim/dcim_rack_groups_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the dcim rack groups list operation typically these are written to a http.Re */ type DcimRackGroupsListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type DcimRackGroupsListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Site*/ Site *string /*SiteID*/ @@ -134,6 +137,17 @@ func (o *DcimRackGroupsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithID(id *string) *DcimRackGroupsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim rack groups list params func (o *DcimRackGroupsListParams) WithLimit(limit *int64) *DcimRackGroupsListParams { o.SetLimit(limit) @@ -167,6 +181,17 @@ func (o *DcimRackGroupsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithQ(q *string) *DcimRackGroupsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetQ(q *string) { + o.Q = q +} + // WithSite adds the site to the dcim rack groups list params func (o *DcimRackGroupsListParams) WithSite(site *string) *DcimRackGroupsListParams { o.SetSite(site) @@ -208,6 +233,22 @@ func (o *DcimRackGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -256,6 +297,22 @@ func (o *DcimRackGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Site != nil { // query param site diff --git a/netbox/client/dcim/dcim_rack_groups_list_responses.go b/netbox/client/dcim/dcim_rack_groups_list_responses.go index 20cda214be9c4a54c326e8736d8b1d2c12991c99..c3113a9049b8ffad7d1bc0cbe83122f5a3d11e5f 100644 --- a/netbox/client/dcim/dcim_rack_groups_list_responses.go +++ b/netbox/client/dcim/dcim_rack_groups_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackGroupsListReader is a Reader for the DcimRackGroupsList structure. @@ -61,7 +65,7 @@ func NewDcimRackGroupsListOK() *DcimRackGroupsListOK { DcimRackGroupsListOK dcim rack groups list o k */ type DcimRackGroupsListOK struct { - Payload *models.DcimRackGroupsListOKBody + Payload *DcimRackGroupsListOKBody } func (o *DcimRackGroupsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimRackGroupsListOK) Error() string { func (o *DcimRackGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimRackGroupsListOKBody) + o.Payload = new(DcimRackGroupsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimRackGroupsListOK) readResponse(response runtime.ClientResponse, con return nil } + +/*DcimRackGroupsListOKBody dcim rack groups list o k body +swagger:model DcimRackGroupsListOKBody +*/ +type DcimRackGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.RackGroup `json:"results"` +} + +// Validate validates this dcim rack groups list o k body +func (o *DcimRackGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimRackGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimRackGroupsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimRackGroupsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimRackGroupsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRackGroupsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimRackGroupsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRackGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimRackGroupsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimRackGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimRackGroupsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimRackGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go b/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go index e6061df910d1d47c268d8aefd645e1069bf4672a..975962ebd8e0150853deadfb5f1ae35169e65ab4 100644 --- a/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackGroupsPartialUpdateParams creates a new DcimRackGroupsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go b/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go index bde1d46dea2a8b39b6dda651a881741969d3afd6..a359240fe891f3c5190a8ee4db9324736058ac0c 100644 --- a/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go +++ b/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackGroupsPartialUpdateReader is a Reader for the DcimRackGroupsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimRackGroupsPartialUpdateOK() *DcimRackGroupsPartialUpdateOK { DcimRackGroupsPartialUpdateOK dcim rack groups partial update o k */ type DcimRackGroupsPartialUpdateOK struct { - Payload *models.WritableRackGroup + Payload *models.RackGroup } func (o *DcimRackGroupsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRackGroupsPartialUpdateOK) Error() string { func (o *DcimRackGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRackGroup) + o.Payload = new(models.RackGroup) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rack_groups_read_parameters.go b/netbox/client/dcim/dcim_rack_groups_read_parameters.go index d38f929adcd93d833ece4ba9fec3b131770f45aa..8fdab63e5056888915cf57c89dde0f81c1fa28c7 100644 --- a/netbox/client/dcim/dcim_rack_groups_read_parameters.go +++ b/netbox/client/dcim/dcim_rack_groups_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_rack_groups_read_responses.go b/netbox/client/dcim/dcim_rack_groups_read_responses.go index 962177a5e7ae206826fde5346dbbcc8c0c083361..5d2eea3fc0c52590c1cf98d838d63253c154ac22 100644 --- a/netbox/client/dcim/dcim_rack_groups_read_responses.go +++ b/netbox/client/dcim/dcim_rack_groups_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackGroupsReadReader is a Reader for the DcimRackGroupsRead structure. diff --git a/netbox/client/dcim/dcim_rack_groups_update_parameters.go b/netbox/client/dcim/dcim_rack_groups_update_parameters.go index 153816404e12e837736b405c7034e204c965a1d4..f700e7a17f59515ea9ee1bc4feb75ce8476412a5 100644 --- a/netbox/client/dcim/dcim_rack_groups_update_parameters.go +++ b/netbox/client/dcim/dcim_rack_groups_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackGroupsUpdateParams creates a new DcimRackGroupsUpdateParams object diff --git a/netbox/client/dcim/dcim_rack_groups_update_responses.go b/netbox/client/dcim/dcim_rack_groups_update_responses.go index d43c50f7a6153591f5515779371c06c177202721..6ce147738eeebb9697709d37c1021889df954d85 100644 --- a/netbox/client/dcim/dcim_rack_groups_update_responses.go +++ b/netbox/client/dcim/dcim_rack_groups_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackGroupsUpdateReader is a Reader for the DcimRackGroupsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimRackGroupsUpdateOK() *DcimRackGroupsUpdateOK { DcimRackGroupsUpdateOK dcim rack groups update o k */ type DcimRackGroupsUpdateOK struct { - Payload *models.WritableRackGroup + Payload *models.RackGroup } func (o *DcimRackGroupsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRackGroupsUpdateOK) Error() string { func (o *DcimRackGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRackGroup) + o.Payload = new(models.RackGroup) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rack_reservations_create_parameters.go b/netbox/client/dcim/dcim_rack_reservations_create_parameters.go index c1a1ad2785ef9d1ba0af203dbc8200ee03924bbf..0a8777fdb6d4263ef6ab317ffd36d0fbe9b0e3c4 100644 --- a/netbox/client/dcim/dcim_rack_reservations_create_parameters.go +++ b/netbox/client/dcim/dcim_rack_reservations_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackReservationsCreateParams creates a new DcimRackReservationsCreateParams object diff --git a/netbox/client/dcim/dcim_rack_reservations_create_responses.go b/netbox/client/dcim/dcim_rack_reservations_create_responses.go index 002160b820f794eb581273c7f7d468c7ee42958f..85b5fd569e0b10e4594e609c19a786378b8332d6 100644 --- a/netbox/client/dcim/dcim_rack_reservations_create_responses.go +++ b/netbox/client/dcim/dcim_rack_reservations_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackReservationsCreateReader is a Reader for the DcimRackReservationsCreate structure. @@ -61,7 +61,7 @@ func NewDcimRackReservationsCreateCreated() *DcimRackReservationsCreateCreated { DcimRackReservationsCreateCreated dcim rack reservations create created */ type DcimRackReservationsCreateCreated struct { - Payload *models.WritableRackReservation + Payload *models.RackReservation } func (o *DcimRackReservationsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRackReservationsCreateCreated) Error() string { func (o *DcimRackReservationsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRackReservation) + o.Payload = new(models.RackReservation) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go b/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go index 97b77bf18151dc892011c0d03ef76a62bf98ca1b..e02c9b54c2b6e8541be94cf88d785f0d979d9e69 100644 --- a/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go +++ b/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_rack_reservations_list_parameters.go b/netbox/client/dcim/dcim_rack_reservations_list_parameters.go index bf4fd02aba75bb93a06d58a7f583a592ea9d7a5a..273f5bf9cde34de27bdcb0eb1b186048071ad532 100644 --- a/netbox/client/dcim/dcim_rack_reservations_list_parameters.go +++ b/netbox/client/dcim/dcim_rack_reservations_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -108,6 +107,10 @@ type DcimRackReservationsListParams struct { SiteID *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string /*User*/ @@ -274,6 +277,28 @@ func (o *DcimRackReservationsListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithTenantGroup(tenantGroup *string) *DcimRackReservationsListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithTenantGroupID(tenantGroupID *string) *DcimRackReservationsListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the dcim rack reservations list params func (o *DcimRackReservationsListParams) WithTenantID(tenantID *string) *DcimRackReservationsListParams { o.SetTenantID(tenantID) @@ -491,6 +516,38 @@ func (o *DcimRackReservationsListParams) WriteToRequest(r runtime.ClientRequest, } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id diff --git a/netbox/client/dcim/dcim_rack_reservations_list_responses.go b/netbox/client/dcim/dcim_rack_reservations_list_responses.go index b6f13dad5672631676cc8624edaed1b29cab1126..63134a6a8bbf74688028ed5d1acd31b33da685d7 100644 --- a/netbox/client/dcim/dcim_rack_reservations_list_responses.go +++ b/netbox/client/dcim/dcim_rack_reservations_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackReservationsListReader is a Reader for the DcimRackReservationsList structure. @@ -61,7 +65,7 @@ func NewDcimRackReservationsListOK() *DcimRackReservationsListOK { DcimRackReservationsListOK dcim rack reservations list o k */ type DcimRackReservationsListOK struct { - Payload *models.DcimRackReservationsListOKBody + Payload *DcimRackReservationsListOKBody } func (o *DcimRackReservationsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimRackReservationsListOK) Error() string { func (o *DcimRackReservationsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimRackReservationsListOKBody) + o.Payload = new(DcimRackReservationsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimRackReservationsListOK) readResponse(response runtime.ClientRespons return nil } + +/*DcimRackReservationsListOKBody dcim rack reservations list o k body +swagger:model DcimRackReservationsListOKBody +*/ +type DcimRackReservationsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.RackReservation `json:"results"` +} + +// Validate validates this dcim rack reservations list o k body +func (o *DcimRackReservationsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimRackReservationsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimRackReservationsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimRackReservationsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimRackReservationsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRackReservationsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimRackReservationsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRackReservationsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimRackReservationsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimRackReservationsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimRackReservationsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimRackReservationsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackReservationsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go b/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go index 19718dfe772eabaca822e25273a07de1d6e1285b..c1f468be90c089faa9e26165aaa9d2504cd64e5e 100644 --- a/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackReservationsPartialUpdateParams creates a new DcimRackReservationsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go b/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go index 20a059dc11a4b4b02eccb9557b4e02806b122b97..2bce4cc93f3c16e521a08df17f28eebcaff9e6ac 100644 --- a/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go +++ b/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackReservationsPartialUpdateReader is a Reader for the DcimRackReservationsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimRackReservationsPartialUpdateOK() *DcimRackReservationsPartialUpdate DcimRackReservationsPartialUpdateOK dcim rack reservations partial update o k */ type DcimRackReservationsPartialUpdateOK struct { - Payload *models.WritableRackReservation + Payload *models.RackReservation } func (o *DcimRackReservationsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRackReservationsPartialUpdateOK) Error() string { func (o *DcimRackReservationsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRackReservation) + o.Payload = new(models.RackReservation) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rack_reservations_read_parameters.go b/netbox/client/dcim/dcim_rack_reservations_read_parameters.go index c24f8dd46856680fa68445c56886160a9552bae1..4c6260a7c81a026969ead56142a04dffd1b2b35f 100644 --- a/netbox/client/dcim/dcim_rack_reservations_read_parameters.go +++ b/netbox/client/dcim/dcim_rack_reservations_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_rack_reservations_read_responses.go b/netbox/client/dcim/dcim_rack_reservations_read_responses.go index 77f0db2f869a0e2d3b4f1ce3cec3d20c4e11527e..80c1d774e0bd4350532e27b5fd11bf3267c337af 100644 --- a/netbox/client/dcim/dcim_rack_reservations_read_responses.go +++ b/netbox/client/dcim/dcim_rack_reservations_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackReservationsReadReader is a Reader for the DcimRackReservationsRead structure. diff --git a/netbox/client/dcim/dcim_rack_reservations_update_parameters.go b/netbox/client/dcim/dcim_rack_reservations_update_parameters.go index cbbf6c824223aa10410d815375e09f5a1ad2d687..af744b138557d62bebbbc2349d49de1c6e5cac1a 100644 --- a/netbox/client/dcim/dcim_rack_reservations_update_parameters.go +++ b/netbox/client/dcim/dcim_rack_reservations_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackReservationsUpdateParams creates a new DcimRackReservationsUpdateParams object diff --git a/netbox/client/dcim/dcim_rack_reservations_update_responses.go b/netbox/client/dcim/dcim_rack_reservations_update_responses.go index 2277550158529b435919194a95c98d927e2f2bc6..768bfdf23650a8bfb0efc39bf9d33501cffa3cbf 100644 --- a/netbox/client/dcim/dcim_rack_reservations_update_responses.go +++ b/netbox/client/dcim/dcim_rack_reservations_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackReservationsUpdateReader is a Reader for the DcimRackReservationsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimRackReservationsUpdateOK() *DcimRackReservationsUpdateOK { DcimRackReservationsUpdateOK dcim rack reservations update o k */ type DcimRackReservationsUpdateOK struct { - Payload *models.WritableRackReservation + Payload *models.RackReservation } func (o *DcimRackReservationsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRackReservationsUpdateOK) Error() string { func (o *DcimRackReservationsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRackReservation) + o.Payload = new(models.RackReservation) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rack_roles_create_parameters.go b/netbox/client/dcim/dcim_rack_roles_create_parameters.go index 6442cdb00630715a0fa6493f025cc4ac72e67801..fdd7332d6a4e65849a426b262938c40383c1db99 100644 --- a/netbox/client/dcim/dcim_rack_roles_create_parameters.go +++ b/netbox/client/dcim/dcim_rack_roles_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackRolesCreateParams creates a new DcimRackRolesCreateParams object diff --git a/netbox/client/dcim/dcim_rack_roles_create_responses.go b/netbox/client/dcim/dcim_rack_roles_create_responses.go index a0846885ce1c8e3fd4c673047699c52eb3d33c64..c29de0c84e4f7562beb0ab6f14c7a82589c109c5 100644 --- a/netbox/client/dcim/dcim_rack_roles_create_responses.go +++ b/netbox/client/dcim/dcim_rack_roles_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackRolesCreateReader is a Reader for the DcimRackRolesCreate structure. diff --git a/netbox/client/dcim/dcim_rack_roles_delete_parameters.go b/netbox/client/dcim/dcim_rack_roles_delete_parameters.go index cad9b0376dff881de34dd6773d65ed613ad9ab46..e6e75db538d14a34590971ac0d6aab4ccfe86484 100644 --- a/netbox/client/dcim/dcim_rack_roles_delete_parameters.go +++ b/netbox/client/dcim/dcim_rack_roles_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_rack_roles_list_parameters.go b/netbox/client/dcim/dcim_rack_roles_list_parameters.go index 60165dafb8b5116004f83b457e1d67f897e8eca7..43560e0e4ca6515c1d14067fd9a4a09d93e47266 100644 --- a/netbox/client/dcim/dcim_rack_roles_list_parameters.go +++ b/netbox/client/dcim/dcim_rack_roles_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -79,6 +78,8 @@ type DcimRackRolesListParams struct { /*Color*/ Color *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -91,6 +92,8 @@ type DcimRackRolesListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -143,6 +146,17 @@ func (o *DcimRackRolesListParams) SetColor(color *string) { o.Color = color } +// WithID adds the id to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithID(id *string) *DcimRackRolesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim rack roles list params func (o *DcimRackRolesListParams) WithLimit(limit *int64) *DcimRackRolesListParams { o.SetLimit(limit) @@ -176,6 +190,17 @@ func (o *DcimRackRolesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithQ(q *string) *DcimRackRolesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the dcim rack roles list params func (o *DcimRackRolesListParams) WithSlug(slug *string) *DcimRackRolesListParams { o.SetSlug(slug) @@ -211,6 +236,22 @@ func (o *DcimRackRolesListParams) WriteToRequest(r runtime.ClientRequest, reg st } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -259,6 +300,22 @@ func (o *DcimRackRolesListParams) WriteToRequest(r runtime.ClientRequest, reg st } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/dcim/dcim_rack_roles_list_responses.go b/netbox/client/dcim/dcim_rack_roles_list_responses.go index e11ebb3d3f8fbf0aacc467118f1f7278fb230c22..85ebd2ce22262aca51b09c7cb91ccffe46a34835 100644 --- a/netbox/client/dcim/dcim_rack_roles_list_responses.go +++ b/netbox/client/dcim/dcim_rack_roles_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackRolesListReader is a Reader for the DcimRackRolesList structure. @@ -61,7 +65,7 @@ func NewDcimRackRolesListOK() *DcimRackRolesListOK { DcimRackRolesListOK dcim rack roles list o k */ type DcimRackRolesListOK struct { - Payload *models.DcimRackRolesListOKBody + Payload *DcimRackRolesListOKBody } func (o *DcimRackRolesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimRackRolesListOK) Error() string { func (o *DcimRackRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimRackRolesListOKBody) + o.Payload = new(DcimRackRolesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimRackRolesListOK) readResponse(response runtime.ClientResponse, cons return nil } + +/*DcimRackRolesListOKBody dcim rack roles list o k body +swagger:model DcimRackRolesListOKBody +*/ +type DcimRackRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.RackRole `json:"results"` +} + +// Validate validates this dcim rack roles list o k body +func (o *DcimRackRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimRackRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimRackRolesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimRackRolesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimRackRolesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRackRolesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimRackRolesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRackRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimRackRolesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimRackRolesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimRackRolesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimRackRolesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go b/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go index 7723718713c4b732abb79fb91918983a50ed066b..ba897be04ee32c651d5c27a2a75129658b2d9d54 100644 --- a/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackRolesPartialUpdateParams creates a new DcimRackRolesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go b/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go index e18388aff6f5331471c4b89ccbc8a86f7e610b4c..96f29196a2d2d28422641e1028a904f8a8509869 100644 --- a/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go +++ b/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackRolesPartialUpdateReader is a Reader for the DcimRackRolesPartialUpdate structure. diff --git a/netbox/client/dcim/dcim_rack_roles_read_parameters.go b/netbox/client/dcim/dcim_rack_roles_read_parameters.go index 1a49f3fdc64ef8a8e672726b828b9ec1168423a4..2bf17892e873d35c939767685d951fc20aa03941 100644 --- a/netbox/client/dcim/dcim_rack_roles_read_parameters.go +++ b/netbox/client/dcim/dcim_rack_roles_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_rack_roles_read_responses.go b/netbox/client/dcim/dcim_rack_roles_read_responses.go index a2ed2307f7a4174dc14099377817b899fb4d9f7a..8ccf7a0f4cbe14e61340a795a5a38f27fa4b204c 100644 --- a/netbox/client/dcim/dcim_rack_roles_read_responses.go +++ b/netbox/client/dcim/dcim_rack_roles_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackRolesReadReader is a Reader for the DcimRackRolesRead structure. diff --git a/netbox/client/dcim/dcim_rack_roles_update_parameters.go b/netbox/client/dcim/dcim_rack_roles_update_parameters.go index 5ac177d63ae06fc4963c23ddd991d61a254fd01e..1d68d08eb20deefdb326a52bec9fc1cff260937f 100644 --- a/netbox/client/dcim/dcim_rack_roles_update_parameters.go +++ b/netbox/client/dcim/dcim_rack_roles_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRackRolesUpdateParams creates a new DcimRackRolesUpdateParams object diff --git a/netbox/client/dcim/dcim_rack_roles_update_responses.go b/netbox/client/dcim/dcim_rack_roles_update_responses.go index 9d0c94f9438c64ee7b56ff23d409b3139f5fc57b..fb322042dfa2a59f644b66a82c040c75d0386dd9 100644 --- a/netbox/client/dcim/dcim_rack_roles_update_responses.go +++ b/netbox/client/dcim/dcim_rack_roles_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRackRolesUpdateReader is a Reader for the DcimRackRolesUpdate structure. diff --git a/netbox/client/dcim/dcim_racks_create_parameters.go b/netbox/client/dcim/dcim_racks_create_parameters.go index a319020be52e2c3ec68dcf28fdd215326eec15f6..203e490d0056090680f28c403bc59336926fa9a7 100644 --- a/netbox/client/dcim/dcim_racks_create_parameters.go +++ b/netbox/client/dcim/dcim_racks_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRacksCreateParams creates a new DcimRacksCreateParams object diff --git a/netbox/client/dcim/dcim_racks_create_responses.go b/netbox/client/dcim/dcim_racks_create_responses.go index cde955f3981899c19c3872b3593f03dcd9142e3b..f96b85c3127a8bb6b949dd2cfb16e184b09579d5 100644 --- a/netbox/client/dcim/dcim_racks_create_responses.go +++ b/netbox/client/dcim/dcim_racks_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRacksCreateReader is a Reader for the DcimRacksCreate structure. @@ -61,7 +61,7 @@ func NewDcimRacksCreateCreated() *DcimRacksCreateCreated { DcimRacksCreateCreated dcim racks create created */ type DcimRacksCreateCreated struct { - Payload *models.WritableRack + Payload *models.Rack } func (o *DcimRacksCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRacksCreateCreated) Error() string { func (o *DcimRacksCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRack) + o.Payload = new(models.Rack) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_racks_delete_parameters.go b/netbox/client/dcim/dcim_racks_delete_parameters.go index d91063e4ff5758b22892197dbdd6af9898be0ec7..c6bf25a1a16e93ea9bbd285b42291f611cb2eef1 100644 --- a/netbox/client/dcim/dcim_racks_delete_parameters.go +++ b/netbox/client/dcim/dcim_racks_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_racks_list_parameters.go b/netbox/client/dcim/dcim_racks_list_parameters.go index c28c053ac8526c6f962d23dd89ea6a800896bf36..106be965c943cb9b128363611dc833474e35a50d 100644 --- a/netbox/client/dcim/dcim_racks_list_parameters.go +++ b/netbox/client/dcim/dcim_racks_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the dcim racks list operation typically these are written to a http.Request */ type DcimRacksListParams struct { + /*AssetTag*/ + AssetTag *string /*DescUnits*/ DescUnits *string /*FacilityID*/ @@ -85,6 +86,8 @@ type DcimRacksListParams struct { Group *string /*GroupID*/ GroupID *string + /*ID*/ + ID *string /*IDIn Multiple values may be separated by commas. @@ -102,6 +105,12 @@ type DcimRacksListParams struct { */ Offset *int64 + /*OuterDepth*/ + OuterDepth *string + /*OuterUnit*/ + OuterUnit *string + /*OuterWidth*/ + OuterWidth *string /*Q*/ Q *string /*Role*/ @@ -114,14 +123,22 @@ type DcimRacksListParams struct { Site *string /*SiteID*/ SiteID *string + /*Status*/ + Status *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string /*Type*/ Type *string /*UHeight*/ - UHeight *float64 + UHeight *string /*Width*/ Width *string @@ -163,6 +180,17 @@ func (o *DcimRacksListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAssetTag adds the assetTag to the dcim racks list params +func (o *DcimRacksListParams) WithAssetTag(assetTag *string) *DcimRacksListParams { + o.SetAssetTag(assetTag) + return o +} + +// SetAssetTag adds the assetTag to the dcim racks list params +func (o *DcimRacksListParams) SetAssetTag(assetTag *string) { + o.AssetTag = assetTag +} + // WithDescUnits adds the descUnits to the dcim racks list params func (o *DcimRacksListParams) WithDescUnits(descUnits *string) *DcimRacksListParams { o.SetDescUnits(descUnits) @@ -207,6 +235,17 @@ func (o *DcimRacksListParams) SetGroupID(groupID *string) { o.GroupID = groupID } +// WithID adds the id to the dcim racks list params +func (o *DcimRacksListParams) WithID(id *string) *DcimRacksListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks list params +func (o *DcimRacksListParams) SetID(id *string) { + o.ID = id +} + // WithIDIn adds the iDIn to the dcim racks list params func (o *DcimRacksListParams) WithIDIn(iDIn *string) *DcimRacksListParams { o.SetIDIn(iDIn) @@ -251,6 +290,39 @@ func (o *DcimRacksListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithOuterDepth adds the outerDepth to the dcim racks list params +func (o *DcimRacksListParams) WithOuterDepth(outerDepth *string) *DcimRacksListParams { + o.SetOuterDepth(outerDepth) + return o +} + +// SetOuterDepth adds the outerDepth to the dcim racks list params +func (o *DcimRacksListParams) SetOuterDepth(outerDepth *string) { + o.OuterDepth = outerDepth +} + +// WithOuterUnit adds the outerUnit to the dcim racks list params +func (o *DcimRacksListParams) WithOuterUnit(outerUnit *string) *DcimRacksListParams { + o.SetOuterUnit(outerUnit) + return o +} + +// SetOuterUnit adds the outerUnit to the dcim racks list params +func (o *DcimRacksListParams) SetOuterUnit(outerUnit *string) { + o.OuterUnit = outerUnit +} + +// WithOuterWidth adds the outerWidth to the dcim racks list params +func (o *DcimRacksListParams) WithOuterWidth(outerWidth *string) *DcimRacksListParams { + o.SetOuterWidth(outerWidth) + return o +} + +// SetOuterWidth adds the outerWidth to the dcim racks list params +func (o *DcimRacksListParams) SetOuterWidth(outerWidth *string) { + o.OuterWidth = outerWidth +} + // WithQ adds the q to the dcim racks list params func (o *DcimRacksListParams) WithQ(q *string) *DcimRacksListParams { o.SetQ(q) @@ -317,6 +389,28 @@ func (o *DcimRacksListParams) SetSiteID(siteID *string) { o.SiteID = siteID } +// WithStatus adds the status to the dcim racks list params +func (o *DcimRacksListParams) WithStatus(status *string) *DcimRacksListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the dcim racks list params +func (o *DcimRacksListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTag adds the tag to the dcim racks list params +func (o *DcimRacksListParams) WithTag(tag *string) *DcimRacksListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim racks list params +func (o *DcimRacksListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the dcim racks list params func (o *DcimRacksListParams) WithTenant(tenant *string) *DcimRacksListParams { o.SetTenant(tenant) @@ -328,6 +422,28 @@ func (o *DcimRacksListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the dcim racks list params +func (o *DcimRacksListParams) WithTenantGroup(tenantGroup *string) *DcimRacksListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the dcim racks list params +func (o *DcimRacksListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the dcim racks list params +func (o *DcimRacksListParams) WithTenantGroupID(tenantGroupID *string) *DcimRacksListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the dcim racks list params +func (o *DcimRacksListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the dcim racks list params func (o *DcimRacksListParams) WithTenantID(tenantID *string) *DcimRacksListParams { o.SetTenantID(tenantID) @@ -351,13 +467,13 @@ func (o *DcimRacksListParams) SetType(typeVar *string) { } // WithUHeight adds the uHeight to the dcim racks list params -func (o *DcimRacksListParams) WithUHeight(uHeight *float64) *DcimRacksListParams { +func (o *DcimRacksListParams) WithUHeight(uHeight *string) *DcimRacksListParams { o.SetUHeight(uHeight) return o } // SetUHeight adds the uHeight to the dcim racks list params -func (o *DcimRacksListParams) SetUHeight(uHeight *float64) { +func (o *DcimRacksListParams) SetUHeight(uHeight *string) { o.UHeight = uHeight } @@ -380,6 +496,22 @@ func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } var res []error + if o.AssetTag != nil { + + // query param asset_tag + var qrAssetTag string + if o.AssetTag != nil { + qrAssetTag = *o.AssetTag + } + qAssetTag := qrAssetTag + if qAssetTag != "" { + if err := r.SetQueryParam("asset_tag", qAssetTag); err != nil { + return err + } + } + + } + if o.DescUnits != nil { // query param desc_units @@ -444,6 +576,22 @@ func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.IDIn != nil { // query param id__in @@ -508,6 +656,54 @@ func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.OuterDepth != nil { + + // query param outer_depth + var qrOuterDepth string + if o.OuterDepth != nil { + qrOuterDepth = *o.OuterDepth + } + qOuterDepth := qrOuterDepth + if qOuterDepth != "" { + if err := r.SetQueryParam("outer_depth", qOuterDepth); err != nil { + return err + } + } + + } + + if o.OuterUnit != nil { + + // query param outer_unit + var qrOuterUnit string + if o.OuterUnit != nil { + qrOuterUnit = *o.OuterUnit + } + qOuterUnit := qrOuterUnit + if qOuterUnit != "" { + if err := r.SetQueryParam("outer_unit", qOuterUnit); err != nil { + return err + } + } + + } + + if o.OuterWidth != nil { + + // query param outer_width + var qrOuterWidth string + if o.OuterWidth != nil { + qrOuterWidth = *o.OuterWidth + } + qOuterWidth := qrOuterWidth + if qOuterWidth != "" { + if err := r.SetQueryParam("outer_width", qOuterWidth); err != nil { + return err + } + } + + } + if o.Q != nil { // query param q @@ -604,6 +800,38 @@ func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.Status != nil { + + // query param status + var qrStatus string + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -620,6 +848,38 @@ func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id @@ -655,11 +915,11 @@ func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt if o.UHeight != nil { // query param u_height - var qrUHeight float64 + var qrUHeight string if o.UHeight != nil { qrUHeight = *o.UHeight } - qUHeight := swag.FormatFloat64(qrUHeight) + qUHeight := qrUHeight if qUHeight != "" { if err := r.SetQueryParam("u_height", qUHeight); err != nil { return err diff --git a/netbox/client/dcim/dcim_racks_list_responses.go b/netbox/client/dcim/dcim_racks_list_responses.go index a4307439b5c22a724575a8f97f42d3a4ee59061f..282da279d4d40a0a7ca806e808d0129b30a7acf6 100644 --- a/netbox/client/dcim/dcim_racks_list_responses.go +++ b/netbox/client/dcim/dcim_racks_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRacksListReader is a Reader for the DcimRacksList structure. @@ -61,7 +65,7 @@ func NewDcimRacksListOK() *DcimRacksListOK { DcimRacksListOK dcim racks list o k */ type DcimRacksListOK struct { - Payload *models.DcimRacksListOKBody + Payload *DcimRacksListOKBody } func (o *DcimRacksListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimRacksListOK) Error() string { func (o *DcimRacksListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimRacksListOKBody) + o.Payload = new(DcimRacksListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimRacksListOK) readResponse(response runtime.ClientResponse, consumer return nil } + +/*DcimRacksListOKBody dcim racks list o k body +swagger:model DcimRacksListOKBody +*/ +type DcimRacksListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Rack `json:"results"` +} + +// Validate validates this dcim racks list o k body +func (o *DcimRacksListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimRacksListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimRacksListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimRacksListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimRacksListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRacksListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimRacksListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRacksListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimRacksListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimRacksListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimRacksListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimRacksListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRacksListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_racks_partial_update_parameters.go b/netbox/client/dcim/dcim_racks_partial_update_parameters.go index 34da3d93985e560c7749e3fc2d7393397e5bd2d5..c8750b948a4f06c1859e8894066751124dee1023 100644 --- a/netbox/client/dcim/dcim_racks_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_racks_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRacksPartialUpdateParams creates a new DcimRacksPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_racks_partial_update_responses.go b/netbox/client/dcim/dcim_racks_partial_update_responses.go index ae7e1e34c3a717566d33ab22be005bb0c1ce08d3..67a613eaebf97d637ff685dcef77f4ea0e7dc3e1 100644 --- a/netbox/client/dcim/dcim_racks_partial_update_responses.go +++ b/netbox/client/dcim/dcim_racks_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRacksPartialUpdateReader is a Reader for the DcimRacksPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimRacksPartialUpdateOK() *DcimRacksPartialUpdateOK { DcimRacksPartialUpdateOK dcim racks partial update o k */ type DcimRacksPartialUpdateOK struct { - Payload *models.WritableRack + Payload *models.Rack } func (o *DcimRacksPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRacksPartialUpdateOK) Error() string { func (o *DcimRacksPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRack) + o.Payload = new(models.Rack) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_racks_read_parameters.go b/netbox/client/dcim/dcim_racks_read_parameters.go index e112d47be900900dc585a6458f45b885c558a6d1..097532537aa36cd4ba8c0cfed5f02dc1f77c5fee 100644 --- a/netbox/client/dcim/dcim_racks_read_parameters.go +++ b/netbox/client/dcim/dcim_racks_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_racks_read_responses.go b/netbox/client/dcim/dcim_racks_read_responses.go index dc6d3a1bc2f6bff16ef132d88c8db69ae3bfb44a..b85cc220bae4efa3014f3ee9fdcd89fcfaf11ae2 100644 --- a/netbox/client/dcim/dcim_racks_read_responses.go +++ b/netbox/client/dcim/dcim_racks_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRacksReadReader is a Reader for the DcimRacksRead structure. diff --git a/netbox/client/dcim/dcim_racks_units_parameters.go b/netbox/client/dcim/dcim_racks_units_parameters.go index 19d8b25856ceca6fe1bb496ed4f7765d2af7c833..0daa12d0e53a2c6fe0e9fe6e29c44dcd5bd9f9d5 100644 --- a/netbox/client/dcim/dcim_racks_units_parameters.go +++ b/netbox/client/dcim/dcim_racks_units_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_racks_units_responses.go b/netbox/client/dcim/dcim_racks_units_responses.go index c259e7a25c1497c7613093b7a83e768ad95e705c..5b0b6962737f8bb2896384b12e9ed0a885c0bf8a 100644 --- a/netbox/client/dcim/dcim_racks_units_responses.go +++ b/netbox/client/dcim/dcim_racks_units_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRacksUnitsReader is a Reader for the DcimRacksUnits structure. diff --git a/netbox/client/dcim/dcim_racks_update_parameters.go b/netbox/client/dcim/dcim_racks_update_parameters.go index f9c8225b0203daf5cf60d933bdbbcf9a05935155..a0be5740542435b03576096d6a10039f1b19b2d4 100644 --- a/netbox/client/dcim/dcim_racks_update_parameters.go +++ b/netbox/client/dcim/dcim_racks_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRacksUpdateParams creates a new DcimRacksUpdateParams object diff --git a/netbox/client/dcim/dcim_racks_update_responses.go b/netbox/client/dcim/dcim_racks_update_responses.go index 92f1eba1696b3d7bea098da24bf4e4455255054e..66470e998b44f6ed4c8d862cc833d8100e754840 100644 --- a/netbox/client/dcim/dcim_racks_update_responses.go +++ b/netbox/client/dcim/dcim_racks_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRacksUpdateReader is a Reader for the DcimRacksUpdate structure. @@ -61,7 +61,7 @@ func NewDcimRacksUpdateOK() *DcimRacksUpdateOK { DcimRacksUpdateOK dcim racks update o k */ type DcimRacksUpdateOK struct { - Payload *models.WritableRack + Payload *models.Rack } func (o *DcimRacksUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRacksUpdateOK) Error() string { func (o *DcimRacksUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRack) + o.Payload = new(models.Rack) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rear_port_templates_create_parameters.go b/netbox/client/dcim/dcim_rear_port_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..cf89490898eeaf40bb39c8ecfb592f963d52da40 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRearPortTemplatesCreateParams creates a new DcimRearPortTemplatesCreateParams object +// with the default values initialized. +func NewDcimRearPortTemplatesCreateParams() *DcimRearPortTemplatesCreateParams { + var () + return &DcimRearPortTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortTemplatesCreateParamsWithTimeout creates a new DcimRearPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimRearPortTemplatesCreateParams { + var () + return &DcimRearPortTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortTemplatesCreateParamsWithContext creates a new DcimRearPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortTemplatesCreateParamsWithContext(ctx context.Context) *DcimRearPortTemplatesCreateParams { + var () + return &DcimRearPortTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimRearPortTemplatesCreateParamsWithHTTPClient creates a new DcimRearPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimRearPortTemplatesCreateParams { + var () + return &DcimRearPortTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimRearPortTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim rear port templates create operation typically these are written to a http.Request +*/ +type DcimRearPortTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableRearPortTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear port templates create params +func (o *DcimRearPortTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimRearPortTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear port templates create params +func (o *DcimRearPortTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear port templates create params +func (o *DcimRearPortTemplatesCreateParams) WithContext(ctx context.Context) *DcimRearPortTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear port templates create params +func (o *DcimRearPortTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear port templates create params +func (o *DcimRearPortTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimRearPortTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear port templates create params +func (o *DcimRearPortTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rear port templates create params +func (o *DcimRearPortTemplatesCreateParams) WithData(data *models.WritableRearPortTemplate) *DcimRearPortTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rear port templates create params +func (o *DcimRearPortTemplatesCreateParams) SetData(data *models.WritableRearPortTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortTemplatesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_create_responses.go b/netbox/client/dcim/dcim_rear_port_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9871a33fefb67fbcb1b949635aa1f6850116f407 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRearPortTemplatesCreateReader is a Reader for the DcimRearPortTemplatesCreate structure. +type DcimRearPortTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRearPortTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRearPortTemplatesCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRearPortTemplatesCreateCreated creates a DcimRearPortTemplatesCreateCreated with default headers values +func NewDcimRearPortTemplatesCreateCreated() *DcimRearPortTemplatesCreateCreated { + return &DcimRearPortTemplatesCreateCreated{} +} + +/*DcimRearPortTemplatesCreateCreated handles this case with default header values. + +DcimRearPortTemplatesCreateCreated dcim rear port templates create created +*/ +type DcimRearPortTemplatesCreateCreated struct { + Payload *models.RearPortTemplate +} + +func (o *DcimRearPortTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/rear-port-templates/][%d] dcimRearPortTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRearPortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RearPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_delete_parameters.go b/netbox/client/dcim/dcim_rear_port_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..31932fa488fe7c3b55422f8e2076cf71e8cef954 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRearPortTemplatesDeleteParams creates a new DcimRearPortTemplatesDeleteParams object +// with the default values initialized. +func NewDcimRearPortTemplatesDeleteParams() *DcimRearPortTemplatesDeleteParams { + var () + return &DcimRearPortTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortTemplatesDeleteParamsWithTimeout creates a new DcimRearPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimRearPortTemplatesDeleteParams { + var () + return &DcimRearPortTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortTemplatesDeleteParamsWithContext creates a new DcimRearPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortTemplatesDeleteParamsWithContext(ctx context.Context) *DcimRearPortTemplatesDeleteParams { + var () + return &DcimRearPortTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRearPortTemplatesDeleteParamsWithHTTPClient creates a new DcimRearPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimRearPortTemplatesDeleteParams { + var () + return &DcimRearPortTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRearPortTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim rear port templates delete operation typically these are written to a http.Request +*/ +type DcimRearPortTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this rear port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear port templates delete params +func (o *DcimRearPortTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimRearPortTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear port templates delete params +func (o *DcimRearPortTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear port templates delete params +func (o *DcimRearPortTemplatesDeleteParams) WithContext(ctx context.Context) *DcimRearPortTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear port templates delete params +func (o *DcimRearPortTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear port templates delete params +func (o *DcimRearPortTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimRearPortTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear port templates delete params +func (o *DcimRearPortTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rear port templates delete params +func (o *DcimRearPortTemplatesDeleteParams) WithID(id int64) *DcimRearPortTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear port templates delete params +func (o *DcimRearPortTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortTemplatesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_delete_responses.go b/netbox/client/dcim/dcim_rear_port_templates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..77f9cad8c488749a3cf76b8d3d915363692ba086 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimRearPortTemplatesDeleteReader is a Reader for the DcimRearPortTemplatesDelete structure. +type DcimRearPortTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRearPortTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRearPortTemplatesDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRearPortTemplatesDeleteNoContent creates a DcimRearPortTemplatesDeleteNoContent with default headers values +func NewDcimRearPortTemplatesDeleteNoContent() *DcimRearPortTemplatesDeleteNoContent { + return &DcimRearPortTemplatesDeleteNoContent{} +} + +/*DcimRearPortTemplatesDeleteNoContent handles this case with default header values. + +DcimRearPortTemplatesDeleteNoContent dcim rear port templates delete no content +*/ +type DcimRearPortTemplatesDeleteNoContent struct { +} + +func (o *DcimRearPortTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/rear-port-templates/{id}/][%d] dcimRearPortTemplatesDeleteNoContent ", 204) +} + +func (o *DcimRearPortTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_list_parameters.go b/netbox/client/dcim/dcim_rear_port_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..de6d0c81b4f34e0167e5395159a63fe51ce8ffca --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_list_parameters.go @@ -0,0 +1,368 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRearPortTemplatesListParams creates a new DcimRearPortTemplatesListParams object +// with the default values initialized. +func NewDcimRearPortTemplatesListParams() *DcimRearPortTemplatesListParams { + var () + return &DcimRearPortTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortTemplatesListParamsWithTimeout creates a new DcimRearPortTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortTemplatesListParamsWithTimeout(timeout time.Duration) *DcimRearPortTemplatesListParams { + var () + return &DcimRearPortTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortTemplatesListParamsWithContext creates a new DcimRearPortTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortTemplatesListParamsWithContext(ctx context.Context) *DcimRearPortTemplatesListParams { + var () + return &DcimRearPortTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimRearPortTemplatesListParamsWithHTTPClient creates a new DcimRearPortTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortTemplatesListParamsWithHTTPClient(client *http.Client) *DcimRearPortTemplatesListParams { + var () + return &DcimRearPortTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimRearPortTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim rear port templates list operation typically these are written to a http.Request +*/ +type DcimRearPortTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*ID*/ + ID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Positions*/ + Positions *string + /*Q*/ + Q *string + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithTimeout(timeout time.Duration) *DcimRearPortTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithContext(ctx context.Context) *DcimRearPortTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithHTTPClient(client *http.Client) *DcimRearPortTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimRearPortTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithID adds the id to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithID(id *string) *DcimRearPortTemplatesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithLimit(limit *int64) *DcimRearPortTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithName(name *string) *DcimRearPortTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithOffset(offset *int64) *DcimRearPortTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPositions adds the positions to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithPositions(positions *string) *DcimRearPortTemplatesListParams { + o.SetPositions(positions) + return o +} + +// SetPositions adds the positions to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetPositions(positions *string) { + o.Positions = positions +} + +// WithQ adds the q to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithQ(q *string) *DcimRearPortTemplatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetQ(q *string) { + o.Q = q +} + +// WithType adds the typeVar to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) WithType(typeVar *string) *DcimRearPortTemplatesListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim rear port templates list params +func (o *DcimRearPortTemplatesListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Positions != nil { + + // query param positions + var qrPositions string + if o.Positions != nil { + qrPositions = *o.Positions + } + qPositions := qrPositions + if qPositions != "" { + if err := r.SetQueryParam("positions", qPositions); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_list_responses.go b/netbox/client/dcim/dcim_rear_port_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..67609df323a17f82e272c6ab4d0dd3fab51e0b67 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRearPortTemplatesListReader is a Reader for the DcimRearPortTemplatesList structure. +type DcimRearPortTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRearPortTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRearPortTemplatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRearPortTemplatesListOK creates a DcimRearPortTemplatesListOK with default headers values +func NewDcimRearPortTemplatesListOK() *DcimRearPortTemplatesListOK { + return &DcimRearPortTemplatesListOK{} +} + +/*DcimRearPortTemplatesListOK handles this case with default header values. + +DcimRearPortTemplatesListOK dcim rear port templates list o k +*/ +type DcimRearPortTemplatesListOK struct { + Payload *DcimRearPortTemplatesListOKBody +} + +func (o *DcimRearPortTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/rear-port-templates/][%d] dcimRearPortTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimRearPortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(DcimRearPortTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*DcimRearPortTemplatesListOKBody dcim rear port templates list o k body +swagger:model DcimRearPortTemplatesListOKBody +*/ +type DcimRearPortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.RearPortTemplate `json:"results"` +} + +// Validate validates this dcim rear port templates list o k body +func (o *DcimRearPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimRearPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimRearPortTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimRearPortTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimRearPortTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRearPortTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimRearPortTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRearPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimRearPortTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimRearPortTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimRearPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimRearPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRearPortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_rear_port_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..74db369886eab4846dbab01de2ff677f1afb596b --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRearPortTemplatesPartialUpdateParams creates a new DcimRearPortTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimRearPortTemplatesPartialUpdateParams() *DcimRearPortTemplatesPartialUpdateParams { + var () + return &DcimRearPortTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortTemplatesPartialUpdateParamsWithTimeout creates a new DcimRearPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRearPortTemplatesPartialUpdateParams { + var () + return &DcimRearPortTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortTemplatesPartialUpdateParamsWithContext creates a new DcimRearPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimRearPortTemplatesPartialUpdateParams { + var () + return &DcimRearPortTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRearPortTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimRearPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRearPortTemplatesPartialUpdateParams { + var () + return &DcimRearPortTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRearPortTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim rear port templates partial update operation typically these are written to a http.Request +*/ +type DcimRearPortTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRearPortTemplate + /*ID + A unique integer value identifying this rear port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRearPortTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimRearPortTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRearPortTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) WithData(data *models.WritableRearPortTemplate) *DcimRearPortTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) SetData(data *models.WritableRearPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) WithID(id int64) *DcimRearPortTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear port templates partial update params +func (o *DcimRearPortTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortTemplatesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_update_responses.go b/netbox/client/dcim/dcim_rear_port_templates_partial_update_responses.go similarity index 51% rename from netbox/client/dcim/dcim_interface_connections_update_responses.go rename to netbox/client/dcim/dcim_rear_port_templates_partial_update_responses.go index ac16cd5cdb804e18f9496df398de63f1b5aaeb4e..9a802fdfb3d8c71b286436431487c0eb3c8afcc1 100644 --- a/netbox/client/dcim/dcim_interface_connections_update_responses.go +++ b/netbox/client/dcim/dcim_rear_port_templates_partial_update_responses.go @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// DcimInterfaceConnectionsUpdateReader is a Reader for the DcimInterfaceConnectionsUpdate structure. -type DcimInterfaceConnectionsUpdateReader struct { +// DcimRearPortTemplatesPartialUpdateReader is a Reader for the DcimRearPortTemplatesPartialUpdate structure. +type DcimRearPortTemplatesPartialUpdateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *DcimInterfaceConnectionsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimRearPortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewDcimInterfaceConnectionsUpdateOK() + result := NewDcimRearPortTemplatesPartialUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *DcimInterfaceConnectionsUpdateReader) ReadResponse(response runtime.Cli } } -// NewDcimInterfaceConnectionsUpdateOK creates a DcimInterfaceConnectionsUpdateOK with default headers values -func NewDcimInterfaceConnectionsUpdateOK() *DcimInterfaceConnectionsUpdateOK { - return &DcimInterfaceConnectionsUpdateOK{} +// NewDcimRearPortTemplatesPartialUpdateOK creates a DcimRearPortTemplatesPartialUpdateOK with default headers values +func NewDcimRearPortTemplatesPartialUpdateOK() *DcimRearPortTemplatesPartialUpdateOK { + return &DcimRearPortTemplatesPartialUpdateOK{} } -/*DcimInterfaceConnectionsUpdateOK handles this case with default header values. +/*DcimRearPortTemplatesPartialUpdateOK handles this case with default header values. -DcimInterfaceConnectionsUpdateOK dcim interface connections update o k +DcimRearPortTemplatesPartialUpdateOK dcim rear port templates partial update o k */ -type DcimInterfaceConnectionsUpdateOK struct { - Payload *models.WritableInterfaceConnection +type DcimRearPortTemplatesPartialUpdateOK struct { + Payload *models.RearPortTemplate } -func (o *DcimInterfaceConnectionsUpdateOK) Error() string { - return fmt.Sprintf("[PUT /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsUpdateOK %+v", 200, o.Payload) +func (o *DcimRearPortTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/rear-port-templates/{id}/][%d] dcimRearPortTemplatesPartialUpdateOK %+v", 200, o.Payload) } -func (o *DcimInterfaceConnectionsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimRearPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterfaceConnection) + o.Payload = new(models.RearPortTemplate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rear_port_templates_read_parameters.go b/netbox/client/dcim/dcim_rear_port_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d3af0d05944ddef4a99811c912b00bbd4a5f1451 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRearPortTemplatesReadParams creates a new DcimRearPortTemplatesReadParams object +// with the default values initialized. +func NewDcimRearPortTemplatesReadParams() *DcimRearPortTemplatesReadParams { + var () + return &DcimRearPortTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortTemplatesReadParamsWithTimeout creates a new DcimRearPortTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimRearPortTemplatesReadParams { + var () + return &DcimRearPortTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortTemplatesReadParamsWithContext creates a new DcimRearPortTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortTemplatesReadParamsWithContext(ctx context.Context) *DcimRearPortTemplatesReadParams { + var () + return &DcimRearPortTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimRearPortTemplatesReadParamsWithHTTPClient creates a new DcimRearPortTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimRearPortTemplatesReadParams { + var () + return &DcimRearPortTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimRearPortTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim rear port templates read operation typically these are written to a http.Request +*/ +type DcimRearPortTemplatesReadParams struct { + + /*ID + A unique integer value identifying this rear port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear port templates read params +func (o *DcimRearPortTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimRearPortTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear port templates read params +func (o *DcimRearPortTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear port templates read params +func (o *DcimRearPortTemplatesReadParams) WithContext(ctx context.Context) *DcimRearPortTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear port templates read params +func (o *DcimRearPortTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear port templates read params +func (o *DcimRearPortTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimRearPortTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear port templates read params +func (o *DcimRearPortTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rear port templates read params +func (o *DcimRearPortTemplatesReadParams) WithID(id int64) *DcimRearPortTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear port templates read params +func (o *DcimRearPortTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortTemplatesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_read_responses.go b/netbox/client/dcim/dcim_rear_port_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a07f8406f19bb25499651af3edd5b1fb0de6c24a --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRearPortTemplatesReadReader is a Reader for the DcimRearPortTemplatesRead structure. +type DcimRearPortTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRearPortTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRearPortTemplatesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRearPortTemplatesReadOK creates a DcimRearPortTemplatesReadOK with default headers values +func NewDcimRearPortTemplatesReadOK() *DcimRearPortTemplatesReadOK { + return &DcimRearPortTemplatesReadOK{} +} + +/*DcimRearPortTemplatesReadOK handles this case with default header values. + +DcimRearPortTemplatesReadOK dcim rear port templates read o k +*/ +type DcimRearPortTemplatesReadOK struct { + Payload *models.RearPortTemplate +} + +func (o *DcimRearPortTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/rear-port-templates/{id}/][%d] dcimRearPortTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimRearPortTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RearPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_update_parameters.go b/netbox/client/dcim/dcim_rear_port_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d167901f7d767ebf9f0833c7f5de09784c22429c --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRearPortTemplatesUpdateParams creates a new DcimRearPortTemplatesUpdateParams object +// with the default values initialized. +func NewDcimRearPortTemplatesUpdateParams() *DcimRearPortTemplatesUpdateParams { + var () + return &DcimRearPortTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortTemplatesUpdateParamsWithTimeout creates a new DcimRearPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimRearPortTemplatesUpdateParams { + var () + return &DcimRearPortTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortTemplatesUpdateParamsWithContext creates a new DcimRearPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortTemplatesUpdateParamsWithContext(ctx context.Context) *DcimRearPortTemplatesUpdateParams { + var () + return &DcimRearPortTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRearPortTemplatesUpdateParamsWithHTTPClient creates a new DcimRearPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimRearPortTemplatesUpdateParams { + var () + return &DcimRearPortTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRearPortTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim rear port templates update operation typically these are written to a http.Request +*/ +type DcimRearPortTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableRearPortTemplate + /*ID + A unique integer value identifying this rear port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimRearPortTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) WithContext(ctx context.Context) *DcimRearPortTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimRearPortTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) WithData(data *models.WritableRearPortTemplate) *DcimRearPortTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) SetData(data *models.WritableRearPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) WithID(id int64) *DcimRearPortTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear port templates update params +func (o *DcimRearPortTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortTemplatesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rear_port_templates_update_responses.go b/netbox/client/dcim/dcim_rear_port_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f2374eff0a5a6bc86dc9d511951f59676fd4c8b7 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_port_templates_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRearPortTemplatesUpdateReader is a Reader for the DcimRearPortTemplatesUpdate structure. +type DcimRearPortTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRearPortTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRearPortTemplatesUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRearPortTemplatesUpdateOK creates a DcimRearPortTemplatesUpdateOK with default headers values +func NewDcimRearPortTemplatesUpdateOK() *DcimRearPortTemplatesUpdateOK { + return &DcimRearPortTemplatesUpdateOK{} +} + +/*DcimRearPortTemplatesUpdateOK handles this case with default header values. + +DcimRearPortTemplatesUpdateOK dcim rear port templates update o k +*/ +type DcimRearPortTemplatesUpdateOK struct { + Payload *models.RearPortTemplate +} + +func (o *DcimRearPortTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/rear-port-templates/{id}/][%d] dcimRearPortTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRearPortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RearPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_rear_ports_create_parameters.go b/netbox/client/dcim/dcim_rear_ports_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..394a2fefcb2fecd02e437cd176a7c592f5d1f5db --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRearPortsCreateParams creates a new DcimRearPortsCreateParams object +// with the default values initialized. +func NewDcimRearPortsCreateParams() *DcimRearPortsCreateParams { + var () + return &DcimRearPortsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortsCreateParamsWithTimeout creates a new DcimRearPortsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortsCreateParamsWithTimeout(timeout time.Duration) *DcimRearPortsCreateParams { + var () + return &DcimRearPortsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortsCreateParamsWithContext creates a new DcimRearPortsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortsCreateParamsWithContext(ctx context.Context) *DcimRearPortsCreateParams { + var () + return &DcimRearPortsCreateParams{ + + Context: ctx, + } +} + +// NewDcimRearPortsCreateParamsWithHTTPClient creates a new DcimRearPortsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortsCreateParamsWithHTTPClient(client *http.Client) *DcimRearPortsCreateParams { + var () + return &DcimRearPortsCreateParams{ + HTTPClient: client, + } +} + +/*DcimRearPortsCreateParams contains all the parameters to send to the API endpoint +for the dcim rear ports create operation typically these are written to a http.Request +*/ +type DcimRearPortsCreateParams struct { + + /*Data*/ + Data *models.WritableRearPort + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear ports create params +func (o *DcimRearPortsCreateParams) WithTimeout(timeout time.Duration) *DcimRearPortsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear ports create params +func (o *DcimRearPortsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear ports create params +func (o *DcimRearPortsCreateParams) WithContext(ctx context.Context) *DcimRearPortsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear ports create params +func (o *DcimRearPortsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear ports create params +func (o *DcimRearPortsCreateParams) WithHTTPClient(client *http.Client) *DcimRearPortsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear ports create params +func (o *DcimRearPortsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rear ports create params +func (o *DcimRearPortsCreateParams) WithData(data *models.WritableRearPort) *DcimRearPortsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rear ports create params +func (o *DcimRearPortsCreateParams) SetData(data *models.WritableRearPort) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_recent_activity_list_responses.go b/netbox/client/dcim/dcim_rear_ports_create_responses.go similarity index 57% rename from netbox/client/extras/extras_recent_activity_list_responses.go rename to netbox/client/dcim/dcim_rear_ports_create_responses.go index 39b2e3cf07bcf478e0e6d30d3a7019c26406a1c0..b07afb615f723df763c19464a3c0eae2450e5d22 100644 --- a/netbox/client/extras/extras_recent_activity_list_responses.go +++ b/netbox/client/dcim/dcim_rear_ports_create_responses.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package extras +package dcim // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// ExtrasRecentActivityListReader is a Reader for the ExtrasRecentActivityList structure. -type ExtrasRecentActivityListReader struct { +// DcimRearPortsCreateReader is a Reader for the DcimRearPortsCreate structure. +type DcimRearPortsCreateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *ExtrasRecentActivityListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimRearPortsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { - case 200: - result := NewExtrasRecentActivityListOK() + case 201: + result := NewDcimRearPortsCreateCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *ExtrasRecentActivityListReader) ReadResponse(response runtime.ClientRes } } -// NewExtrasRecentActivityListOK creates a ExtrasRecentActivityListOK with default headers values -func NewExtrasRecentActivityListOK() *ExtrasRecentActivityListOK { - return &ExtrasRecentActivityListOK{} +// NewDcimRearPortsCreateCreated creates a DcimRearPortsCreateCreated with default headers values +func NewDcimRearPortsCreateCreated() *DcimRearPortsCreateCreated { + return &DcimRearPortsCreateCreated{} } -/*ExtrasRecentActivityListOK handles this case with default header values. +/*DcimRearPortsCreateCreated handles this case with default header values. -ExtrasRecentActivityListOK extras recent activity list o k +DcimRearPortsCreateCreated dcim rear ports create created */ -type ExtrasRecentActivityListOK struct { - Payload *models.ExtrasRecentActivityListOKBody +type DcimRearPortsCreateCreated struct { + Payload *models.RearPort } -func (o *ExtrasRecentActivityListOK) Error() string { - return fmt.Sprintf("[GET /extras/recent-activity/][%d] extrasRecentActivityListOK %+v", 200, o.Payload) +func (o *DcimRearPortsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/rear-ports/][%d] dcimRearPortsCreateCreated %+v", 201, o.Payload) } -func (o *ExtrasRecentActivityListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimRearPortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.ExtrasRecentActivityListOKBody) + o.Payload = new(models.RearPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rear_ports_delete_parameters.go b/netbox/client/dcim/dcim_rear_ports_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..51414fe6858c4ad2f8c467784678603acb6b10e6 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRearPortsDeleteParams creates a new DcimRearPortsDeleteParams object +// with the default values initialized. +func NewDcimRearPortsDeleteParams() *DcimRearPortsDeleteParams { + var () + return &DcimRearPortsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortsDeleteParamsWithTimeout creates a new DcimRearPortsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortsDeleteParamsWithTimeout(timeout time.Duration) *DcimRearPortsDeleteParams { + var () + return &DcimRearPortsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortsDeleteParamsWithContext creates a new DcimRearPortsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortsDeleteParamsWithContext(ctx context.Context) *DcimRearPortsDeleteParams { + var () + return &DcimRearPortsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRearPortsDeleteParamsWithHTTPClient creates a new DcimRearPortsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortsDeleteParamsWithHTTPClient(client *http.Client) *DcimRearPortsDeleteParams { + var () + return &DcimRearPortsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRearPortsDeleteParams contains all the parameters to send to the API endpoint +for the dcim rear ports delete operation typically these are written to a http.Request +*/ +type DcimRearPortsDeleteParams struct { + + /*ID + A unique integer value identifying this rear port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear ports delete params +func (o *DcimRearPortsDeleteParams) WithTimeout(timeout time.Duration) *DcimRearPortsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear ports delete params +func (o *DcimRearPortsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear ports delete params +func (o *DcimRearPortsDeleteParams) WithContext(ctx context.Context) *DcimRearPortsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear ports delete params +func (o *DcimRearPortsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear ports delete params +func (o *DcimRearPortsDeleteParams) WithHTTPClient(client *http.Client) *DcimRearPortsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear ports delete params +func (o *DcimRearPortsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rear ports delete params +func (o *DcimRearPortsDeleteParams) WithID(id int64) *DcimRearPortsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear ports delete params +func (o *DcimRearPortsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rear_ports_delete_responses.go b/netbox/client/dcim/dcim_rear_ports_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7c5c398e7ebb668abf4f8439216f05aae821000a --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// DcimRearPortsDeleteReader is a Reader for the DcimRearPortsDelete structure. +type DcimRearPortsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRearPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRearPortsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRearPortsDeleteNoContent creates a DcimRearPortsDeleteNoContent with default headers values +func NewDcimRearPortsDeleteNoContent() *DcimRearPortsDeleteNoContent { + return &DcimRearPortsDeleteNoContent{} +} + +/*DcimRearPortsDeleteNoContent handles this case with default header values. + +DcimRearPortsDeleteNoContent dcim rear ports delete no content +*/ +type DcimRearPortsDeleteNoContent struct { +} + +func (o *DcimRearPortsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/rear-ports/{id}/][%d] dcimRearPortsDeleteNoContent ", 204) +} + +func (o *DcimRearPortsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_rear_ports_list_parameters.go b/netbox/client/dcim/dcim_rear_ports_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..67502dbcf1b2922afc7703a6d34fb28f0b7408a7 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_list_parameters.go @@ -0,0 +1,484 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRearPortsListParams creates a new DcimRearPortsListParams object +// with the default values initialized. +func NewDcimRearPortsListParams() *DcimRearPortsListParams { + var () + return &DcimRearPortsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortsListParamsWithTimeout creates a new DcimRearPortsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortsListParamsWithTimeout(timeout time.Duration) *DcimRearPortsListParams { + var () + return &DcimRearPortsListParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortsListParamsWithContext creates a new DcimRearPortsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortsListParamsWithContext(ctx context.Context) *DcimRearPortsListParams { + var () + return &DcimRearPortsListParams{ + + Context: ctx, + } +} + +// NewDcimRearPortsListParamsWithHTTPClient creates a new DcimRearPortsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortsListParamsWithHTTPClient(client *http.Client) *DcimRearPortsListParams { + var () + return &DcimRearPortsListParams{ + HTTPClient: client, + } +} + +/*DcimRearPortsListParams contains all the parameters to send to the API endpoint +for the dcim rear ports list operation typically these are written to a http.Request +*/ +type DcimRearPortsListParams struct { + + /*Cabled*/ + Cabled *string + /*Description*/ + Description *string + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*ID*/ + ID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Positions*/ + Positions *string + /*Q*/ + Q *string + /*Tag*/ + Tag *string + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithTimeout(timeout time.Duration) *DcimRearPortsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithContext(ctx context.Context) *DcimRearPortsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithHTTPClient(client *http.Client) *DcimRearPortsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCabled adds the cabled to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithCabled(cabled *string) *DcimRearPortsListParams { + o.SetCabled(cabled) + return o +} + +// SetCabled adds the cabled to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetCabled(cabled *string) { + o.Cabled = cabled +} + +// WithDescription adds the description to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithDescription(description *string) *DcimRearPortsListParams { + o.SetDescription(description) + return o +} + +// SetDescription adds the description to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetDescription(description *string) { + o.Description = description +} + +// WithDevice adds the device to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithDevice(device *string) *DcimRearPortsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithDeviceID(deviceID *string) *DcimRearPortsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithID adds the id to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithID(id *string) *DcimRearPortsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetID(id *string) { + o.ID = id +} + +// WithLimit adds the limit to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithLimit(limit *int64) *DcimRearPortsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithName(name *string) *DcimRearPortsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithOffset(offset *int64) *DcimRearPortsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPositions adds the positions to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithPositions(positions *string) *DcimRearPortsListParams { + o.SetPositions(positions) + return o +} + +// SetPositions adds the positions to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetPositions(positions *string) { + o.Positions = positions +} + +// WithQ adds the q to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithQ(q *string) *DcimRearPortsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithTag(tag *string) *DcimRearPortsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetTag(tag *string) { + o.Tag = tag +} + +// WithType adds the typeVar to the dcim rear ports list params +func (o *DcimRearPortsListParams) WithType(typeVar *string) *DcimRearPortsListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim rear ports list params +func (o *DcimRearPortsListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cabled != nil { + + // query param cabled + var qrCabled string + if o.Cabled != nil { + qrCabled = *o.Cabled + } + qCabled := qrCabled + if qCabled != "" { + if err := r.SetQueryParam("cabled", qCabled); err != nil { + return err + } + } + + } + + if o.Description != nil { + + // query param description + var qrDescription string + if o.Description != nil { + qrDescription = *o.Description + } + qDescription := qrDescription + if qDescription != "" { + if err := r.SetQueryParam("description", qDescription); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Positions != nil { + + // query param positions + var qrPositions string + if o.Positions != nil { + qrPositions = *o.Positions + } + qPositions := qrPositions + if qPositions != "" { + if err := r.SetQueryParam("positions", qPositions); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rear_ports_list_responses.go b/netbox/client/dcim/dcim_rear_ports_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c010cc3a2f8d2e938cf8e212617ddc348fb85f36 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRearPortsListReader is a Reader for the DcimRearPortsList structure. +type DcimRearPortsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRearPortsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRearPortsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRearPortsListOK creates a DcimRearPortsListOK with default headers values +func NewDcimRearPortsListOK() *DcimRearPortsListOK { + return &DcimRearPortsListOK{} +} + +/*DcimRearPortsListOK handles this case with default header values. + +DcimRearPortsListOK dcim rear ports list o k +*/ +type DcimRearPortsListOK struct { + Payload *DcimRearPortsListOKBody +} + +func (o *DcimRearPortsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/rear-ports/][%d] dcimRearPortsListOK %+v", 200, o.Payload) +} + +func (o *DcimRearPortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(DcimRearPortsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*DcimRearPortsListOKBody dcim rear ports list o k body +swagger:model DcimRearPortsListOKBody +*/ +type DcimRearPortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.RearPort `json:"results"` +} + +// Validate validates this dcim rear ports list o k body +func (o *DcimRearPortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimRearPortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimRearPortsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimRearPortsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimRearPortsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRearPortsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimRearPortsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRearPortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimRearPortsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimRearPortsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimRearPortsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimRearPortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRearPortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_rear_ports_partial_update_parameters.go b/netbox/client/dcim/dcim_rear_ports_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..417c27432eb97372bc7f4718438ed7c10b279fd5 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRearPortsPartialUpdateParams creates a new DcimRearPortsPartialUpdateParams object +// with the default values initialized. +func NewDcimRearPortsPartialUpdateParams() *DcimRearPortsPartialUpdateParams { + var () + return &DcimRearPortsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortsPartialUpdateParamsWithTimeout creates a new DcimRearPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRearPortsPartialUpdateParams { + var () + return &DcimRearPortsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortsPartialUpdateParamsWithContext creates a new DcimRearPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortsPartialUpdateParamsWithContext(ctx context.Context) *DcimRearPortsPartialUpdateParams { + var () + return &DcimRearPortsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRearPortsPartialUpdateParamsWithHTTPClient creates a new DcimRearPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRearPortsPartialUpdateParams { + var () + return &DcimRearPortsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRearPortsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim rear ports partial update operation typically these are written to a http.Request +*/ +type DcimRearPortsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRearPort + /*ID + A unique integer value identifying this rear port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRearPortsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) WithContext(ctx context.Context) *DcimRearPortsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRearPortsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) WithData(data *models.WritableRearPort) *DcimRearPortsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) SetData(data *models.WritableRearPort) { + o.Data = data +} + +// WithID adds the id to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) WithID(id int64) *DcimRearPortsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear ports partial update params +func (o *DcimRearPortsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amaggregates_list_responses.go b/netbox/client/dcim/dcim_rear_ports_partial_update_responses.go similarity index 54% rename from netbox/client/ipam/ip_amaggregates_list_responses.go rename to netbox/client/dcim/dcim_rear_ports_partial_update_responses.go index e5d8eb76e0f2823ae342b9c874b6aac8f90800bf..653e9c4b9c4813609cb4793ee893c647e3cae855 100644 --- a/netbox/client/ipam/ip_amaggregates_list_responses.go +++ b/netbox/client/dcim/dcim_rear_ports_partial_update_responses.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package ipam +package dcim // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// IPAMAggregatesListReader is a Reader for the IPAMAggregatesList structure. -type IPAMAggregatesListReader struct { +// DcimRearPortsPartialUpdateReader is a Reader for the DcimRearPortsPartialUpdate structure. +type DcimRearPortsPartialUpdateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IPAMAggregatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimRearPortsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIPAMAggregatesListOK() + result := NewDcimRearPortsPartialUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *IPAMAggregatesListReader) ReadResponse(response runtime.ClientResponse, } } -// NewIPAMAggregatesListOK creates a IPAMAggregatesListOK with default headers values -func NewIPAMAggregatesListOK() *IPAMAggregatesListOK { - return &IPAMAggregatesListOK{} +// NewDcimRearPortsPartialUpdateOK creates a DcimRearPortsPartialUpdateOK with default headers values +func NewDcimRearPortsPartialUpdateOK() *DcimRearPortsPartialUpdateOK { + return &DcimRearPortsPartialUpdateOK{} } -/*IPAMAggregatesListOK handles this case with default header values. +/*DcimRearPortsPartialUpdateOK handles this case with default header values. -IPAMAggregatesListOK ipam aggregates list o k +DcimRearPortsPartialUpdateOK dcim rear ports partial update o k */ -type IPAMAggregatesListOK struct { - Payload *models.IPAMAggregatesListOKBody +type DcimRearPortsPartialUpdateOK struct { + Payload *models.RearPort } -func (o *IPAMAggregatesListOK) Error() string { - return fmt.Sprintf("[GET /ipam/aggregates/][%d] ipamAggregatesListOK %+v", 200, o.Payload) +func (o *DcimRearPortsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/rear-ports/{id}/][%d] dcimRearPortsPartialUpdateOK %+v", 200, o.Payload) } -func (o *IPAMAggregatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimRearPortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.IPAMAggregatesListOKBody) + o.Payload = new(models.RearPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rear_ports_read_parameters.go b/netbox/client/dcim/dcim_rear_ports_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6a72333f0953b242527135b286c468883dab4b0a --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewDcimRearPortsReadParams creates a new DcimRearPortsReadParams object +// with the default values initialized. +func NewDcimRearPortsReadParams() *DcimRearPortsReadParams { + var () + return &DcimRearPortsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortsReadParamsWithTimeout creates a new DcimRearPortsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortsReadParamsWithTimeout(timeout time.Duration) *DcimRearPortsReadParams { + var () + return &DcimRearPortsReadParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortsReadParamsWithContext creates a new DcimRearPortsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortsReadParamsWithContext(ctx context.Context) *DcimRearPortsReadParams { + var () + return &DcimRearPortsReadParams{ + + Context: ctx, + } +} + +// NewDcimRearPortsReadParamsWithHTTPClient creates a new DcimRearPortsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortsReadParamsWithHTTPClient(client *http.Client) *DcimRearPortsReadParams { + var () + return &DcimRearPortsReadParams{ + HTTPClient: client, + } +} + +/*DcimRearPortsReadParams contains all the parameters to send to the API endpoint +for the dcim rear ports read operation typically these are written to a http.Request +*/ +type DcimRearPortsReadParams struct { + + /*ID + A unique integer value identifying this rear port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear ports read params +func (o *DcimRearPortsReadParams) WithTimeout(timeout time.Duration) *DcimRearPortsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear ports read params +func (o *DcimRearPortsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear ports read params +func (o *DcimRearPortsReadParams) WithContext(ctx context.Context) *DcimRearPortsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear ports read params +func (o *DcimRearPortsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear ports read params +func (o *DcimRearPortsReadParams) WithHTTPClient(client *http.Client) *DcimRearPortsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear ports read params +func (o *DcimRearPortsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rear ports read params +func (o *DcimRearPortsReadParams) WithID(id int64) *DcimRearPortsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear ports read params +func (o *DcimRearPortsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amrirs_list_responses.go b/netbox/client/dcim/dcim_rear_ports_read_responses.go similarity index 57% rename from netbox/client/ipam/ip_amrirs_list_responses.go rename to netbox/client/dcim/dcim_rear_ports_read_responses.go index 4cdfdd83ad4a2324e0f0ab59b1b85cc0e6587cca..11299611428d68d3d0537cd50a4e73d99f2bf8ee 100644 --- a/netbox/client/ipam/ip_amrirs_list_responses.go +++ b/netbox/client/dcim/dcim_rear_ports_read_responses.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package ipam +package dcim // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// IPAMRirsListReader is a Reader for the IPAMRirsList structure. -type IPAMRirsListReader struct { +// DcimRearPortsReadReader is a Reader for the DcimRearPortsRead structure. +type DcimRearPortsReadReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IPAMRirsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *DcimRearPortsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIPAMRirsListOK() + result := NewDcimRearPortsReadOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *IPAMRirsListReader) ReadResponse(response runtime.ClientResponse, consu } } -// NewIPAMRirsListOK creates a IPAMRirsListOK with default headers values -func NewIPAMRirsListOK() *IPAMRirsListOK { - return &IPAMRirsListOK{} +// NewDcimRearPortsReadOK creates a DcimRearPortsReadOK with default headers values +func NewDcimRearPortsReadOK() *DcimRearPortsReadOK { + return &DcimRearPortsReadOK{} } -/*IPAMRirsListOK handles this case with default header values. +/*DcimRearPortsReadOK handles this case with default header values. -IPAMRirsListOK ipam rirs list o k +DcimRearPortsReadOK dcim rear ports read o k */ -type IPAMRirsListOK struct { - Payload *models.IPAMRirsListOKBody +type DcimRearPortsReadOK struct { + Payload *models.RearPort } -func (o *IPAMRirsListOK) Error() string { - return fmt.Sprintf("[GET /ipam/rirs/][%d] ipamRirsListOK %+v", 200, o.Payload) +func (o *DcimRearPortsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/rear-ports/{id}/][%d] dcimRearPortsReadOK %+v", 200, o.Payload) } -func (o *IPAMRirsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *DcimRearPortsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.IPAMRirsListOKBody) + o.Payload = new(models.RearPort) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rear_ports_update_parameters.go b/netbox/client/dcim/dcim_rear_ports_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..197baf6eb51b98f6bdbd689bd9b245f742868834 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewDcimRearPortsUpdateParams creates a new DcimRearPortsUpdateParams object +// with the default values initialized. +func NewDcimRearPortsUpdateParams() *DcimRearPortsUpdateParams { + var () + return &DcimRearPortsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRearPortsUpdateParamsWithTimeout creates a new DcimRearPortsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRearPortsUpdateParamsWithTimeout(timeout time.Duration) *DcimRearPortsUpdateParams { + var () + return &DcimRearPortsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRearPortsUpdateParamsWithContext creates a new DcimRearPortsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRearPortsUpdateParamsWithContext(ctx context.Context) *DcimRearPortsUpdateParams { + var () + return &DcimRearPortsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRearPortsUpdateParamsWithHTTPClient creates a new DcimRearPortsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRearPortsUpdateParamsWithHTTPClient(client *http.Client) *DcimRearPortsUpdateParams { + var () + return &DcimRearPortsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRearPortsUpdateParams contains all the parameters to send to the API endpoint +for the dcim rear ports update operation typically these are written to a http.Request +*/ +type DcimRearPortsUpdateParams struct { + + /*Data*/ + Data *models.WritableRearPort + /*ID + A unique integer value identifying this rear port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) WithTimeout(timeout time.Duration) *DcimRearPortsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) WithContext(ctx context.Context) *DcimRearPortsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) WithHTTPClient(client *http.Client) *DcimRearPortsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) WithData(data *models.WritableRearPort) *DcimRearPortsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) SetData(data *models.WritableRearPort) { + o.Data = data +} + +// WithID adds the id to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) WithID(id int64) *DcimRearPortsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rear ports update params +func (o *DcimRearPortsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRearPortsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rear_ports_update_responses.go b/netbox/client/dcim/dcim_rear_ports_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3b0b796c023d92827348871860a29475d31d02d3 --- /dev/null +++ b/netbox/client/dcim/dcim_rear_ports_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package dcim + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// DcimRearPortsUpdateReader is a Reader for the DcimRearPortsUpdate structure. +type DcimRearPortsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRearPortsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRearPortsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimRearPortsUpdateOK creates a DcimRearPortsUpdateOK with default headers values +func NewDcimRearPortsUpdateOK() *DcimRearPortsUpdateOK { + return &DcimRearPortsUpdateOK{} +} + +/*DcimRearPortsUpdateOK handles this case with default header values. + +DcimRearPortsUpdateOK dcim rear ports update o k +*/ +type DcimRearPortsUpdateOK struct { + Payload *models.RearPort +} + +func (o *DcimRearPortsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/rear-ports/{id}/][%d] dcimRearPortsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRearPortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RearPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_regions_create_parameters.go b/netbox/client/dcim/dcim_regions_create_parameters.go index e92d2bc94e94a9b18c125bb86d2eb23e77430189..34a03e0c82c52fc43b311f6230b1459876db2ca8 100644 --- a/netbox/client/dcim/dcim_regions_create_parameters.go +++ b/netbox/client/dcim/dcim_regions_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRegionsCreateParams creates a new DcimRegionsCreateParams object diff --git a/netbox/client/dcim/dcim_regions_create_responses.go b/netbox/client/dcim/dcim_regions_create_responses.go index b9e91f6e65bb14f37fb6f965c31306aa672274b0..3752ff1bb0e80d9e78aa163b8e402a35fda68294 100644 --- a/netbox/client/dcim/dcim_regions_create_responses.go +++ b/netbox/client/dcim/dcim_regions_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRegionsCreateReader is a Reader for the DcimRegionsCreate structure. @@ -61,7 +61,7 @@ func NewDcimRegionsCreateCreated() *DcimRegionsCreateCreated { DcimRegionsCreateCreated dcim regions create created */ type DcimRegionsCreateCreated struct { - Payload *models.WritableRegion + Payload *models.Region } func (o *DcimRegionsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRegionsCreateCreated) Error() string { func (o *DcimRegionsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRegion) + o.Payload = new(models.Region) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_regions_delete_parameters.go b/netbox/client/dcim/dcim_regions_delete_parameters.go index 001cd00122597615eab07e335c0aaa51dd481a52..c3a04bed54ae600b4d548fe7ee0172ca20bc3730 100644 --- a/netbox/client/dcim/dcim_regions_delete_parameters.go +++ b/netbox/client/dcim/dcim_regions_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_regions_list_parameters.go b/netbox/client/dcim/dcim_regions_list_parameters.go index af8bf62e050bb2d9833ca43a72a71410364a1cec..3ee2b9dcc31815d45e4cd1dc092d75838d8bc4d2 100644 --- a/netbox/client/dcim/dcim_regions_list_parameters.go +++ b/netbox/client/dcim/dcim_regions_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the dcim regions list operation typically these are written to a http.Reques */ type DcimRegionsListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -136,6 +137,17 @@ func (o *DcimRegionsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the dcim regions list params +func (o *DcimRegionsListParams) WithID(id *string) *DcimRegionsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions list params +func (o *DcimRegionsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the dcim regions list params func (o *DcimRegionsListParams) WithLimit(limit *int64) *DcimRegionsListParams { o.SetLimit(limit) @@ -221,6 +233,22 @@ func (o *DcimRegionsListParams) WriteToRequest(r runtime.ClientRequest, reg strf } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit diff --git a/netbox/client/dcim/dcim_regions_list_responses.go b/netbox/client/dcim/dcim_regions_list_responses.go index c28c76cc404fa91483990aab139d8dd58e62ca65..d86dc2c73201c3fc8056946736ce0911c30a96e2 100644 --- a/netbox/client/dcim/dcim_regions_list_responses.go +++ b/netbox/client/dcim/dcim_regions_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRegionsListReader is a Reader for the DcimRegionsList structure. @@ -61,7 +65,7 @@ func NewDcimRegionsListOK() *DcimRegionsListOK { DcimRegionsListOK dcim regions list o k */ type DcimRegionsListOK struct { - Payload *models.DcimRegionsListOKBody + Payload *DcimRegionsListOKBody } func (o *DcimRegionsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimRegionsListOK) Error() string { func (o *DcimRegionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimRegionsListOKBody) + o.Payload = new(DcimRegionsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimRegionsListOK) readResponse(response runtime.ClientResponse, consum return nil } + +/*DcimRegionsListOKBody dcim regions list o k body +swagger:model DcimRegionsListOKBody +*/ +type DcimRegionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Region `json:"results"` +} + +// Validate validates this dcim regions list o k body +func (o *DcimRegionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimRegionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimRegionsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimRegionsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimRegionsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRegionsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimRegionsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimRegionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimRegionsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimRegionsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimRegionsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimRegionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRegionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_regions_partial_update_parameters.go b/netbox/client/dcim/dcim_regions_partial_update_parameters.go index 2746650817c465d8458f463f4d18126ac8fbfbc0..b5a75c08430693bb80e5f57a6c6b4d2d44d4cc04 100644 --- a/netbox/client/dcim/dcim_regions_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_regions_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRegionsPartialUpdateParams creates a new DcimRegionsPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_regions_partial_update_responses.go b/netbox/client/dcim/dcim_regions_partial_update_responses.go index fe2817de7234928e7a6b3dfd08291a7bf26b04c9..22fdf8c8adf5046fa38426edeef17089a7856440 100644 --- a/netbox/client/dcim/dcim_regions_partial_update_responses.go +++ b/netbox/client/dcim/dcim_regions_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRegionsPartialUpdateReader is a Reader for the DcimRegionsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimRegionsPartialUpdateOK() *DcimRegionsPartialUpdateOK { DcimRegionsPartialUpdateOK dcim regions partial update o k */ type DcimRegionsPartialUpdateOK struct { - Payload *models.WritableRegion + Payload *models.Region } func (o *DcimRegionsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRegionsPartialUpdateOK) Error() string { func (o *DcimRegionsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRegion) + o.Payload = new(models.Region) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_regions_read_parameters.go b/netbox/client/dcim/dcim_regions_read_parameters.go index 090efe6b7b62f092e1d1999e69f840b32bfccad0..bc27b1fcb632199263cc54b3d3d04cd5feb9993d 100644 --- a/netbox/client/dcim/dcim_regions_read_parameters.go +++ b/netbox/client/dcim/dcim_regions_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_regions_read_responses.go b/netbox/client/dcim/dcim_regions_read_responses.go index 48ef939e2dd80cde86c73016fd94403335aa4888..efbc958db77309390c80f9551fbccd07f4343523 100644 --- a/netbox/client/dcim/dcim_regions_read_responses.go +++ b/netbox/client/dcim/dcim_regions_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRegionsReadReader is a Reader for the DcimRegionsRead structure. diff --git a/netbox/client/dcim/dcim_regions_update_parameters.go b/netbox/client/dcim/dcim_regions_update_parameters.go index 18d5648c801fe2301513976810a17314d7f1a2cc..16f2f4528804eb0da483ea9cea108dae58477b5f 100644 --- a/netbox/client/dcim/dcim_regions_update_parameters.go +++ b/netbox/client/dcim/dcim_regions_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimRegionsUpdateParams creates a new DcimRegionsUpdateParams object diff --git a/netbox/client/dcim/dcim_regions_update_responses.go b/netbox/client/dcim/dcim_regions_update_responses.go index 6c6f377972e16c39c5ffc5166335f5b296ad9ed5..514a72a2c1ac7c96e5ffb4309dabb2cc200e2e4c 100644 --- a/netbox/client/dcim/dcim_regions_update_responses.go +++ b/netbox/client/dcim/dcim_regions_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimRegionsUpdateReader is a Reader for the DcimRegionsUpdate structure. @@ -61,7 +61,7 @@ func NewDcimRegionsUpdateOK() *DcimRegionsUpdateOK { DcimRegionsUpdateOK dcim regions update o k */ type DcimRegionsUpdateOK struct { - Payload *models.WritableRegion + Payload *models.Region } func (o *DcimRegionsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimRegionsUpdateOK) Error() string { func (o *DcimRegionsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableRegion) + o.Payload = new(models.Region) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_sites_create_parameters.go b/netbox/client/dcim/dcim_sites_create_parameters.go index 1af9f1678242c4cf709dc345001599087da70119..139904499870f94d7db2f05f2dedcd4e087f846d 100644 --- a/netbox/client/dcim/dcim_sites_create_parameters.go +++ b/netbox/client/dcim/dcim_sites_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimSitesCreateParams creates a new DcimSitesCreateParams object diff --git a/netbox/client/dcim/dcim_sites_create_responses.go b/netbox/client/dcim/dcim_sites_create_responses.go index 9090ff922dfba9c41edec084b4cf07cae85884fc..ae18aaea539a8f87e8afc613dbc0d812f1ffeb68 100644 --- a/netbox/client/dcim/dcim_sites_create_responses.go +++ b/netbox/client/dcim/dcim_sites_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimSitesCreateReader is a Reader for the DcimSitesCreate structure. @@ -61,7 +61,7 @@ func NewDcimSitesCreateCreated() *DcimSitesCreateCreated { DcimSitesCreateCreated dcim sites create created */ type DcimSitesCreateCreated struct { - Payload *models.WritableSite + Payload *models.Site } func (o *DcimSitesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimSitesCreateCreated) Error() string { func (o *DcimSitesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableSite) + o.Payload = new(models.Site) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_sites_delete_parameters.go b/netbox/client/dcim/dcim_sites_delete_parameters.go index a486741a3854e609e2dce1eb716a4deaadf595c5..2b62654c541b402d5ff0120c617fe01ea839925d 100644 --- a/netbox/client/dcim/dcim_sites_delete_parameters.go +++ b/netbox/client/dcim/dcim_sites_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_sites_graphs_parameters.go b/netbox/client/dcim/dcim_sites_graphs_parameters.go index 29f2590cc14972ef139290ef968e1e35daf8e34c..793637857e728170516b69b207f4026088d75b39 100644 --- a/netbox/client/dcim/dcim_sites_graphs_parameters.go +++ b/netbox/client/dcim/dcim_sites_graphs_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_sites_graphs_responses.go b/netbox/client/dcim/dcim_sites_graphs_responses.go index 1120bcbd6b9aaa69ee21172f1883e69be5917bdb..f688210185c43843a3a9ec2ed789aa6087ed207e 100644 --- a/netbox/client/dcim/dcim_sites_graphs_responses.go +++ b/netbox/client/dcim/dcim_sites_graphs_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimSitesGraphsReader is a Reader for the DcimSitesGraphs structure. diff --git a/netbox/client/dcim/dcim_sites_list_parameters.go b/netbox/client/dcim/dcim_sites_list_parameters.go index 0257a566ce27b06253ef1aa7796da8390c9d6f45..dc2276f5a854f9b2818970e377d99f00b3f49c8f 100644 --- a/netbox/client/dcim/dcim_sites_list_parameters.go +++ b/netbox/client/dcim/dcim_sites_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -78,7 +77,7 @@ for the dcim sites list operation typically these are written to a http.Request type DcimSitesListParams struct { /*Asn*/ - Asn *float64 + Asn *string /*ContactEmail*/ ContactEmail *string /*ContactName*/ @@ -87,16 +86,22 @@ type DcimSitesListParams struct { ContactPhone *string /*Facility*/ Facility *string + /*ID*/ + ID *string /*IDIn Multiple values may be separated by commas. */ IDIn *string + /*Latitude*/ + Latitude *string /*Limit Number of results to return per page. */ Limit *int64 + /*Longitude*/ + Longitude *string /*Name*/ Name *string /*Offset @@ -114,8 +119,14 @@ type DcimSitesListParams struct { Slug *string /*Status*/ Status *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string @@ -158,13 +169,13 @@ func (o *DcimSitesListParams) SetHTTPClient(client *http.Client) { } // WithAsn adds the asn to the dcim sites list params -func (o *DcimSitesListParams) WithAsn(asn *float64) *DcimSitesListParams { +func (o *DcimSitesListParams) WithAsn(asn *string) *DcimSitesListParams { o.SetAsn(asn) return o } // SetAsn adds the asn to the dcim sites list params -func (o *DcimSitesListParams) SetAsn(asn *float64) { +func (o *DcimSitesListParams) SetAsn(asn *string) { o.Asn = asn } @@ -212,6 +223,17 @@ func (o *DcimSitesListParams) SetFacility(facility *string) { o.Facility = facility } +// WithID adds the id to the dcim sites list params +func (o *DcimSitesListParams) WithID(id *string) *DcimSitesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites list params +func (o *DcimSitesListParams) SetID(id *string) { + o.ID = id +} + // WithIDIn adds the iDIn to the dcim sites list params func (o *DcimSitesListParams) WithIDIn(iDIn *string) *DcimSitesListParams { o.SetIDIn(iDIn) @@ -223,6 +245,17 @@ func (o *DcimSitesListParams) SetIDIn(iDIn *string) { o.IDIn = iDIn } +// WithLatitude adds the latitude to the dcim sites list params +func (o *DcimSitesListParams) WithLatitude(latitude *string) *DcimSitesListParams { + o.SetLatitude(latitude) + return o +} + +// SetLatitude adds the latitude to the dcim sites list params +func (o *DcimSitesListParams) SetLatitude(latitude *string) { + o.Latitude = latitude +} + // WithLimit adds the limit to the dcim sites list params func (o *DcimSitesListParams) WithLimit(limit *int64) *DcimSitesListParams { o.SetLimit(limit) @@ -234,6 +267,17 @@ func (o *DcimSitesListParams) SetLimit(limit *int64) { o.Limit = limit } +// WithLongitude adds the longitude to the dcim sites list params +func (o *DcimSitesListParams) WithLongitude(longitude *string) *DcimSitesListParams { + o.SetLongitude(longitude) + return o +} + +// SetLongitude adds the longitude to the dcim sites list params +func (o *DcimSitesListParams) SetLongitude(longitude *string) { + o.Longitude = longitude +} + // WithName adds the name to the dcim sites list params func (o *DcimSitesListParams) WithName(name *string) *DcimSitesListParams { o.SetName(name) @@ -311,6 +355,17 @@ func (o *DcimSitesListParams) SetStatus(status *string) { o.Status = status } +// WithTag adds the tag to the dcim sites list params +func (o *DcimSitesListParams) WithTag(tag *string) *DcimSitesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the dcim sites list params +func (o *DcimSitesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the dcim sites list params func (o *DcimSitesListParams) WithTenant(tenant *string) *DcimSitesListParams { o.SetTenant(tenant) @@ -322,6 +377,28 @@ func (o *DcimSitesListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the dcim sites list params +func (o *DcimSitesListParams) WithTenantGroup(tenantGroup *string) *DcimSitesListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the dcim sites list params +func (o *DcimSitesListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the dcim sites list params +func (o *DcimSitesListParams) WithTenantGroupID(tenantGroupID *string) *DcimSitesListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the dcim sites list params +func (o *DcimSitesListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the dcim sites list params func (o *DcimSitesListParams) WithTenantID(tenantID *string) *DcimSitesListParams { o.SetTenantID(tenantID) @@ -344,11 +421,11 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt if o.Asn != nil { // query param asn - var qrAsn float64 + var qrAsn string if o.Asn != nil { qrAsn = *o.Asn } - qAsn := swag.FormatFloat64(qrAsn) + qAsn := qrAsn if qAsn != "" { if err := r.SetQueryParam("asn", qAsn); err != nil { return err @@ -421,6 +498,22 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.IDIn != nil { // query param id__in @@ -437,6 +530,22 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.Latitude != nil { + + // query param latitude + var qrLatitude string + if o.Latitude != nil { + qrLatitude = *o.Latitude + } + qLatitude := qrLatitude + if qLatitude != "" { + if err := r.SetQueryParam("latitude", qLatitude); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -453,6 +562,22 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.Longitude != nil { + + // query param longitude + var qrLongitude string + if o.Longitude != nil { + qrLongitude = *o.Longitude + } + qLongitude := qrLongitude + if qLongitude != "" { + if err := r.SetQueryParam("longitude", qLongitude); err != nil { + return err + } + } + + } + if o.Name != nil { // query param name @@ -565,6 +690,22 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -581,6 +722,38 @@ func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id diff --git a/netbox/client/dcim/dcim_sites_list_responses.go b/netbox/client/dcim/dcim_sites_list_responses.go index eb325618d1235d111ed3f53f4c0698998ad510a7..901039e1b6e3d34887508d13a76c09f75671ceda 100644 --- a/netbox/client/dcim/dcim_sites_list_responses.go +++ b/netbox/client/dcim/dcim_sites_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimSitesListReader is a Reader for the DcimSitesList structure. @@ -61,7 +65,7 @@ func NewDcimSitesListOK() *DcimSitesListOK { DcimSitesListOK dcim sites list o k */ type DcimSitesListOK struct { - Payload *models.DcimSitesListOKBody + Payload *DcimSitesListOKBody } func (o *DcimSitesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimSitesListOK) Error() string { func (o *DcimSitesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimSitesListOKBody) + o.Payload = new(DcimSitesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimSitesListOK) readResponse(response runtime.ClientResponse, consumer return nil } + +/*DcimSitesListOKBody dcim sites list o k body +swagger:model DcimSitesListOKBody +*/ +type DcimSitesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Site `json:"results"` +} + +// Validate validates this dcim sites list o k body +func (o *DcimSitesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimSitesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimSitesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimSitesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimSitesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimSitesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimSitesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimSitesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimSitesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimSitesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimSitesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimSitesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimSitesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_sites_partial_update_parameters.go b/netbox/client/dcim/dcim_sites_partial_update_parameters.go index d5dc8dbcf2b0085edfc04f9ec00a7f7c6daca1e6..dd6b42b366d77c1ad59d446432f96a7d4fa4039e 100644 --- a/netbox/client/dcim/dcim_sites_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_sites_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimSitesPartialUpdateParams creates a new DcimSitesPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_sites_partial_update_responses.go b/netbox/client/dcim/dcim_sites_partial_update_responses.go index dedc6abc98a0fc6ece19e93a059f7f7ced3867f1..0c8adcd5254db0219b8e347ac2f69c24a6e3e899 100644 --- a/netbox/client/dcim/dcim_sites_partial_update_responses.go +++ b/netbox/client/dcim/dcim_sites_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimSitesPartialUpdateReader is a Reader for the DcimSitesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimSitesPartialUpdateOK() *DcimSitesPartialUpdateOK { DcimSitesPartialUpdateOK dcim sites partial update o k */ type DcimSitesPartialUpdateOK struct { - Payload *models.WritableSite + Payload *models.Site } func (o *DcimSitesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimSitesPartialUpdateOK) Error() string { func (o *DcimSitesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableSite) + o.Payload = new(models.Site) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_sites_read_parameters.go b/netbox/client/dcim/dcim_sites_read_parameters.go index a2c977bd59a90207bc155fa962d341f3876ac780..ab14e1f3857c56967b998aac59af735a4c15334d 100644 --- a/netbox/client/dcim/dcim_sites_read_parameters.go +++ b/netbox/client/dcim/dcim_sites_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_sites_read_responses.go b/netbox/client/dcim/dcim_sites_read_responses.go index 9802b56ddb655f70851f84ecba3206a2bcdcd191..a6e916e295ebcdfa937a2dc4dc56761d7eda4bee 100644 --- a/netbox/client/dcim/dcim_sites_read_responses.go +++ b/netbox/client/dcim/dcim_sites_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimSitesReadReader is a Reader for the DcimSitesRead structure. diff --git a/netbox/client/dcim/dcim_sites_update_parameters.go b/netbox/client/dcim/dcim_sites_update_parameters.go index d029bf4ec7b8dd57f09952d5a2a3a7d409ed261b..8ac93a5c7cc9df0929fb0fb1308a5b52a3bb4f57 100644 --- a/netbox/client/dcim/dcim_sites_update_parameters.go +++ b/netbox/client/dcim/dcim_sites_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimSitesUpdateParams creates a new DcimSitesUpdateParams object diff --git a/netbox/client/dcim/dcim_sites_update_responses.go b/netbox/client/dcim/dcim_sites_update_responses.go index 58593723702b120eaef3187233feb121360846a0..b6b2cfee4d7b4736586a5c83df1422330a2127e7 100644 --- a/netbox/client/dcim/dcim_sites_update_responses.go +++ b/netbox/client/dcim/dcim_sites_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimSitesUpdateReader is a Reader for the DcimSitesUpdate structure. @@ -61,7 +61,7 @@ func NewDcimSitesUpdateOK() *DcimSitesUpdateOK { DcimSitesUpdateOK dcim sites update o k */ type DcimSitesUpdateOK struct { - Payload *models.WritableSite + Payload *models.Site } func (o *DcimSitesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimSitesUpdateOK) Error() string { func (o *DcimSitesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableSite) + o.Payload = new(models.Site) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go index ad68090c40e06211e2da874fe5b4f6d6f8fa30b7..7ed35f4a1fd25b69d9a116fe3a5e82fa93df1878 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go +++ b/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go @@ -20,18 +20,17 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimVirtualChassisCreateParams creates a new DcimVirtualChassisCreateParams object diff --git a/netbox/client/dcim/dcim_virtual_chassis_create_responses.go b/netbox/client/dcim/dcim_virtual_chassis_create_responses.go index 4ce8a553973a62be791da9b72cf6b8ba466a537a..115f0e422cf97575808db1a3dcc8a0f4df51c22d 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_create_responses.go +++ b/netbox/client/dcim/dcim_virtual_chassis_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimVirtualChassisCreateReader is a Reader for the DcimVirtualChassisCreate structure. @@ -61,7 +61,7 @@ func NewDcimVirtualChassisCreateCreated() *DcimVirtualChassisCreateCreated { DcimVirtualChassisCreateCreated dcim virtual chassis create created */ type DcimVirtualChassisCreateCreated struct { - Payload *models.WritableVirtualChassis + Payload *models.VirtualChassis } func (o *DcimVirtualChassisCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *DcimVirtualChassisCreateCreated) Error() string { func (o *DcimVirtualChassisCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVirtualChassis) + o.Payload = new(models.VirtualChassis) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go index 5040b2a240bc009cf2f7647bb2142d0eee01948c..7823923abd17e8c35b56633ecfb03d198ffe75d7 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go +++ b/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go index 58115c405f36c203218541ccb261cdb23b6bafb9..f6983e18483b6c00abe565a49ce020c6b57b5087 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go +++ b/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_virtual_chassis_list_responses.go b/netbox/client/dcim/dcim_virtual_chassis_list_responses.go index 9e7478323d9901bbb1b0b413b76a6bc8512fd4a4..9c7ec480da2f35717b62f204e8b6990949da7ed4 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_list_responses.go +++ b/netbox/client/dcim/dcim_virtual_chassis_list_responses.go @@ -22,12 +22,16 @@ package dcim import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimVirtualChassisListReader is a Reader for the DcimVirtualChassisList structure. @@ -61,7 +65,7 @@ func NewDcimVirtualChassisListOK() *DcimVirtualChassisListOK { DcimVirtualChassisListOK dcim virtual chassis list o k */ type DcimVirtualChassisListOK struct { - Payload *models.DcimVirtualChassisListOKBody + Payload *DcimVirtualChassisListOKBody } func (o *DcimVirtualChassisListOK) Error() string { @@ -70,7 +74,7 @@ func (o *DcimVirtualChassisListOK) Error() string { func (o *DcimVirtualChassisListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.DcimVirtualChassisListOKBody) + o.Payload = new(DcimVirtualChassisListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *DcimVirtualChassisListOK) readResponse(response runtime.ClientResponse, return nil } + +/*DcimVirtualChassisListOKBody dcim virtual chassis list o k body +swagger:model DcimVirtualChassisListOKBody +*/ +type DcimVirtualChassisListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.VirtualChassis `json:"results"` +} + +// Validate validates this dcim virtual chassis list o k body +func (o *DcimVirtualChassisListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DcimVirtualChassisListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("dcimVirtualChassisListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *DcimVirtualChassisListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("dcimVirtualChassisListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimVirtualChassisListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("dcimVirtualChassisListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *DcimVirtualChassisListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("dcimVirtualChassisListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dcimVirtualChassisListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *DcimVirtualChassisListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DcimVirtualChassisListOKBody) UnmarshalBinary(b []byte) error { + var res DcimVirtualChassisListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go index 3a80e2464df66155ddf241ad6ed7d3d683a39ad4..8525f7ab3484ec32fb00e66b3bc183087ba8ba7b 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimVirtualChassisPartialUpdateParams creates a new DcimVirtualChassisPartialUpdateParams object diff --git a/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go b/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go index 632af098aeca380b3f933c33ba730ea9ceb8477a..1c93de4905ad89160071b24ad4b6764e5dc8005e 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go +++ b/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimVirtualChassisPartialUpdateReader is a Reader for the DcimVirtualChassisPartialUpdate structure. @@ -61,7 +61,7 @@ func NewDcimVirtualChassisPartialUpdateOK() *DcimVirtualChassisPartialUpdateOK { DcimVirtualChassisPartialUpdateOK dcim virtual chassis partial update o k */ type DcimVirtualChassisPartialUpdateOK struct { - Payload *models.WritableVirtualChassis + Payload *models.VirtualChassis } func (o *DcimVirtualChassisPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimVirtualChassisPartialUpdateOK) Error() string { func (o *DcimVirtualChassisPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVirtualChassis) + o.Payload = new(models.VirtualChassis) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go index b991ae063707e2da396fd65139a413d2233bb0bb..58d2edbfba4fcd31f8475fd70dbed99ca8453ff9 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go +++ b/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/dcim/dcim_virtual_chassis_read_responses.go b/netbox/client/dcim/dcim_virtual_chassis_read_responses.go index 916f219e378594b02d3c1473c1352eddebdfd319..547f22f68f47163a32aa0e5f17634252c71351c2 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_read_responses.go +++ b/netbox/client/dcim/dcim_virtual_chassis_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimVirtualChassisReadReader is a Reader for the DcimVirtualChassisRead structure. diff --git a/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go index 659351aa361a59b9af49c2a21debbd6560d45e3b..63879b6ea09fefc202aca16ed9bf9248e7e2f9bf 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go +++ b/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go @@ -20,11 +20,10 @@ package dcim // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewDcimVirtualChassisUpdateParams creates a new DcimVirtualChassisUpdateParams object diff --git a/netbox/client/dcim/dcim_virtual_chassis_update_responses.go b/netbox/client/dcim/dcim_virtual_chassis_update_responses.go index b6ef92fdf516b3cdfcbd4853fc5ecfa83ea91505..c61b344e97f928e142b324f2f9a0d630350c6649 100644 --- a/netbox/client/dcim/dcim_virtual_chassis_update_responses.go +++ b/netbox/client/dcim/dcim_virtual_chassis_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // DcimVirtualChassisUpdateReader is a Reader for the DcimVirtualChassisUpdate structure. @@ -61,7 +61,7 @@ func NewDcimVirtualChassisUpdateOK() *DcimVirtualChassisUpdateOK { DcimVirtualChassisUpdateOK dcim virtual chassis update o k */ type DcimVirtualChassisUpdateOK struct { - Payload *models.WritableVirtualChassis + Payload *models.VirtualChassis } func (o *DcimVirtualChassisUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *DcimVirtualChassisUpdateOK) Error() string { func (o *DcimVirtualChassisUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVirtualChassis) + o.Payload = new(models.VirtualChassis) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_choices_list_parameters.go b/netbox/client/extras/extras_choices_list_parameters.go index 5451036f5d259be0b63f594c298e28ac0c016812..e26a3df9489b83eb7c480f39945db95547810bbc 100644 --- a/netbox/client/extras/extras_choices_list_parameters.go +++ b/netbox/client/extras/extras_choices_list_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_choices_read_parameters.go b/netbox/client/extras/extras_choices_read_parameters.go index 8ccd7a6991e98bf69bffdd910b30568ae9fb0601..aec6ea7d4052a076c5706b2aa96e160d4ee41b46 100644 --- a/netbox/client/extras/extras_choices_read_parameters.go +++ b/netbox/client/extras/extras_choices_read_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_client.go b/netbox/client/extras/extras_client.go index b13df41f7a8006da3b81a08eb07ffc1a14168f80..9ed6c3edca489fa13c7194938a21776f327740ce 100644 --- a/netbox/client/extras/extras_client.go +++ b/netbox/client/extras/extras_client.go @@ -96,6 +96,238 @@ func (a *Client) ExtrasChoicesRead(params *ExtrasChoicesReadParams, authInfo run } +/* +ExtrasCustomFieldChoicesList extras custom field choices list API +*/ +func (a *Client) ExtrasCustomFieldChoicesList(params *ExtrasCustomFieldChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasCustomFieldChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasCustomFieldChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras__custom_field_choices_list", + Method: "GET", + PathPattern: "/extras/_custom_field_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasCustomFieldChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasCustomFieldChoicesListOK), nil + +} + +/* +ExtrasCustomFieldChoicesRead extras custom field choices read API +*/ +func (a *Client) ExtrasCustomFieldChoicesRead(params *ExtrasCustomFieldChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasCustomFieldChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasCustomFieldChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras__custom_field_choices_read", + Method: "GET", + PathPattern: "/extras/_custom_field_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasCustomFieldChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasCustomFieldChoicesReadOK), nil + +} + +/* +ExtrasConfigContextsCreate extras config contexts create API +*/ +func (a *Client) ExtrasConfigContextsCreate(params *ExtrasConfigContextsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasConfigContextsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasConfigContextsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_config-contexts_create", + Method: "POST", + PathPattern: "/extras/config-contexts/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasConfigContextsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasConfigContextsCreateCreated), nil + +} + +/* +ExtrasConfigContextsDelete extras config contexts delete API +*/ +func (a *Client) ExtrasConfigContextsDelete(params *ExtrasConfigContextsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasConfigContextsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasConfigContextsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_config-contexts_delete", + Method: "DELETE", + PathPattern: "/extras/config-contexts/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasConfigContextsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasConfigContextsDeleteNoContent), nil + +} + +/* +ExtrasConfigContextsList Call to super to allow for caching +*/ +func (a *Client) ExtrasConfigContextsList(params *ExtrasConfigContextsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasConfigContextsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasConfigContextsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_config-contexts_list", + Method: "GET", + PathPattern: "/extras/config-contexts/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasConfigContextsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasConfigContextsListOK), nil + +} + +/* +ExtrasConfigContextsPartialUpdate extras config contexts partial update API +*/ +func (a *Client) ExtrasConfigContextsPartialUpdate(params *ExtrasConfigContextsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasConfigContextsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasConfigContextsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_config-contexts_partial_update", + Method: "PATCH", + PathPattern: "/extras/config-contexts/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasConfigContextsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasConfigContextsPartialUpdateOK), nil + +} + +/* +ExtrasConfigContextsRead Call to super to allow for caching +*/ +func (a *Client) ExtrasConfigContextsRead(params *ExtrasConfigContextsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasConfigContextsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasConfigContextsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_config-contexts_read", + Method: "GET", + PathPattern: "/extras/config-contexts/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasConfigContextsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasConfigContextsReadOK), nil + +} + +/* +ExtrasConfigContextsUpdate extras config contexts update API +*/ +func (a *Client) ExtrasConfigContextsUpdate(params *ExtrasConfigContextsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasConfigContextsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasConfigContextsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_config-contexts_update", + Method: "PUT", + PathPattern: "/extras/config-contexts/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasConfigContextsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasConfigContextsUpdateOK), nil + +} + /* ExtrasExportTemplatesCreate extras export templates create API */ @@ -155,7 +387,7 @@ func (a *Client) ExtrasExportTemplatesDelete(params *ExtrasExportTemplatesDelete } /* -ExtrasExportTemplatesList extras export templates list API +ExtrasExportTemplatesList Call to super to allow for caching */ func (a *Client) ExtrasExportTemplatesList(params *ExtrasExportTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesListOK, error) { // TODO: Validate the params before sending @@ -213,7 +445,7 @@ func (a *Client) ExtrasExportTemplatesPartialUpdate(params *ExtrasExportTemplate } /* -ExtrasExportTemplatesRead extras export templates read API +ExtrasExportTemplatesRead Call to super to allow for caching */ func (a *Client) ExtrasExportTemplatesRead(params *ExtrasExportTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesReadOK, error) { // TODO: Validate the params before sending @@ -329,7 +561,7 @@ func (a *Client) ExtrasGraphsDelete(params *ExtrasGraphsDeleteParams, authInfo r } /* -ExtrasGraphsList extras graphs list API +ExtrasGraphsList Call to super to allow for caching */ func (a *Client) ExtrasGraphsList(params *ExtrasGraphsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsListOK, error) { // TODO: Validate the params before sending @@ -387,7 +619,7 @@ func (a *Client) ExtrasGraphsPartialUpdate(params *ExtrasGraphsPartialUpdatePara } /* -ExtrasGraphsRead extras graphs read API +ExtrasGraphsRead Call to super to allow for caching */ func (a *Client) ExtrasGraphsRead(params *ExtrasGraphsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsReadOK, error) { // TODO: Validate the params before sending @@ -503,7 +735,7 @@ func (a *Client) ExtrasImageAttachmentsDelete(params *ExtrasImageAttachmentsDele } /* -ExtrasImageAttachmentsList extras image attachments list API +ExtrasImageAttachmentsList Call to super to allow for caching */ func (a *Client) ExtrasImageAttachmentsList(params *ExtrasImageAttachmentsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsListOK, error) { // TODO: Validate the params before sending @@ -561,7 +793,7 @@ func (a *Client) ExtrasImageAttachmentsPartialUpdate(params *ExtrasImageAttachme } /* -ExtrasImageAttachmentsRead extras image attachments read API +ExtrasImageAttachmentsRead Call to super to allow for caching */ func (a *Client) ExtrasImageAttachmentsRead(params *ExtrasImageAttachmentsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsReadOK, error) { // TODO: Validate the params before sending @@ -619,23 +851,52 @@ func (a *Client) ExtrasImageAttachmentsUpdate(params *ExtrasImageAttachmentsUpda } /* -ExtrasRecentActivityList List all UserActions to provide a log of recent activity. +ExtrasObjectChangesList Retrieve a list of recent changes. +*/ +func (a *Client) ExtrasObjectChangesList(params *ExtrasObjectChangesListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasObjectChangesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasObjectChangesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_object-changes_list", + Method: "GET", + PathPattern: "/extras/object-changes/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasObjectChangesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasObjectChangesListOK), nil + +} + +/* +ExtrasObjectChangesRead Retrieve a list of recent changes. */ -func (a *Client) ExtrasRecentActivityList(params *ExtrasRecentActivityListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasRecentActivityListOK, error) { +func (a *Client) ExtrasObjectChangesRead(params *ExtrasObjectChangesReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasObjectChangesReadOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewExtrasRecentActivityListParams() + params = NewExtrasObjectChangesReadParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "extras_recent-activity_list", + ID: "extras_object-changes_read", Method: "GET", - PathPattern: "/extras/recent-activity/", + PathPattern: "/extras/object-changes/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &ExtrasRecentActivityListReader{formats: a.formats}, + Reader: &ExtrasObjectChangesReadReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -643,28 +904,260 @@ func (a *Client) ExtrasRecentActivityList(params *ExtrasRecentActivityListParams if err != nil { return nil, err } - return result.(*ExtrasRecentActivityListOK), nil + return result.(*ExtrasObjectChangesReadOK), nil } /* -ExtrasRecentActivityRead List all UserActions to provide a log of recent activity. +ExtrasReportsList Compile all reports and their related results (if any). Result data is deferred in the list view. */ -func (a *Client) ExtrasRecentActivityRead(params *ExtrasRecentActivityReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasRecentActivityReadOK, error) { +func (a *Client) ExtrasReportsList(params *ExtrasReportsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasReportsListOK, error) { // TODO: Validate the params before sending if params == nil { - params = NewExtrasRecentActivityReadParams() + params = NewExtrasReportsListParams() } result, err := a.transport.Submit(&runtime.ClientOperation{ - ID: "extras_recent-activity_read", + ID: "extras_reports_list", Method: "GET", - PathPattern: "/extras/recent-activity/{id}/", + PathPattern: "/extras/reports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasReportsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasReportsListOK), nil + +} + +/* +ExtrasReportsRead Retrieve a single Report identified as "<module>.<report>". +*/ +func (a *Client) ExtrasReportsRead(params *ExtrasReportsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasReportsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasReportsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_reports_read", + Method: "GET", + PathPattern: "/extras/reports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasReportsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasReportsReadOK), nil + +} + +/* +ExtrasReportsRun Run a Report and create a new ReportResult, overwriting any previous result for the Report. +*/ +func (a *Client) ExtrasReportsRun(params *ExtrasReportsRunParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasReportsRunCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasReportsRunParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_reports_run", + Method: "POST", + PathPattern: "/extras/reports/{id}/run/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasReportsRunReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasReportsRunCreated), nil + +} + +/* +ExtrasTagsCreate extras tags create API +*/ +func (a *Client) ExtrasTagsCreate(params *ExtrasTagsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTagsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTagsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_tags_create", + Method: "POST", + PathPattern: "/extras/tags/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTagsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTagsCreateCreated), nil + +} + +/* +ExtrasTagsDelete extras tags delete API +*/ +func (a *Client) ExtrasTagsDelete(params *ExtrasTagsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTagsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTagsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_tags_delete", + Method: "DELETE", + PathPattern: "/extras/tags/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTagsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTagsDeleteNoContent), nil + +} + +/* +ExtrasTagsList Call to super to allow for caching +*/ +func (a *Client) ExtrasTagsList(params *ExtrasTagsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTagsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTagsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_tags_list", + Method: "GET", + PathPattern: "/extras/tags/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTagsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTagsListOK), nil + +} + +/* +ExtrasTagsPartialUpdate extras tags partial update API +*/ +func (a *Client) ExtrasTagsPartialUpdate(params *ExtrasTagsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTagsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTagsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_tags_partial_update", + Method: "PATCH", + PathPattern: "/extras/tags/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTagsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTagsPartialUpdateOK), nil + +} + +/* +ExtrasTagsRead Call to super to allow for caching +*/ +func (a *Client) ExtrasTagsRead(params *ExtrasTagsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTagsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTagsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_tags_read", + Method: "GET", + PathPattern: "/extras/tags/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTagsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTagsReadOK), nil + +} + +/* +ExtrasTagsUpdate extras tags update API +*/ +func (a *Client) ExtrasTagsUpdate(params *ExtrasTagsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTagsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTagsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_tags_update", + Method: "PUT", + PathPattern: "/extras/tags/{id}/", ProducesMediaTypes: []string{"application/json"}, ConsumesMediaTypes: []string{"application/json"}, Schemes: []string{"http"}, Params: params, - Reader: &ExtrasRecentActivityReadReader{formats: a.formats}, + Reader: &ExtrasTagsUpdateReader{formats: a.formats}, AuthInfo: authInfo, Context: params.Context, Client: params.HTTPClient, @@ -672,7 +1165,7 @@ func (a *Client) ExtrasRecentActivityRead(params *ExtrasRecentActivityReadParams if err != nil { return nil, err } - return result.(*ExtrasRecentActivityReadOK), nil + return result.(*ExtrasTagsUpdateOK), nil } @@ -735,7 +1228,7 @@ func (a *Client) ExtrasTopologyMapsDelete(params *ExtrasTopologyMapsDeleteParams } /* -ExtrasTopologyMapsList extras topology maps list API +ExtrasTopologyMapsList Call to super to allow for caching */ func (a *Client) ExtrasTopologyMapsList(params *ExtrasTopologyMapsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsListOK, error) { // TODO: Validate the params before sending @@ -793,7 +1286,7 @@ func (a *Client) ExtrasTopologyMapsPartialUpdate(params *ExtrasTopologyMapsParti } /* -ExtrasTopologyMapsRead extras topology maps read API +ExtrasTopologyMapsRead Call to super to allow for caching */ func (a *Client) ExtrasTopologyMapsRead(params *ExtrasTopologyMapsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsReadOK, error) { // TODO: Validate the params before sending diff --git a/netbox/client/extras/extras_config_contexts_create_parameters.go b/netbox/client/extras/extras_config_contexts_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c832e5e5271ead693548f04803c984036f7a4da9 --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasConfigContextsCreateParams creates a new ExtrasConfigContextsCreateParams object +// with the default values initialized. +func NewExtrasConfigContextsCreateParams() *ExtrasConfigContextsCreateParams { + var () + return &ExtrasConfigContextsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasConfigContextsCreateParamsWithTimeout creates a new ExtrasConfigContextsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasConfigContextsCreateParamsWithTimeout(timeout time.Duration) *ExtrasConfigContextsCreateParams { + var () + return &ExtrasConfigContextsCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasConfigContextsCreateParamsWithContext creates a new ExtrasConfigContextsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasConfigContextsCreateParamsWithContext(ctx context.Context) *ExtrasConfigContextsCreateParams { + var () + return &ExtrasConfigContextsCreateParams{ + + Context: ctx, + } +} + +// NewExtrasConfigContextsCreateParamsWithHTTPClient creates a new ExtrasConfigContextsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasConfigContextsCreateParamsWithHTTPClient(client *http.Client) *ExtrasConfigContextsCreateParams { + var () + return &ExtrasConfigContextsCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasConfigContextsCreateParams contains all the parameters to send to the API endpoint +for the extras config contexts create operation typically these are written to a http.Request +*/ +type ExtrasConfigContextsCreateParams struct { + + /*Data*/ + Data *models.WritableConfigContext + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras config contexts create params +func (o *ExtrasConfigContextsCreateParams) WithTimeout(timeout time.Duration) *ExtrasConfigContextsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras config contexts create params +func (o *ExtrasConfigContextsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras config contexts create params +func (o *ExtrasConfigContextsCreateParams) WithContext(ctx context.Context) *ExtrasConfigContextsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras config contexts create params +func (o *ExtrasConfigContextsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras config contexts create params +func (o *ExtrasConfigContextsCreateParams) WithHTTPClient(client *http.Client) *ExtrasConfigContextsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras config contexts create params +func (o *ExtrasConfigContextsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras config contexts create params +func (o *ExtrasConfigContextsCreateParams) WithData(data *models.WritableConfigContext) *ExtrasConfigContextsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras config contexts create params +func (o *ExtrasConfigContextsCreateParams) SetData(data *models.WritableConfigContext) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasConfigContextsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_create_responses.go b/netbox/client/extras/extras_config_contexts_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..79487e8a9bb5d5211053efae1ab1be26cccf15e7 --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasConfigContextsCreateReader is a Reader for the ExtrasConfigContextsCreate structure. +type ExtrasConfigContextsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasConfigContextsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasConfigContextsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasConfigContextsCreateCreated creates a ExtrasConfigContextsCreateCreated with default headers values +func NewExtrasConfigContextsCreateCreated() *ExtrasConfigContextsCreateCreated { + return &ExtrasConfigContextsCreateCreated{} +} + +/*ExtrasConfigContextsCreateCreated handles this case with default header values. + +ExtrasConfigContextsCreateCreated extras config contexts create created +*/ +type ExtrasConfigContextsCreateCreated struct { + Payload *models.ConfigContext +} + +func (o *ExtrasConfigContextsCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/config-contexts/][%d] extrasConfigContextsCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasConfigContextsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConfigContext) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_delete_parameters.go b/netbox/client/extras/extras_config_contexts_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..022fabbd664a3b16766b2f2804f705fbd4c5d3dd --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasConfigContextsDeleteParams creates a new ExtrasConfigContextsDeleteParams object +// with the default values initialized. +func NewExtrasConfigContextsDeleteParams() *ExtrasConfigContextsDeleteParams { + var () + return &ExtrasConfigContextsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasConfigContextsDeleteParamsWithTimeout creates a new ExtrasConfigContextsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasConfigContextsDeleteParamsWithTimeout(timeout time.Duration) *ExtrasConfigContextsDeleteParams { + var () + return &ExtrasConfigContextsDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasConfigContextsDeleteParamsWithContext creates a new ExtrasConfigContextsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasConfigContextsDeleteParamsWithContext(ctx context.Context) *ExtrasConfigContextsDeleteParams { + var () + return &ExtrasConfigContextsDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasConfigContextsDeleteParamsWithHTTPClient creates a new ExtrasConfigContextsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasConfigContextsDeleteParamsWithHTTPClient(client *http.Client) *ExtrasConfigContextsDeleteParams { + var () + return &ExtrasConfigContextsDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasConfigContextsDeleteParams contains all the parameters to send to the API endpoint +for the extras config contexts delete operation typically these are written to a http.Request +*/ +type ExtrasConfigContextsDeleteParams struct { + + /*ID + A unique integer value identifying this config context. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras config contexts delete params +func (o *ExtrasConfigContextsDeleteParams) WithTimeout(timeout time.Duration) *ExtrasConfigContextsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras config contexts delete params +func (o *ExtrasConfigContextsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras config contexts delete params +func (o *ExtrasConfigContextsDeleteParams) WithContext(ctx context.Context) *ExtrasConfigContextsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras config contexts delete params +func (o *ExtrasConfigContextsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras config contexts delete params +func (o *ExtrasConfigContextsDeleteParams) WithHTTPClient(client *http.Client) *ExtrasConfigContextsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras config contexts delete params +func (o *ExtrasConfigContextsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras config contexts delete params +func (o *ExtrasConfigContextsDeleteParams) WithID(id int64) *ExtrasConfigContextsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras config contexts delete params +func (o *ExtrasConfigContextsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasConfigContextsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_delete_responses.go b/netbox/client/extras/extras_config_contexts_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8d1e25f2a0ebd02395599a62b9449363ff7122d4 --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasConfigContextsDeleteReader is a Reader for the ExtrasConfigContextsDelete structure. +type ExtrasConfigContextsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasConfigContextsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasConfigContextsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasConfigContextsDeleteNoContent creates a ExtrasConfigContextsDeleteNoContent with default headers values +func NewExtrasConfigContextsDeleteNoContent() *ExtrasConfigContextsDeleteNoContent { + return &ExtrasConfigContextsDeleteNoContent{} +} + +/*ExtrasConfigContextsDeleteNoContent handles this case with default header values. + +ExtrasConfigContextsDeleteNoContent extras config contexts delete no content +*/ +type ExtrasConfigContextsDeleteNoContent struct { +} + +func (o *ExtrasConfigContextsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/config-contexts/{id}/][%d] extrasConfigContextsDeleteNoContent ", 204) +} + +func (o *ExtrasConfigContextsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_list_parameters.go b/netbox/client/extras/extras_config_contexts_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7a1151010f0bc66b211f14561b194196504e79e8 --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_list_parameters.go @@ -0,0 +1,629 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasConfigContextsListParams creates a new ExtrasConfigContextsListParams object +// with the default values initialized. +func NewExtrasConfigContextsListParams() *ExtrasConfigContextsListParams { + var () + return &ExtrasConfigContextsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasConfigContextsListParamsWithTimeout creates a new ExtrasConfigContextsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasConfigContextsListParamsWithTimeout(timeout time.Duration) *ExtrasConfigContextsListParams { + var () + return &ExtrasConfigContextsListParams{ + + timeout: timeout, + } +} + +// NewExtrasConfigContextsListParamsWithContext creates a new ExtrasConfigContextsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasConfigContextsListParamsWithContext(ctx context.Context) *ExtrasConfigContextsListParams { + var () + return &ExtrasConfigContextsListParams{ + + Context: ctx, + } +} + +// NewExtrasConfigContextsListParamsWithHTTPClient creates a new ExtrasConfigContextsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasConfigContextsListParamsWithHTTPClient(client *http.Client) *ExtrasConfigContextsListParams { + var () + return &ExtrasConfigContextsListParams{ + HTTPClient: client, + } +} + +/*ExtrasConfigContextsListParams contains all the parameters to send to the API endpoint +for the extras config contexts list operation typically these are written to a http.Request +*/ +type ExtrasConfigContextsListParams struct { + + /*IsActive*/ + IsActive *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Platform*/ + Platform *string + /*PlatformID*/ + PlatformID *string + /*Q*/ + Q *string + /*Region*/ + Region *string + /*RegionID*/ + RegionID *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Tenant*/ + Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string + /*TenantID*/ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithTimeout(timeout time.Duration) *ExtrasConfigContextsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithContext(ctx context.Context) *ExtrasConfigContextsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithHTTPClient(client *http.Client) *ExtrasConfigContextsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIsActive adds the isActive to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithIsActive(isActive *string) *ExtrasConfigContextsListParams { + o.SetIsActive(isActive) + return o +} + +// SetIsActive adds the isActive to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetIsActive(isActive *string) { + o.IsActive = isActive +} + +// WithLimit adds the limit to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithLimit(limit *int64) *ExtrasConfigContextsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithName(name *string) *ExtrasConfigContextsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithOffset(offset *int64) *ExtrasConfigContextsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlatform adds the platform to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithPlatform(platform *string) *ExtrasConfigContextsListParams { + o.SetPlatform(platform) + return o +} + +// SetPlatform adds the platform to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetPlatform(platform *string) { + o.Platform = platform +} + +// WithPlatformID adds the platformID to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithPlatformID(platformID *string) *ExtrasConfigContextsListParams { + o.SetPlatformID(platformID) + return o +} + +// SetPlatformID adds the platformId to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetPlatformID(platformID *string) { + o.PlatformID = platformID +} + +// WithQ adds the q to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithQ(q *string) *ExtrasConfigContextsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRegion adds the region to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithRegion(region *string) *ExtrasConfigContextsListParams { + o.SetRegion(region) + return o +} + +// SetRegion adds the region to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetRegion(region *string) { + o.Region = region +} + +// WithRegionID adds the regionID to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithRegionID(regionID *string) *ExtrasConfigContextsListParams { + o.SetRegionID(regionID) + return o +} + +// SetRegionID adds the regionId to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetRegionID(regionID *string) { + o.RegionID = regionID +} + +// WithRole adds the role to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithRole(role *string) *ExtrasConfigContextsListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithRoleID(roleID *string) *ExtrasConfigContextsListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSite adds the site to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithSite(site *string) *ExtrasConfigContextsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithSiteID(siteID *string) *ExtrasConfigContextsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithTenant adds the tenant to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithTenant(tenant *string) *ExtrasConfigContextsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantGroup adds the tenantGroup to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithTenantGroup(tenantGroup *string) *ExtrasConfigContextsListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithTenantGroupID(tenantGroupID *string) *ExtrasConfigContextsListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + +// WithTenantID adds the tenantID to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) WithTenantID(tenantID *string) *ExtrasConfigContextsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the extras config contexts list params +func (o *ExtrasConfigContextsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasConfigContextsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IsActive != nil { + + // query param is_active + var qrIsActive string + if o.IsActive != nil { + qrIsActive = *o.IsActive + } + qIsActive := qrIsActive + if qIsActive != "" { + if err := r.SetQueryParam("is_active", qIsActive); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Platform != nil { + + // query param platform + var qrPlatform string + if o.Platform != nil { + qrPlatform = *o.Platform + } + qPlatform := qrPlatform + if qPlatform != "" { + if err := r.SetQueryParam("platform", qPlatform); err != nil { + return err + } + } + + } + + if o.PlatformID != nil { + + // query param platform_id + var qrPlatformID string + if o.PlatformID != nil { + qrPlatformID = *o.PlatformID + } + qPlatformID := qrPlatformID + if qPlatformID != "" { + if err := r.SetQueryParam("platform_id", qPlatformID); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Region != nil { + + // query param region + var qrRegion string + if o.Region != nil { + qrRegion = *o.Region + } + qRegion := qrRegion + if qRegion != "" { + if err := r.SetQueryParam("region", qRegion); err != nil { + return err + } + } + + } + + if o.RegionID != nil { + + // query param region_id + var qrRegionID string + if o.RegionID != nil { + qrRegionID = *o.RegionID + } + qRegionID := qrRegionID + if qRegionID != "" { + if err := r.SetQueryParam("region_id", qRegionID); err != nil { + return err + } + } + + } + + if o.Role != nil { + + // query param role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + + } + + if o.RoleID != nil { + + // query param role_id + var qrRoleID string + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + if err := r.SetQueryParam("role_id", qRoleID); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Tenant != nil { + + // query param tenant + var qrTenant string + if o.Tenant != nil { + qrTenant = *o.Tenant + } + qTenant := qrTenant + if qTenant != "" { + if err := r.SetQueryParam("tenant", qTenant); err != nil { + return err + } + } + + } + + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + + if o.TenantID != nil { + + // query param tenant_id + var qrTenantID string + if o.TenantID != nil { + qrTenantID = *o.TenantID + } + qTenantID := qrTenantID + if qTenantID != "" { + if err := r.SetQueryParam("tenant_id", qTenantID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_list_responses.go b/netbox/client/extras/extras_config_contexts_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ff41825d7b2cc0aae4d96388bc17d70c1e333906 --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasConfigContextsListReader is a Reader for the ExtrasConfigContextsList structure. +type ExtrasConfigContextsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasConfigContextsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasConfigContextsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasConfigContextsListOK creates a ExtrasConfigContextsListOK with default headers values +func NewExtrasConfigContextsListOK() *ExtrasConfigContextsListOK { + return &ExtrasConfigContextsListOK{} +} + +/*ExtrasConfigContextsListOK handles this case with default header values. + +ExtrasConfigContextsListOK extras config contexts list o k +*/ +type ExtrasConfigContextsListOK struct { + Payload *ExtrasConfigContextsListOKBody +} + +func (o *ExtrasConfigContextsListOK) Error() string { + return fmt.Sprintf("[GET /extras/config-contexts/][%d] extrasConfigContextsListOK %+v", 200, o.Payload) +} + +func (o *ExtrasConfigContextsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ExtrasConfigContextsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ExtrasConfigContextsListOKBody extras config contexts list o k body +swagger:model ExtrasConfigContextsListOKBody +*/ +type ExtrasConfigContextsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ConfigContext `json:"results"` +} + +// Validate validates this extras config contexts list o k body +func (o *ExtrasConfigContextsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ExtrasConfigContextsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("extrasConfigContextsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *ExtrasConfigContextsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("extrasConfigContextsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasConfigContextsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("extrasConfigContextsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasConfigContextsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("extrasConfigContextsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extrasConfigContextsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ExtrasConfigContextsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ExtrasConfigContextsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasConfigContextsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_partial_update_parameters.go b/netbox/client/extras/extras_config_contexts_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..debda1b55b36f76f53b16233b98de188967031d2 --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasConfigContextsPartialUpdateParams creates a new ExtrasConfigContextsPartialUpdateParams object +// with the default values initialized. +func NewExtrasConfigContextsPartialUpdateParams() *ExtrasConfigContextsPartialUpdateParams { + var () + return &ExtrasConfigContextsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasConfigContextsPartialUpdateParamsWithTimeout creates a new ExtrasConfigContextsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasConfigContextsPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasConfigContextsPartialUpdateParams { + var () + return &ExtrasConfigContextsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasConfigContextsPartialUpdateParamsWithContext creates a new ExtrasConfigContextsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasConfigContextsPartialUpdateParamsWithContext(ctx context.Context) *ExtrasConfigContextsPartialUpdateParams { + var () + return &ExtrasConfigContextsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasConfigContextsPartialUpdateParamsWithHTTPClient creates a new ExtrasConfigContextsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasConfigContextsPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasConfigContextsPartialUpdateParams { + var () + return &ExtrasConfigContextsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasConfigContextsPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras config contexts partial update operation typically these are written to a http.Request +*/ +type ExtrasConfigContextsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConfigContext + /*ID + A unique integer value identifying this config context. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasConfigContextsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) WithContext(ctx context.Context) *ExtrasConfigContextsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasConfigContextsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) WithData(data *models.WritableConfigContext) *ExtrasConfigContextsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) SetData(data *models.WritableConfigContext) { + o.Data = data +} + +// WithID adds the id to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) WithID(id int64) *ExtrasConfigContextsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras config contexts partial update params +func (o *ExtrasConfigContextsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasConfigContextsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_partial_update_responses.go b/netbox/client/extras/extras_config_contexts_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7240d21dae2fc97a38508619ae33e0835a006fad --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasConfigContextsPartialUpdateReader is a Reader for the ExtrasConfigContextsPartialUpdate structure. +type ExtrasConfigContextsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasConfigContextsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasConfigContextsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasConfigContextsPartialUpdateOK creates a ExtrasConfigContextsPartialUpdateOK with default headers values +func NewExtrasConfigContextsPartialUpdateOK() *ExtrasConfigContextsPartialUpdateOK { + return &ExtrasConfigContextsPartialUpdateOK{} +} + +/*ExtrasConfigContextsPartialUpdateOK handles this case with default header values. + +ExtrasConfigContextsPartialUpdateOK extras config contexts partial update o k +*/ +type ExtrasConfigContextsPartialUpdateOK struct { + Payload *models.ConfigContext +} + +func (o *ExtrasConfigContextsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/config-contexts/{id}/][%d] extrasConfigContextsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasConfigContextsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConfigContext) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_read_parameters.go b/netbox/client/extras/extras_config_contexts_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b3fa3545f7b418c372d309b61a7df870d345b263 --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasConfigContextsReadParams creates a new ExtrasConfigContextsReadParams object +// with the default values initialized. +func NewExtrasConfigContextsReadParams() *ExtrasConfigContextsReadParams { + var () + return &ExtrasConfigContextsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasConfigContextsReadParamsWithTimeout creates a new ExtrasConfigContextsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasConfigContextsReadParamsWithTimeout(timeout time.Duration) *ExtrasConfigContextsReadParams { + var () + return &ExtrasConfigContextsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasConfigContextsReadParamsWithContext creates a new ExtrasConfigContextsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasConfigContextsReadParamsWithContext(ctx context.Context) *ExtrasConfigContextsReadParams { + var () + return &ExtrasConfigContextsReadParams{ + + Context: ctx, + } +} + +// NewExtrasConfigContextsReadParamsWithHTTPClient creates a new ExtrasConfigContextsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasConfigContextsReadParamsWithHTTPClient(client *http.Client) *ExtrasConfigContextsReadParams { + var () + return &ExtrasConfigContextsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasConfigContextsReadParams contains all the parameters to send to the API endpoint +for the extras config contexts read operation typically these are written to a http.Request +*/ +type ExtrasConfigContextsReadParams struct { + + /*ID + A unique integer value identifying this config context. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras config contexts read params +func (o *ExtrasConfigContextsReadParams) WithTimeout(timeout time.Duration) *ExtrasConfigContextsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras config contexts read params +func (o *ExtrasConfigContextsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras config contexts read params +func (o *ExtrasConfigContextsReadParams) WithContext(ctx context.Context) *ExtrasConfigContextsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras config contexts read params +func (o *ExtrasConfigContextsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras config contexts read params +func (o *ExtrasConfigContextsReadParams) WithHTTPClient(client *http.Client) *ExtrasConfigContextsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras config contexts read params +func (o *ExtrasConfigContextsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras config contexts read params +func (o *ExtrasConfigContextsReadParams) WithID(id int64) *ExtrasConfigContextsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras config contexts read params +func (o *ExtrasConfigContextsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasConfigContextsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_recent_activity_read_responses.go b/netbox/client/extras/extras_config_contexts_read_responses.go similarity index 63% rename from netbox/client/extras/extras_recent_activity_read_responses.go rename to netbox/client/extras/extras_config_contexts_read_responses.go index 9efb16a30d4ffe73ed8832cd7770e4a3251f83a7..c28989aee6a62301e94b0dddbc90155c82d6d0f4 100644 --- a/netbox/client/extras/extras_recent_activity_read_responses.go +++ b/netbox/client/extras/extras_config_contexts_read_responses.go @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// ExtrasRecentActivityReadReader is a Reader for the ExtrasRecentActivityRead structure. -type ExtrasRecentActivityReadReader struct { +// ExtrasConfigContextsReadReader is a Reader for the ExtrasConfigContextsRead structure. +type ExtrasConfigContextsReadReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *ExtrasRecentActivityReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ExtrasConfigContextsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewExtrasRecentActivityReadOK() + result := NewExtrasConfigContextsReadOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *ExtrasRecentActivityReadReader) ReadResponse(response runtime.ClientRes } } -// NewExtrasRecentActivityReadOK creates a ExtrasRecentActivityReadOK with default headers values -func NewExtrasRecentActivityReadOK() *ExtrasRecentActivityReadOK { - return &ExtrasRecentActivityReadOK{} +// NewExtrasConfigContextsReadOK creates a ExtrasConfigContextsReadOK with default headers values +func NewExtrasConfigContextsReadOK() *ExtrasConfigContextsReadOK { + return &ExtrasConfigContextsReadOK{} } -/*ExtrasRecentActivityReadOK handles this case with default header values. +/*ExtrasConfigContextsReadOK handles this case with default header values. -ExtrasRecentActivityReadOK extras recent activity read o k +ExtrasConfigContextsReadOK extras config contexts read o k */ -type ExtrasRecentActivityReadOK struct { - Payload *models.UserAction +type ExtrasConfigContextsReadOK struct { + Payload *models.ConfigContext } -func (o *ExtrasRecentActivityReadOK) Error() string { - return fmt.Sprintf("[GET /extras/recent-activity/{id}/][%d] extrasRecentActivityReadOK %+v", 200, o.Payload) +func (o *ExtrasConfigContextsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/config-contexts/{id}/][%d] extrasConfigContextsReadOK %+v", 200, o.Payload) } -func (o *ExtrasRecentActivityReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExtrasConfigContextsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.UserAction) + o.Payload = new(models.ConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_config_contexts_update_parameters.go b/netbox/client/extras/extras_config_contexts_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6b40c1f7121392ede2414f4ca3f9e62b9b76c27e --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasConfigContextsUpdateParams creates a new ExtrasConfigContextsUpdateParams object +// with the default values initialized. +func NewExtrasConfigContextsUpdateParams() *ExtrasConfigContextsUpdateParams { + var () + return &ExtrasConfigContextsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasConfigContextsUpdateParamsWithTimeout creates a new ExtrasConfigContextsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasConfigContextsUpdateParamsWithTimeout(timeout time.Duration) *ExtrasConfigContextsUpdateParams { + var () + return &ExtrasConfigContextsUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasConfigContextsUpdateParamsWithContext creates a new ExtrasConfigContextsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasConfigContextsUpdateParamsWithContext(ctx context.Context) *ExtrasConfigContextsUpdateParams { + var () + return &ExtrasConfigContextsUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasConfigContextsUpdateParamsWithHTTPClient creates a new ExtrasConfigContextsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasConfigContextsUpdateParamsWithHTTPClient(client *http.Client) *ExtrasConfigContextsUpdateParams { + var () + return &ExtrasConfigContextsUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasConfigContextsUpdateParams contains all the parameters to send to the API endpoint +for the extras config contexts update operation typically these are written to a http.Request +*/ +type ExtrasConfigContextsUpdateParams struct { + + /*Data*/ + Data *models.WritableConfigContext + /*ID + A unique integer value identifying this config context. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) WithTimeout(timeout time.Duration) *ExtrasConfigContextsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) WithContext(ctx context.Context) *ExtrasConfigContextsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) WithHTTPClient(client *http.Client) *ExtrasConfigContextsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) WithData(data *models.WritableConfigContext) *ExtrasConfigContextsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) SetData(data *models.WritableConfigContext) { + o.Data = data +} + +// WithID adds the id to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) WithID(id int64) *ExtrasConfigContextsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras config contexts update params +func (o *ExtrasConfigContextsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasConfigContextsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_config_contexts_update_responses.go b/netbox/client/extras/extras_config_contexts_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..834406921b56f37dd93e1ca8c4a1e0da53a1ce9f --- /dev/null +++ b/netbox/client/extras/extras_config_contexts_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasConfigContextsUpdateReader is a Reader for the ExtrasConfigContextsUpdate structure. +type ExtrasConfigContextsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasConfigContextsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasConfigContextsUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasConfigContextsUpdateOK creates a ExtrasConfigContextsUpdateOK with default headers values +func NewExtrasConfigContextsUpdateOK() *ExtrasConfigContextsUpdateOK { + return &ExtrasConfigContextsUpdateOK{} +} + +/*ExtrasConfigContextsUpdateOK handles this case with default header values. + +ExtrasConfigContextsUpdateOK extras config contexts update o k +*/ +type ExtrasConfigContextsUpdateOK struct { + Payload *models.ConfigContext +} + +func (o *ExtrasConfigContextsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/config-contexts/{id}/][%d] extrasConfigContextsUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasConfigContextsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConfigContext) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_custom_field_choices_list_parameters.go b/netbox/client/extras/extras_custom_field_choices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c8f737c11074c9cfa3c9f25d6d7971650568d24d --- /dev/null +++ b/netbox/client/extras/extras_custom_field_choices_list_parameters.go @@ -0,0 +1,127 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasCustomFieldChoicesListParams creates a new ExtrasCustomFieldChoicesListParams object +// with the default values initialized. +func NewExtrasCustomFieldChoicesListParams() *ExtrasCustomFieldChoicesListParams { + + return &ExtrasCustomFieldChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasCustomFieldChoicesListParamsWithTimeout creates a new ExtrasCustomFieldChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasCustomFieldChoicesListParamsWithTimeout(timeout time.Duration) *ExtrasCustomFieldChoicesListParams { + + return &ExtrasCustomFieldChoicesListParams{ + + timeout: timeout, + } +} + +// NewExtrasCustomFieldChoicesListParamsWithContext creates a new ExtrasCustomFieldChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasCustomFieldChoicesListParamsWithContext(ctx context.Context) *ExtrasCustomFieldChoicesListParams { + + return &ExtrasCustomFieldChoicesListParams{ + + Context: ctx, + } +} + +// NewExtrasCustomFieldChoicesListParamsWithHTTPClient creates a new ExtrasCustomFieldChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasCustomFieldChoicesListParamsWithHTTPClient(client *http.Client) *ExtrasCustomFieldChoicesListParams { + + return &ExtrasCustomFieldChoicesListParams{ + HTTPClient: client, + } +} + +/*ExtrasCustomFieldChoicesListParams contains all the parameters to send to the API endpoint +for the extras custom field choices list operation typically these are written to a http.Request +*/ +type ExtrasCustomFieldChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras custom field choices list params +func (o *ExtrasCustomFieldChoicesListParams) WithTimeout(timeout time.Duration) *ExtrasCustomFieldChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras custom field choices list params +func (o *ExtrasCustomFieldChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras custom field choices list params +func (o *ExtrasCustomFieldChoicesListParams) WithContext(ctx context.Context) *ExtrasCustomFieldChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras custom field choices list params +func (o *ExtrasCustomFieldChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras custom field choices list params +func (o *ExtrasCustomFieldChoicesListParams) WithHTTPClient(client *http.Client) *ExtrasCustomFieldChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras custom field choices list params +func (o *ExtrasCustomFieldChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasCustomFieldChoicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_custom_field_choices_list_responses.go b/netbox/client/extras/extras_custom_field_choices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8ebf6da73a46b0b5e7af45f207e2484a011487c4 --- /dev/null +++ b/netbox/client/extras/extras_custom_field_choices_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasCustomFieldChoicesListReader is a Reader for the ExtrasCustomFieldChoicesList structure. +type ExtrasCustomFieldChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasCustomFieldChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasCustomFieldChoicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasCustomFieldChoicesListOK creates a ExtrasCustomFieldChoicesListOK with default headers values +func NewExtrasCustomFieldChoicesListOK() *ExtrasCustomFieldChoicesListOK { + return &ExtrasCustomFieldChoicesListOK{} +} + +/*ExtrasCustomFieldChoicesListOK handles this case with default header values. + +ExtrasCustomFieldChoicesListOK extras custom field choices list o k +*/ +type ExtrasCustomFieldChoicesListOK struct { +} + +func (o *ExtrasCustomFieldChoicesListOK) Error() string { + return fmt.Sprintf("[GET /extras/_custom_field_choices/][%d] extrasCustomFieldChoicesListOK ", 200) +} + +func (o *ExtrasCustomFieldChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_custom_field_choices_read_parameters.go b/netbox/client/extras/extras_custom_field_choices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9812423d00a2f90c4ac57e387c2da55879fdd4db --- /dev/null +++ b/netbox/client/extras/extras_custom_field_choices_read_parameters.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasCustomFieldChoicesReadParams creates a new ExtrasCustomFieldChoicesReadParams object +// with the default values initialized. +func NewExtrasCustomFieldChoicesReadParams() *ExtrasCustomFieldChoicesReadParams { + var () + return &ExtrasCustomFieldChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasCustomFieldChoicesReadParamsWithTimeout creates a new ExtrasCustomFieldChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasCustomFieldChoicesReadParamsWithTimeout(timeout time.Duration) *ExtrasCustomFieldChoicesReadParams { + var () + return &ExtrasCustomFieldChoicesReadParams{ + + timeout: timeout, + } +} + +// NewExtrasCustomFieldChoicesReadParamsWithContext creates a new ExtrasCustomFieldChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasCustomFieldChoicesReadParamsWithContext(ctx context.Context) *ExtrasCustomFieldChoicesReadParams { + var () + return &ExtrasCustomFieldChoicesReadParams{ + + Context: ctx, + } +} + +// NewExtrasCustomFieldChoicesReadParamsWithHTTPClient creates a new ExtrasCustomFieldChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasCustomFieldChoicesReadParamsWithHTTPClient(client *http.Client) *ExtrasCustomFieldChoicesReadParams { + var () + return &ExtrasCustomFieldChoicesReadParams{ + HTTPClient: client, + } +} + +/*ExtrasCustomFieldChoicesReadParams contains all the parameters to send to the API endpoint +for the extras custom field choices read operation typically these are written to a http.Request +*/ +type ExtrasCustomFieldChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras custom field choices read params +func (o *ExtrasCustomFieldChoicesReadParams) WithTimeout(timeout time.Duration) *ExtrasCustomFieldChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras custom field choices read params +func (o *ExtrasCustomFieldChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras custom field choices read params +func (o *ExtrasCustomFieldChoicesReadParams) WithContext(ctx context.Context) *ExtrasCustomFieldChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras custom field choices read params +func (o *ExtrasCustomFieldChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras custom field choices read params +func (o *ExtrasCustomFieldChoicesReadParams) WithHTTPClient(client *http.Client) *ExtrasCustomFieldChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras custom field choices read params +func (o *ExtrasCustomFieldChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras custom field choices read params +func (o *ExtrasCustomFieldChoicesReadParams) WithID(id string) *ExtrasCustomFieldChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras custom field choices read params +func (o *ExtrasCustomFieldChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasCustomFieldChoicesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_custom_field_choices_read_responses.go b/netbox/client/extras/extras_custom_field_choices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a1a673d592ebf28085c5f92250bfe6769accb80b --- /dev/null +++ b/netbox/client/extras/extras_custom_field_choices_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasCustomFieldChoicesReadReader is a Reader for the ExtrasCustomFieldChoicesRead structure. +type ExtrasCustomFieldChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasCustomFieldChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasCustomFieldChoicesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasCustomFieldChoicesReadOK creates a ExtrasCustomFieldChoicesReadOK with default headers values +func NewExtrasCustomFieldChoicesReadOK() *ExtrasCustomFieldChoicesReadOK { + return &ExtrasCustomFieldChoicesReadOK{} +} + +/*ExtrasCustomFieldChoicesReadOK handles this case with default header values. + +ExtrasCustomFieldChoicesReadOK extras custom field choices read o k +*/ +type ExtrasCustomFieldChoicesReadOK struct { +} + +func (o *ExtrasCustomFieldChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /extras/_custom_field_choices/{id}/][%d] extrasCustomFieldChoicesReadOK ", 200) +} + +func (o *ExtrasCustomFieldChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_export_templates_create_parameters.go b/netbox/client/extras/extras_export_templates_create_parameters.go index 1ae756636d35c09fcfaf4f7501358cb65bf50797..98b193da73aa71f84504419e1f56a1e3d595b3f4 100644 --- a/netbox/client/extras/extras_export_templates_create_parameters.go +++ b/netbox/client/extras/extras_export_templates_create_parameters.go @@ -20,18 +20,17 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasExportTemplatesCreateParams creates a new ExtrasExportTemplatesCreateParams object @@ -79,7 +78,7 @@ for the extras export templates create operation typically these are written to type ExtrasExportTemplatesCreateParams struct { /*Data*/ - Data *models.ExportTemplate + Data *models.WritableExportTemplate timeout time.Duration Context context.Context @@ -120,13 +119,13 @@ func (o *ExtrasExportTemplatesCreateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the extras export templates create params -func (o *ExtrasExportTemplatesCreateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesCreateParams { +func (o *ExtrasExportTemplatesCreateParams) WithData(data *models.WritableExportTemplate) *ExtrasExportTemplatesCreateParams { o.SetData(data) return o } // SetData adds the data to the extras export templates create params -func (o *ExtrasExportTemplatesCreateParams) SetData(data *models.ExportTemplate) { +func (o *ExtrasExportTemplatesCreateParams) SetData(data *models.WritableExportTemplate) { o.Data = data } diff --git a/netbox/client/extras/extras_export_templates_create_responses.go b/netbox/client/extras/extras_export_templates_create_responses.go index cab620549690ef859cb86e0bb15825939989cb28..ea7f6a037db38abbd341ef370c27fe6fb142b015 100644 --- a/netbox/client/extras/extras_export_templates_create_responses.go +++ b/netbox/client/extras/extras_export_templates_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasExportTemplatesCreateReader is a Reader for the ExtrasExportTemplatesCreate structure. diff --git a/netbox/client/extras/extras_export_templates_delete_parameters.go b/netbox/client/extras/extras_export_templates_delete_parameters.go index eed6f13252c6233afbd6469714dff0d5ce029dea..396886e48cbe9088e26fb1066e5d3f185699c4a9 100644 --- a/netbox/client/extras/extras_export_templates_delete_parameters.go +++ b/netbox/client/extras/extras_export_templates_delete_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_export_templates_list_parameters.go b/netbox/client/extras/extras_export_templates_list_parameters.go index cdd7e6b96b2cc00d906329e3fdb080ca054a6969..756312c4832f510233ec2f163154906d96f7287c 100644 --- a/netbox/client/extras/extras_export_templates_list_parameters.go +++ b/netbox/client/extras/extras_export_templates_list_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -91,6 +90,8 @@ type ExtrasExportTemplatesListParams struct { */ Offset *int64 + /*TemplateLanguage*/ + TemplateLanguage *string timeout time.Duration Context context.Context @@ -174,6 +175,17 @@ func (o *ExtrasExportTemplatesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithTemplateLanguage adds the templateLanguage to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithTemplateLanguage(templateLanguage *string) *ExtrasExportTemplatesListParams { + o.SetTemplateLanguage(templateLanguage) + return o +} + +// SetTemplateLanguage adds the templateLanguage to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetTemplateLanguage(templateLanguage *string) { + o.TemplateLanguage = templateLanguage +} + // WriteToRequest writes these params to a swagger request func (o *ExtrasExportTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -246,6 +258,22 @@ func (o *ExtrasExportTemplatesListParams) WriteToRequest(r runtime.ClientRequest } + if o.TemplateLanguage != nil { + + // query param template_language + var qrTemplateLanguage string + if o.TemplateLanguage != nil { + qrTemplateLanguage = *o.TemplateLanguage + } + qTemplateLanguage := qrTemplateLanguage + if qTemplateLanguage != "" { + if err := r.SetQueryParam("template_language", qTemplateLanguage); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/extras/extras_export_templates_list_responses.go b/netbox/client/extras/extras_export_templates_list_responses.go index f75b54ec5d572f3b0c30fb9259dbffbb9a7eacbf..e6e9e94622bd87a857380decf4522d4ef176c3dc 100644 --- a/netbox/client/extras/extras_export_templates_list_responses.go +++ b/netbox/client/extras/extras_export_templates_list_responses.go @@ -22,12 +22,16 @@ package extras import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasExportTemplatesListReader is a Reader for the ExtrasExportTemplatesList structure. @@ -61,7 +65,7 @@ func NewExtrasExportTemplatesListOK() *ExtrasExportTemplatesListOK { ExtrasExportTemplatesListOK extras export templates list o k */ type ExtrasExportTemplatesListOK struct { - Payload *models.ExtrasExportTemplatesListOKBody + Payload *ExtrasExportTemplatesListOKBody } func (o *ExtrasExportTemplatesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *ExtrasExportTemplatesListOK) Error() string { func (o *ExtrasExportTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.ExtrasExportTemplatesListOKBody) + o.Payload = new(ExtrasExportTemplatesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *ExtrasExportTemplatesListOK) readResponse(response runtime.ClientRespon return nil } + +/*ExtrasExportTemplatesListOKBody extras export templates list o k body +swagger:model ExtrasExportTemplatesListOKBody +*/ +type ExtrasExportTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ExportTemplate `json:"results"` +} + +// Validate validates this extras export templates list o k body +func (o *ExtrasExportTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ExtrasExportTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("extrasExportTemplatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *ExtrasExportTemplatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("extrasExportTemplatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasExportTemplatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("extrasExportTemplatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasExportTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("extrasExportTemplatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extrasExportTemplatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ExtrasExportTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ExtrasExportTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasExportTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/extras/extras_export_templates_partial_update_parameters.go b/netbox/client/extras/extras_export_templates_partial_update_parameters.go index 558cdde7480b1b217de8a984a1ecaceccbdd10c6..4217ffb57be46bc556a6892f588a7a72ddc59f21 100644 --- a/netbox/client/extras/extras_export_templates_partial_update_parameters.go +++ b/netbox/client/extras/extras_export_templates_partial_update_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasExportTemplatesPartialUpdateParams creates a new ExtrasExportTemplatesPartialUpdateParams object @@ -80,7 +79,7 @@ for the extras export templates partial update operation typically these are wri type ExtrasExportTemplatesPartialUpdateParams struct { /*Data*/ - Data *models.ExportTemplate + Data *models.WritableExportTemplate /*ID A unique integer value identifying this export template. @@ -126,13 +125,13 @@ func (o *ExtrasExportTemplatesPartialUpdateParams) SetHTTPClient(client *http.Cl } // WithData adds the data to the extras export templates partial update params -func (o *ExtrasExportTemplatesPartialUpdateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesPartialUpdateParams { +func (o *ExtrasExportTemplatesPartialUpdateParams) WithData(data *models.WritableExportTemplate) *ExtrasExportTemplatesPartialUpdateParams { o.SetData(data) return o } // SetData adds the data to the extras export templates partial update params -func (o *ExtrasExportTemplatesPartialUpdateParams) SetData(data *models.ExportTemplate) { +func (o *ExtrasExportTemplatesPartialUpdateParams) SetData(data *models.WritableExportTemplate) { o.Data = data } diff --git a/netbox/client/extras/extras_export_templates_partial_update_responses.go b/netbox/client/extras/extras_export_templates_partial_update_responses.go index 31a4c6d8032b5e11f9ac5f7389545cdf171af1e4..257b30486ef91e730827b886dd46bf706eb37f22 100644 --- a/netbox/client/extras/extras_export_templates_partial_update_responses.go +++ b/netbox/client/extras/extras_export_templates_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasExportTemplatesPartialUpdateReader is a Reader for the ExtrasExportTemplatesPartialUpdate structure. diff --git a/netbox/client/extras/extras_export_templates_read_parameters.go b/netbox/client/extras/extras_export_templates_read_parameters.go index cb93b03c95e9023e308e52889188bc803ad061b5..c3d94b224e1227af9ee292e87309c9aaed682d25 100644 --- a/netbox/client/extras/extras_export_templates_read_parameters.go +++ b/netbox/client/extras/extras_export_templates_read_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_export_templates_read_responses.go b/netbox/client/extras/extras_export_templates_read_responses.go index 1aab4600363d5dd4fdf9c4a04bd10c9165204cbd..ff8c99e48f546cb88f506f001f268c6b04d10dc1 100644 --- a/netbox/client/extras/extras_export_templates_read_responses.go +++ b/netbox/client/extras/extras_export_templates_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasExportTemplatesReadReader is a Reader for the ExtrasExportTemplatesRead structure. diff --git a/netbox/client/extras/extras_export_templates_update_parameters.go b/netbox/client/extras/extras_export_templates_update_parameters.go index 5ce990e46dbf82f5e951a0bcbcfdfcced2294f9b..9e5f48f978913157ecda664a75d6c0a754844bab 100644 --- a/netbox/client/extras/extras_export_templates_update_parameters.go +++ b/netbox/client/extras/extras_export_templates_update_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasExportTemplatesUpdateParams creates a new ExtrasExportTemplatesUpdateParams object @@ -80,7 +79,7 @@ for the extras export templates update operation typically these are written to type ExtrasExportTemplatesUpdateParams struct { /*Data*/ - Data *models.ExportTemplate + Data *models.WritableExportTemplate /*ID A unique integer value identifying this export template. @@ -126,13 +125,13 @@ func (o *ExtrasExportTemplatesUpdateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the extras export templates update params -func (o *ExtrasExportTemplatesUpdateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesUpdateParams { +func (o *ExtrasExportTemplatesUpdateParams) WithData(data *models.WritableExportTemplate) *ExtrasExportTemplatesUpdateParams { o.SetData(data) return o } // SetData adds the data to the extras export templates update params -func (o *ExtrasExportTemplatesUpdateParams) SetData(data *models.ExportTemplate) { +func (o *ExtrasExportTemplatesUpdateParams) SetData(data *models.WritableExportTemplate) { o.Data = data } diff --git a/netbox/client/extras/extras_export_templates_update_responses.go b/netbox/client/extras/extras_export_templates_update_responses.go index aae72f39db7ef4512ab45b4861b6873d2d24a04a..8f52c0bc2f396a4f8a27f148b6ff4b356fa4351b 100644 --- a/netbox/client/extras/extras_export_templates_update_responses.go +++ b/netbox/client/extras/extras_export_templates_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasExportTemplatesUpdateReader is a Reader for the ExtrasExportTemplatesUpdate structure. diff --git a/netbox/client/extras/extras_graphs_create_parameters.go b/netbox/client/extras/extras_graphs_create_parameters.go index 7289ea4ff44d56a20eacf441604d5685d4521a72..81ae52a9c9e68069e13f678ef3680cf37de08940 100644 --- a/netbox/client/extras/extras_graphs_create_parameters.go +++ b/netbox/client/extras/extras_graphs_create_parameters.go @@ -20,18 +20,17 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasGraphsCreateParams creates a new ExtrasGraphsCreateParams object diff --git a/netbox/client/extras/extras_graphs_create_responses.go b/netbox/client/extras/extras_graphs_create_responses.go index 8b635f27ca7748b7d476c27f866af63029d2935b..1af63ea6a95237037622f14c2bc5bc3262fe64e3 100644 --- a/netbox/client/extras/extras_graphs_create_responses.go +++ b/netbox/client/extras/extras_graphs_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasGraphsCreateReader is a Reader for the ExtrasGraphsCreate structure. @@ -61,7 +61,7 @@ func NewExtrasGraphsCreateCreated() *ExtrasGraphsCreateCreated { ExtrasGraphsCreateCreated extras graphs create created */ type ExtrasGraphsCreateCreated struct { - Payload *models.WritableGraph + Payload *models.Graph } func (o *ExtrasGraphsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasGraphsCreateCreated) Error() string { func (o *ExtrasGraphsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableGraph) + o.Payload = new(models.Graph) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_graphs_delete_parameters.go b/netbox/client/extras/extras_graphs_delete_parameters.go index bb969f399ad5f09db85b7cb0cbafc79bae7e7b09..ac684b51fb376e6ca3ebb1844f1ee59178e587d6 100644 --- a/netbox/client/extras/extras_graphs_delete_parameters.go +++ b/netbox/client/extras/extras_graphs_delete_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_graphs_list_parameters.go b/netbox/client/extras/extras_graphs_list_parameters.go index 1e58184b8f495a5bb5f36b9eab2e400a5c8f6eed..ac1eaa99f7eca83bab2a56142bdfdfb78516ee14 100644 --- a/netbox/client/extras/extras_graphs_list_parameters.go +++ b/netbox/client/extras/extras_graphs_list_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_graphs_list_responses.go b/netbox/client/extras/extras_graphs_list_responses.go index 193d5b4f741adf4545ac69c32d21723707d4e1ee..cfd0cccf40369e7c706b05ab7a8416411f100ba4 100644 --- a/netbox/client/extras/extras_graphs_list_responses.go +++ b/netbox/client/extras/extras_graphs_list_responses.go @@ -22,12 +22,16 @@ package extras import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasGraphsListReader is a Reader for the ExtrasGraphsList structure. @@ -61,7 +65,7 @@ func NewExtrasGraphsListOK() *ExtrasGraphsListOK { ExtrasGraphsListOK extras graphs list o k */ type ExtrasGraphsListOK struct { - Payload *models.ExtrasGraphsListOKBody + Payload *ExtrasGraphsListOKBody } func (o *ExtrasGraphsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *ExtrasGraphsListOK) Error() string { func (o *ExtrasGraphsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.ExtrasGraphsListOKBody) + o.Payload = new(ExtrasGraphsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *ExtrasGraphsListOK) readResponse(response runtime.ClientResponse, consu return nil } + +/*ExtrasGraphsListOKBody extras graphs list o k body +swagger:model ExtrasGraphsListOKBody +*/ +type ExtrasGraphsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Graph `json:"results"` +} + +// Validate validates this extras graphs list o k body +func (o *ExtrasGraphsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ExtrasGraphsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("extrasGraphsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *ExtrasGraphsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("extrasGraphsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasGraphsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("extrasGraphsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasGraphsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("extrasGraphsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extrasGraphsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ExtrasGraphsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ExtrasGraphsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasGraphsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/extras/extras_graphs_partial_update_parameters.go b/netbox/client/extras/extras_graphs_partial_update_parameters.go index 6af233d18e0c3bf4b0af006ebe6dda4f08ae25ad..7092304057c7407c79fda4e49fdc6d3386e2a449 100644 --- a/netbox/client/extras/extras_graphs_partial_update_parameters.go +++ b/netbox/client/extras/extras_graphs_partial_update_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasGraphsPartialUpdateParams creates a new ExtrasGraphsPartialUpdateParams object diff --git a/netbox/client/extras/extras_graphs_partial_update_responses.go b/netbox/client/extras/extras_graphs_partial_update_responses.go index c69cd4a8548f934b10ee826e67e21aecff2f7dff..36d1eabfb59e62e20edae5e8e848a45767ad6c97 100644 --- a/netbox/client/extras/extras_graphs_partial_update_responses.go +++ b/netbox/client/extras/extras_graphs_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasGraphsPartialUpdateReader is a Reader for the ExtrasGraphsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewExtrasGraphsPartialUpdateOK() *ExtrasGraphsPartialUpdateOK { ExtrasGraphsPartialUpdateOK extras graphs partial update o k */ type ExtrasGraphsPartialUpdateOK struct { - Payload *models.WritableGraph + Payload *models.Graph } func (o *ExtrasGraphsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasGraphsPartialUpdateOK) Error() string { func (o *ExtrasGraphsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableGraph) + o.Payload = new(models.Graph) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_graphs_read_parameters.go b/netbox/client/extras/extras_graphs_read_parameters.go index d01b844da4aadac5a17edd622c949b2a89750f7a..71bf073cacca81a845661093041a22b4336a5985 100644 --- a/netbox/client/extras/extras_graphs_read_parameters.go +++ b/netbox/client/extras/extras_graphs_read_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_graphs_read_responses.go b/netbox/client/extras/extras_graphs_read_responses.go index be6ad49e23c01448898720386fdceb939f2dec66..c2369140dbd53c1dbcfceb123d77d983e8a68085 100644 --- a/netbox/client/extras/extras_graphs_read_responses.go +++ b/netbox/client/extras/extras_graphs_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasGraphsReadReader is a Reader for the ExtrasGraphsRead structure. diff --git a/netbox/client/extras/extras_graphs_update_parameters.go b/netbox/client/extras/extras_graphs_update_parameters.go index e7979ba6ca1307ac8729e385e4498e3baffed907..9d4e2d71da18017474b551e6f6f8a24f68f72dfc 100644 --- a/netbox/client/extras/extras_graphs_update_parameters.go +++ b/netbox/client/extras/extras_graphs_update_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasGraphsUpdateParams creates a new ExtrasGraphsUpdateParams object diff --git a/netbox/client/extras/extras_graphs_update_responses.go b/netbox/client/extras/extras_graphs_update_responses.go index b35e3e09e3da6089285748666e1b9b862d9a2f33..b3ba7b9a98e19fdbf58cf992bc5f228189455c5a 100644 --- a/netbox/client/extras/extras_graphs_update_responses.go +++ b/netbox/client/extras/extras_graphs_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasGraphsUpdateReader is a Reader for the ExtrasGraphsUpdate structure. @@ -61,7 +61,7 @@ func NewExtrasGraphsUpdateOK() *ExtrasGraphsUpdateOK { ExtrasGraphsUpdateOK extras graphs update o k */ type ExtrasGraphsUpdateOK struct { - Payload *models.WritableGraph + Payload *models.Graph } func (o *ExtrasGraphsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasGraphsUpdateOK) Error() string { func (o *ExtrasGraphsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableGraph) + o.Payload = new(models.Graph) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_image_attachments_create_parameters.go b/netbox/client/extras/extras_image_attachments_create_parameters.go index bf1ba48d11a10b365639a97061a26a3a1b085def..5d79abb56faa3e6c8f1ca18b6d78eda7a18862cf 100644 --- a/netbox/client/extras/extras_image_attachments_create_parameters.go +++ b/netbox/client/extras/extras_image_attachments_create_parameters.go @@ -20,18 +20,17 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasImageAttachmentsCreateParams creates a new ExtrasImageAttachmentsCreateParams object @@ -79,7 +78,7 @@ for the extras image attachments create operation typically these are written to type ExtrasImageAttachmentsCreateParams struct { /*Data*/ - Data *models.WritableImageAttachment + Data *models.ImageAttachment timeout time.Duration Context context.Context @@ -120,13 +119,13 @@ func (o *ExtrasImageAttachmentsCreateParams) SetHTTPClient(client *http.Client) } // WithData adds the data to the extras image attachments create params -func (o *ExtrasImageAttachmentsCreateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsCreateParams { +func (o *ExtrasImageAttachmentsCreateParams) WithData(data *models.ImageAttachment) *ExtrasImageAttachmentsCreateParams { o.SetData(data) return o } // SetData adds the data to the extras image attachments create params -func (o *ExtrasImageAttachmentsCreateParams) SetData(data *models.WritableImageAttachment) { +func (o *ExtrasImageAttachmentsCreateParams) SetData(data *models.ImageAttachment) { o.Data = data } diff --git a/netbox/client/extras/extras_image_attachments_create_responses.go b/netbox/client/extras/extras_image_attachments_create_responses.go index 844cd7e2ce0709803658dcd36ce658820db5e96d..4ada91e14cda3aba21e8df7009380adbf70fad1f 100644 --- a/netbox/client/extras/extras_image_attachments_create_responses.go +++ b/netbox/client/extras/extras_image_attachments_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasImageAttachmentsCreateReader is a Reader for the ExtrasImageAttachmentsCreate structure. @@ -61,7 +61,7 @@ func NewExtrasImageAttachmentsCreateCreated() *ExtrasImageAttachmentsCreateCreat ExtrasImageAttachmentsCreateCreated extras image attachments create created */ type ExtrasImageAttachmentsCreateCreated struct { - Payload *models.WritableImageAttachment + Payload *models.ImageAttachment } func (o *ExtrasImageAttachmentsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasImageAttachmentsCreateCreated) Error() string { func (o *ExtrasImageAttachmentsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableImageAttachment) + o.Payload = new(models.ImageAttachment) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_image_attachments_delete_parameters.go b/netbox/client/extras/extras_image_attachments_delete_parameters.go index 11046c69460040dbdd4d9b23c1a1833513b1fc62..de8fab8ff2b20ffcdd8a80134babe02baf866a80 100644 --- a/netbox/client/extras/extras_image_attachments_delete_parameters.go +++ b/netbox/client/extras/extras_image_attachments_delete_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_image_attachments_list_parameters.go b/netbox/client/extras/extras_image_attachments_list_parameters.go index 93db4f9d276947f24470381d6732718aeebd6e34..17e304661ee693dade29d65f253b8c59fa120735 100644 --- a/netbox/client/extras/extras_image_attachments_list_parameters.go +++ b/netbox/client/extras/extras_image_attachments_list_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_image_attachments_list_responses.go b/netbox/client/extras/extras_image_attachments_list_responses.go index 4448134fced914bf953d819556347b43f343af30..31011e85026bdc2beec33582cfeb16b9af3ffc76 100644 --- a/netbox/client/extras/extras_image_attachments_list_responses.go +++ b/netbox/client/extras/extras_image_attachments_list_responses.go @@ -22,12 +22,16 @@ package extras import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasImageAttachmentsListReader is a Reader for the ExtrasImageAttachmentsList structure. @@ -61,7 +65,7 @@ func NewExtrasImageAttachmentsListOK() *ExtrasImageAttachmentsListOK { ExtrasImageAttachmentsListOK extras image attachments list o k */ type ExtrasImageAttachmentsListOK struct { - Payload *models.ExtrasImageAttachmentsListOKBody + Payload *ExtrasImageAttachmentsListOKBody } func (o *ExtrasImageAttachmentsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *ExtrasImageAttachmentsListOK) Error() string { func (o *ExtrasImageAttachmentsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.ExtrasImageAttachmentsListOKBody) + o.Payload = new(ExtrasImageAttachmentsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *ExtrasImageAttachmentsListOK) readResponse(response runtime.ClientRespo return nil } + +/*ExtrasImageAttachmentsListOKBody extras image attachments list o k body +swagger:model ExtrasImageAttachmentsListOKBody +*/ +type ExtrasImageAttachmentsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ImageAttachment `json:"results"` +} + +// Validate validates this extras image attachments list o k body +func (o *ExtrasImageAttachmentsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ExtrasImageAttachmentsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("extrasImageAttachmentsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *ExtrasImageAttachmentsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("extrasImageAttachmentsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasImageAttachmentsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("extrasImageAttachmentsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasImageAttachmentsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("extrasImageAttachmentsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extrasImageAttachmentsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ExtrasImageAttachmentsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ExtrasImageAttachmentsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasImageAttachmentsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_partial_update_parameters.go b/netbox/client/extras/extras_image_attachments_partial_update_parameters.go index ff257c2dccdadf5a75ae8685badb4b3667c43a10..42d27246a58b48cb3a3183ec3ed24182faa952ae 100644 --- a/netbox/client/extras/extras_image_attachments_partial_update_parameters.go +++ b/netbox/client/extras/extras_image_attachments_partial_update_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasImageAttachmentsPartialUpdateParams creates a new ExtrasImageAttachmentsPartialUpdateParams object @@ -80,7 +79,7 @@ for the extras image attachments partial update operation typically these are wr type ExtrasImageAttachmentsPartialUpdateParams struct { /*Data*/ - Data *models.WritableImageAttachment + Data *models.ImageAttachment /*ID A unique integer value identifying this image attachment. @@ -126,13 +125,13 @@ func (o *ExtrasImageAttachmentsPartialUpdateParams) SetHTTPClient(client *http.C } // WithData adds the data to the extras image attachments partial update params -func (o *ExtrasImageAttachmentsPartialUpdateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsPartialUpdateParams { +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithData(data *models.ImageAttachment) *ExtrasImageAttachmentsPartialUpdateParams { o.SetData(data) return o } // SetData adds the data to the extras image attachments partial update params -func (o *ExtrasImageAttachmentsPartialUpdateParams) SetData(data *models.WritableImageAttachment) { +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetData(data *models.ImageAttachment) { o.Data = data } diff --git a/netbox/client/extras/extras_image_attachments_partial_update_responses.go b/netbox/client/extras/extras_image_attachments_partial_update_responses.go index 241f5970fcf471931bebc15a4dbbd922ab1005c3..5bc6ea34fe7beefddddcee0a88d1c2b2a0ef8657 100644 --- a/netbox/client/extras/extras_image_attachments_partial_update_responses.go +++ b/netbox/client/extras/extras_image_attachments_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasImageAttachmentsPartialUpdateReader is a Reader for the ExtrasImageAttachmentsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewExtrasImageAttachmentsPartialUpdateOK() *ExtrasImageAttachmentsPartialUp ExtrasImageAttachmentsPartialUpdateOK extras image attachments partial update o k */ type ExtrasImageAttachmentsPartialUpdateOK struct { - Payload *models.WritableImageAttachment + Payload *models.ImageAttachment } func (o *ExtrasImageAttachmentsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasImageAttachmentsPartialUpdateOK) Error() string { func (o *ExtrasImageAttachmentsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableImageAttachment) + o.Payload = new(models.ImageAttachment) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_image_attachments_read_parameters.go b/netbox/client/extras/extras_image_attachments_read_parameters.go index 57fab5b925c2577f8beec47ed309bab4c05fa792..6385cff8fca912533ea144662da060dfdbf1a447 100644 --- a/netbox/client/extras/extras_image_attachments_read_parameters.go +++ b/netbox/client/extras/extras_image_attachments_read_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_image_attachments_read_responses.go b/netbox/client/extras/extras_image_attachments_read_responses.go index 5c5725999878875945698c31151e4fc6f42fc800..58fb44695e2b3c231254bbe786868eba895b5118 100644 --- a/netbox/client/extras/extras_image_attachments_read_responses.go +++ b/netbox/client/extras/extras_image_attachments_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasImageAttachmentsReadReader is a Reader for the ExtrasImageAttachmentsRead structure. diff --git a/netbox/client/extras/extras_image_attachments_update_parameters.go b/netbox/client/extras/extras_image_attachments_update_parameters.go index 2e68d130c6bbd6c13c5b795389f73eb39cd9465e..f1e79283ab2ba79e5b88df97f780a32d3b891da2 100644 --- a/netbox/client/extras/extras_image_attachments_update_parameters.go +++ b/netbox/client/extras/extras_image_attachments_update_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasImageAttachmentsUpdateParams creates a new ExtrasImageAttachmentsUpdateParams object @@ -80,7 +79,7 @@ for the extras image attachments update operation typically these are written to type ExtrasImageAttachmentsUpdateParams struct { /*Data*/ - Data *models.WritableImageAttachment + Data *models.ImageAttachment /*ID A unique integer value identifying this image attachment. @@ -126,13 +125,13 @@ func (o *ExtrasImageAttachmentsUpdateParams) SetHTTPClient(client *http.Client) } // WithData adds the data to the extras image attachments update params -func (o *ExtrasImageAttachmentsUpdateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsUpdateParams { +func (o *ExtrasImageAttachmentsUpdateParams) WithData(data *models.ImageAttachment) *ExtrasImageAttachmentsUpdateParams { o.SetData(data) return o } // SetData adds the data to the extras image attachments update params -func (o *ExtrasImageAttachmentsUpdateParams) SetData(data *models.WritableImageAttachment) { +func (o *ExtrasImageAttachmentsUpdateParams) SetData(data *models.ImageAttachment) { o.Data = data } diff --git a/netbox/client/extras/extras_image_attachments_update_responses.go b/netbox/client/extras/extras_image_attachments_update_responses.go index bfd348dffed20708773b8819b4358b78c9b82cc4..3b411babb659bb0ea87b5a26488c3faecc740ce4 100644 --- a/netbox/client/extras/extras_image_attachments_update_responses.go +++ b/netbox/client/extras/extras_image_attachments_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasImageAttachmentsUpdateReader is a Reader for the ExtrasImageAttachmentsUpdate structure. @@ -61,7 +61,7 @@ func NewExtrasImageAttachmentsUpdateOK() *ExtrasImageAttachmentsUpdateOK { ExtrasImageAttachmentsUpdateOK extras image attachments update o k */ type ExtrasImageAttachmentsUpdateOK struct { - Payload *models.WritableImageAttachment + Payload *models.ImageAttachment } func (o *ExtrasImageAttachmentsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasImageAttachmentsUpdateOK) Error() string { func (o *ExtrasImageAttachmentsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableImageAttachment) + o.Payload = new(models.ImageAttachment) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_object_changes_list_parameters.go b/netbox/client/extras/extras_object_changes_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a85ad5ec45204268b63e3f14ae7e5c334ad19db5 --- /dev/null +++ b/netbox/client/extras/extras_object_changes_list_parameters.go @@ -0,0 +1,426 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasObjectChangesListParams creates a new ExtrasObjectChangesListParams object +// with the default values initialized. +func NewExtrasObjectChangesListParams() *ExtrasObjectChangesListParams { + var () + return &ExtrasObjectChangesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasObjectChangesListParamsWithTimeout creates a new ExtrasObjectChangesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasObjectChangesListParamsWithTimeout(timeout time.Duration) *ExtrasObjectChangesListParams { + var () + return &ExtrasObjectChangesListParams{ + + timeout: timeout, + } +} + +// NewExtrasObjectChangesListParamsWithContext creates a new ExtrasObjectChangesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasObjectChangesListParamsWithContext(ctx context.Context) *ExtrasObjectChangesListParams { + var () + return &ExtrasObjectChangesListParams{ + + Context: ctx, + } +} + +// NewExtrasObjectChangesListParamsWithHTTPClient creates a new ExtrasObjectChangesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasObjectChangesListParamsWithHTTPClient(client *http.Client) *ExtrasObjectChangesListParams { + var () + return &ExtrasObjectChangesListParams{ + HTTPClient: client, + } +} + +/*ExtrasObjectChangesListParams contains all the parameters to send to the API endpoint +for the extras object changes list operation typically these are written to a http.Request +*/ +type ExtrasObjectChangesListParams struct { + + /*Action*/ + Action *string + /*ChangedObjectType*/ + ChangedObjectType *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*ObjectRepr*/ + ObjectRepr *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*RequestID*/ + RequestID *string + /*Time*/ + Time *string + /*User*/ + User *string + /*UserName*/ + UserName *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithTimeout(timeout time.Duration) *ExtrasObjectChangesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithContext(ctx context.Context) *ExtrasObjectChangesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithHTTPClient(client *http.Client) *ExtrasObjectChangesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAction adds the action to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithAction(action *string) *ExtrasObjectChangesListParams { + o.SetAction(action) + return o +} + +// SetAction adds the action to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetAction(action *string) { + o.Action = action +} + +// WithChangedObjectType adds the changedObjectType to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithChangedObjectType(changedObjectType *string) *ExtrasObjectChangesListParams { + o.SetChangedObjectType(changedObjectType) + return o +} + +// SetChangedObjectType adds the changedObjectType to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetChangedObjectType(changedObjectType *string) { + o.ChangedObjectType = changedObjectType +} + +// WithLimit adds the limit to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithLimit(limit *int64) *ExtrasObjectChangesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithObjectRepr adds the objectRepr to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithObjectRepr(objectRepr *string) *ExtrasObjectChangesListParams { + o.SetObjectRepr(objectRepr) + return o +} + +// SetObjectRepr adds the objectRepr to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetObjectRepr(objectRepr *string) { + o.ObjectRepr = objectRepr +} + +// WithOffset adds the offset to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithOffset(offset *int64) *ExtrasObjectChangesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithQ(q *string) *ExtrasObjectChangesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRequestID adds the requestID to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithRequestID(requestID *string) *ExtrasObjectChangesListParams { + o.SetRequestID(requestID) + return o +} + +// SetRequestID adds the requestId to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetRequestID(requestID *string) { + o.RequestID = requestID +} + +// WithTime adds the time to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithTime(time *string) *ExtrasObjectChangesListParams { + o.SetTime(time) + return o +} + +// SetTime adds the time to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetTime(time *string) { + o.Time = time +} + +// WithUser adds the user to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithUser(user *string) *ExtrasObjectChangesListParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetUser(user *string) { + o.User = user +} + +// WithUserName adds the userName to the extras object changes list params +func (o *ExtrasObjectChangesListParams) WithUserName(userName *string) *ExtrasObjectChangesListParams { + o.SetUserName(userName) + return o +} + +// SetUserName adds the userName to the extras object changes list params +func (o *ExtrasObjectChangesListParams) SetUserName(userName *string) { + o.UserName = userName +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasObjectChangesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Action != nil { + + // query param action + var qrAction string + if o.Action != nil { + qrAction = *o.Action + } + qAction := qrAction + if qAction != "" { + if err := r.SetQueryParam("action", qAction); err != nil { + return err + } + } + + } + + if o.ChangedObjectType != nil { + + // query param changed_object_type + var qrChangedObjectType string + if o.ChangedObjectType != nil { + qrChangedObjectType = *o.ChangedObjectType + } + qChangedObjectType := qrChangedObjectType + if qChangedObjectType != "" { + if err := r.SetQueryParam("changed_object_type", qChangedObjectType); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.ObjectRepr != nil { + + // query param object_repr + var qrObjectRepr string + if o.ObjectRepr != nil { + qrObjectRepr = *o.ObjectRepr + } + qObjectRepr := qrObjectRepr + if qObjectRepr != "" { + if err := r.SetQueryParam("object_repr", qObjectRepr); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.RequestID != nil { + + // query param request_id + var qrRequestID string + if o.RequestID != nil { + qrRequestID = *o.RequestID + } + qRequestID := qrRequestID + if qRequestID != "" { + if err := r.SetQueryParam("request_id", qRequestID); err != nil { + return err + } + } + + } + + if o.Time != nil { + + // query param time + var qrTime string + if o.Time != nil { + qrTime = *o.Time + } + qTime := qrTime + if qTime != "" { + if err := r.SetQueryParam("time", qTime); err != nil { + return err + } + } + + } + + if o.User != nil { + + // query param user + var qrUser string + if o.User != nil { + qrUser = *o.User + } + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + } + + if o.UserName != nil { + + // query param user_name + var qrUserName string + if o.UserName != nil { + qrUserName = *o.UserName + } + qUserName := qrUserName + if qUserName != "" { + if err := r.SetQueryParam("user_name", qUserName); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_object_changes_list_responses.go b/netbox/client/extras/extras_object_changes_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..865fc5eadd5cb4c8fcc2c37246c7b92a3b58e822 --- /dev/null +++ b/netbox/client/extras/extras_object_changes_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasObjectChangesListReader is a Reader for the ExtrasObjectChangesList structure. +type ExtrasObjectChangesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasObjectChangesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasObjectChangesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasObjectChangesListOK creates a ExtrasObjectChangesListOK with default headers values +func NewExtrasObjectChangesListOK() *ExtrasObjectChangesListOK { + return &ExtrasObjectChangesListOK{} +} + +/*ExtrasObjectChangesListOK handles this case with default header values. + +ExtrasObjectChangesListOK extras object changes list o k +*/ +type ExtrasObjectChangesListOK struct { + Payload *ExtrasObjectChangesListOKBody +} + +func (o *ExtrasObjectChangesListOK) Error() string { + return fmt.Sprintf("[GET /extras/object-changes/][%d] extrasObjectChangesListOK %+v", 200, o.Payload) +} + +func (o *ExtrasObjectChangesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ExtrasObjectChangesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ExtrasObjectChangesListOKBody extras object changes list o k body +swagger:model ExtrasObjectChangesListOKBody +*/ +type ExtrasObjectChangesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ObjectChange `json:"results"` +} + +// Validate validates this extras object changes list o k body +func (o *ExtrasObjectChangesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ExtrasObjectChangesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("extrasObjectChangesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *ExtrasObjectChangesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("extrasObjectChangesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasObjectChangesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("extrasObjectChangesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasObjectChangesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("extrasObjectChangesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extrasObjectChangesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ExtrasObjectChangesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ExtrasObjectChangesListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasObjectChangesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/extras/extras_object_changes_read_parameters.go b/netbox/client/extras/extras_object_changes_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..acbacb80ad849fb210f653d5a10143bff5c0d8ad --- /dev/null +++ b/netbox/client/extras/extras_object_changes_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasObjectChangesReadParams creates a new ExtrasObjectChangesReadParams object +// with the default values initialized. +func NewExtrasObjectChangesReadParams() *ExtrasObjectChangesReadParams { + var () + return &ExtrasObjectChangesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasObjectChangesReadParamsWithTimeout creates a new ExtrasObjectChangesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasObjectChangesReadParamsWithTimeout(timeout time.Duration) *ExtrasObjectChangesReadParams { + var () + return &ExtrasObjectChangesReadParams{ + + timeout: timeout, + } +} + +// NewExtrasObjectChangesReadParamsWithContext creates a new ExtrasObjectChangesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasObjectChangesReadParamsWithContext(ctx context.Context) *ExtrasObjectChangesReadParams { + var () + return &ExtrasObjectChangesReadParams{ + + Context: ctx, + } +} + +// NewExtrasObjectChangesReadParamsWithHTTPClient creates a new ExtrasObjectChangesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasObjectChangesReadParamsWithHTTPClient(client *http.Client) *ExtrasObjectChangesReadParams { + var () + return &ExtrasObjectChangesReadParams{ + HTTPClient: client, + } +} + +/*ExtrasObjectChangesReadParams contains all the parameters to send to the API endpoint +for the extras object changes read operation typically these are written to a http.Request +*/ +type ExtrasObjectChangesReadParams struct { + + /*ID + A unique integer value identifying this object change. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras object changes read params +func (o *ExtrasObjectChangesReadParams) WithTimeout(timeout time.Duration) *ExtrasObjectChangesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras object changes read params +func (o *ExtrasObjectChangesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras object changes read params +func (o *ExtrasObjectChangesReadParams) WithContext(ctx context.Context) *ExtrasObjectChangesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras object changes read params +func (o *ExtrasObjectChangesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras object changes read params +func (o *ExtrasObjectChangesReadParams) WithHTTPClient(client *http.Client) *ExtrasObjectChangesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras object changes read params +func (o *ExtrasObjectChangesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras object changes read params +func (o *ExtrasObjectChangesReadParams) WithID(id int64) *ExtrasObjectChangesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras object changes read params +func (o *ExtrasObjectChangesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasObjectChangesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_object_changes_read_responses.go b/netbox/client/extras/extras_object_changes_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e5fbd81a6fcde90cea5bd0b133ba29185d927a42 --- /dev/null +++ b/netbox/client/extras/extras_object_changes_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasObjectChangesReadReader is a Reader for the ExtrasObjectChangesRead structure. +type ExtrasObjectChangesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasObjectChangesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasObjectChangesReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasObjectChangesReadOK creates a ExtrasObjectChangesReadOK with default headers values +func NewExtrasObjectChangesReadOK() *ExtrasObjectChangesReadOK { + return &ExtrasObjectChangesReadOK{} +} + +/*ExtrasObjectChangesReadOK handles this case with default header values. + +ExtrasObjectChangesReadOK extras object changes read o k +*/ +type ExtrasObjectChangesReadOK struct { + Payload *models.ObjectChange +} + +func (o *ExtrasObjectChangesReadOK) Error() string { + return fmt.Sprintf("[GET /extras/object-changes/{id}/][%d] extrasObjectChangesReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasObjectChangesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ObjectChange) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_recent_activity_list_parameters.go b/netbox/client/extras/extras_recent_activity_list_parameters.go deleted file mode 100644 index 151f40afb024b24a33bf3305bc557bb77d5f30eb..0000000000000000000000000000000000000000 --- a/netbox/client/extras/extras_recent_activity_list_parameters.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package extras - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewExtrasRecentActivityListParams creates a new ExtrasRecentActivityListParams object -// with the default values initialized. -func NewExtrasRecentActivityListParams() *ExtrasRecentActivityListParams { - var () - return &ExtrasRecentActivityListParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewExtrasRecentActivityListParamsWithTimeout creates a new ExtrasRecentActivityListParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewExtrasRecentActivityListParamsWithTimeout(timeout time.Duration) *ExtrasRecentActivityListParams { - var () - return &ExtrasRecentActivityListParams{ - - timeout: timeout, - } -} - -// NewExtrasRecentActivityListParamsWithContext creates a new ExtrasRecentActivityListParams object -// with the default values initialized, and the ability to set a context for a request -func NewExtrasRecentActivityListParamsWithContext(ctx context.Context) *ExtrasRecentActivityListParams { - var () - return &ExtrasRecentActivityListParams{ - - Context: ctx, - } -} - -// NewExtrasRecentActivityListParamsWithHTTPClient creates a new ExtrasRecentActivityListParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewExtrasRecentActivityListParamsWithHTTPClient(client *http.Client) *ExtrasRecentActivityListParams { - var () - return &ExtrasRecentActivityListParams{ - HTTPClient: client, - } -} - -/*ExtrasRecentActivityListParams contains all the parameters to send to the API endpoint -for the extras recent activity list operation typically these are written to a http.Request -*/ -type ExtrasRecentActivityListParams struct { - - /*Limit - Number of results to return per page. - - */ - Limit *int64 - /*Offset - The initial index from which to return the results. - - */ - Offset *int64 - /*User*/ - User *string - /*Username*/ - Username *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) WithTimeout(timeout time.Duration) *ExtrasRecentActivityListParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) WithContext(ctx context.Context) *ExtrasRecentActivityListParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) WithHTTPClient(client *http.Client) *ExtrasRecentActivityListParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLimit adds the limit to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) WithLimit(limit *int64) *ExtrasRecentActivityListParams { - o.SetLimit(limit) - return o -} - -// SetLimit adds the limit to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) SetLimit(limit *int64) { - o.Limit = limit -} - -// WithOffset adds the offset to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) WithOffset(offset *int64) *ExtrasRecentActivityListParams { - o.SetOffset(offset) - return o -} - -// SetOffset adds the offset to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) SetOffset(offset *int64) { - o.Offset = offset -} - -// WithUser adds the user to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) WithUser(user *string) *ExtrasRecentActivityListParams { - o.SetUser(user) - return o -} - -// SetUser adds the user to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) SetUser(user *string) { - o.User = user -} - -// WithUsername adds the username to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) WithUsername(username *string) *ExtrasRecentActivityListParams { - o.SetUsername(username) - return o -} - -// SetUsername adds the username to the extras recent activity list params -func (o *ExtrasRecentActivityListParams) SetUsername(username *string) { - o.Username = username -} - -// WriteToRequest writes these params to a swagger request -func (o *ExtrasRecentActivityListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Limit != nil { - - // query param limit - var qrLimit int64 - if o.Limit != nil { - qrLimit = *o.Limit - } - qLimit := swag.FormatInt64(qrLimit) - if qLimit != "" { - if err := r.SetQueryParam("limit", qLimit); err != nil { - return err - } - } - - } - - if o.Offset != nil { - - // query param offset - var qrOffset int64 - if o.Offset != nil { - qrOffset = *o.Offset - } - qOffset := swag.FormatInt64(qrOffset) - if qOffset != "" { - if err := r.SetQueryParam("offset", qOffset); err != nil { - return err - } - } - - } - - if o.User != nil { - - // query param user - var qrUser string - if o.User != nil { - qrUser = *o.User - } - qUser := qrUser - if qUser != "" { - if err := r.SetQueryParam("user", qUser); err != nil { - return err - } - } - - } - - if o.Username != nil { - - // query param username - var qrUsername string - if o.Username != nil { - qrUsername = *o.Username - } - qUsername := qrUsername - if qUsername != "" { - if err := r.SetQueryParam("username", qUsername); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/client/extras/extras_recent_activity_read_parameters.go b/netbox/client/extras/extras_recent_activity_read_parameters.go deleted file mode 100644 index 036a5df60341eef1c9eb9bb151f8f5912460ccc2..0000000000000000000000000000000000000000 --- a/netbox/client/extras/extras_recent_activity_read_parameters.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package extras - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - "time" - - "golang.org/x/net/context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/swag" - - strfmt "github.com/go-openapi/strfmt" -) - -// NewExtrasRecentActivityReadParams creates a new ExtrasRecentActivityReadParams object -// with the default values initialized. -func NewExtrasRecentActivityReadParams() *ExtrasRecentActivityReadParams { - var () - return &ExtrasRecentActivityReadParams{ - - timeout: cr.DefaultTimeout, - } -} - -// NewExtrasRecentActivityReadParamsWithTimeout creates a new ExtrasRecentActivityReadParams object -// with the default values initialized, and the ability to set a timeout on a request -func NewExtrasRecentActivityReadParamsWithTimeout(timeout time.Duration) *ExtrasRecentActivityReadParams { - var () - return &ExtrasRecentActivityReadParams{ - - timeout: timeout, - } -} - -// NewExtrasRecentActivityReadParamsWithContext creates a new ExtrasRecentActivityReadParams object -// with the default values initialized, and the ability to set a context for a request -func NewExtrasRecentActivityReadParamsWithContext(ctx context.Context) *ExtrasRecentActivityReadParams { - var () - return &ExtrasRecentActivityReadParams{ - - Context: ctx, - } -} - -// NewExtrasRecentActivityReadParamsWithHTTPClient creates a new ExtrasRecentActivityReadParams object -// with the default values initialized, and the ability to set a custom HTTPClient for a request -func NewExtrasRecentActivityReadParamsWithHTTPClient(client *http.Client) *ExtrasRecentActivityReadParams { - var () - return &ExtrasRecentActivityReadParams{ - HTTPClient: client, - } -} - -/*ExtrasRecentActivityReadParams contains all the parameters to send to the API endpoint -for the extras recent activity read operation typically these are written to a http.Request -*/ -type ExtrasRecentActivityReadParams struct { - - /*ID - A unique integer value identifying this user action. - - */ - ID int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithTimeout adds the timeout to the extras recent activity read params -func (o *ExtrasRecentActivityReadParams) WithTimeout(timeout time.Duration) *ExtrasRecentActivityReadParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the extras recent activity read params -func (o *ExtrasRecentActivityReadParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the extras recent activity read params -func (o *ExtrasRecentActivityReadParams) WithContext(ctx context.Context) *ExtrasRecentActivityReadParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the extras recent activity read params -func (o *ExtrasRecentActivityReadParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the extras recent activity read params -func (o *ExtrasRecentActivityReadParams) WithHTTPClient(client *http.Client) *ExtrasRecentActivityReadParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the extras recent activity read params -func (o *ExtrasRecentActivityReadParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithID adds the id to the extras recent activity read params -func (o *ExtrasRecentActivityReadParams) WithID(id int64) *ExtrasRecentActivityReadParams { - o.SetID(id) - return o -} - -// SetID adds the id to the extras recent activity read params -func (o *ExtrasRecentActivityReadParams) SetID(id int64) { - o.ID = id -} - -// WriteToRequest writes these params to a swagger request -func (o *ExtrasRecentActivityReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param id - if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/client/extras/extras_reports_list_parameters.go b/netbox/client/extras/extras_reports_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..11acdcf93a343c306fed074abca40f775bf6e1f7 --- /dev/null +++ b/netbox/client/extras/extras_reports_list_parameters.go @@ -0,0 +1,127 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasReportsListParams creates a new ExtrasReportsListParams object +// with the default values initialized. +func NewExtrasReportsListParams() *ExtrasReportsListParams { + + return &ExtrasReportsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasReportsListParamsWithTimeout creates a new ExtrasReportsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasReportsListParamsWithTimeout(timeout time.Duration) *ExtrasReportsListParams { + + return &ExtrasReportsListParams{ + + timeout: timeout, + } +} + +// NewExtrasReportsListParamsWithContext creates a new ExtrasReportsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasReportsListParamsWithContext(ctx context.Context) *ExtrasReportsListParams { + + return &ExtrasReportsListParams{ + + Context: ctx, + } +} + +// NewExtrasReportsListParamsWithHTTPClient creates a new ExtrasReportsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasReportsListParamsWithHTTPClient(client *http.Client) *ExtrasReportsListParams { + + return &ExtrasReportsListParams{ + HTTPClient: client, + } +} + +/*ExtrasReportsListParams contains all the parameters to send to the API endpoint +for the extras reports list operation typically these are written to a http.Request +*/ +type ExtrasReportsListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras reports list params +func (o *ExtrasReportsListParams) WithTimeout(timeout time.Duration) *ExtrasReportsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras reports list params +func (o *ExtrasReportsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras reports list params +func (o *ExtrasReportsListParams) WithContext(ctx context.Context) *ExtrasReportsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras reports list params +func (o *ExtrasReportsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras reports list params +func (o *ExtrasReportsListParams) WithHTTPClient(client *http.Client) *ExtrasReportsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras reports list params +func (o *ExtrasReportsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasReportsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_reports_list_responses.go b/netbox/client/extras/extras_reports_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..172f4b2269bbb349bf0f0805c03d833f1c25ddc8 --- /dev/null +++ b/netbox/client/extras/extras_reports_list_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasReportsListReader is a Reader for the ExtrasReportsList structure. +type ExtrasReportsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasReportsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasReportsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasReportsListOK creates a ExtrasReportsListOK with default headers values +func NewExtrasReportsListOK() *ExtrasReportsListOK { + return &ExtrasReportsListOK{} +} + +/*ExtrasReportsListOK handles this case with default header values. + +ExtrasReportsListOK extras reports list o k +*/ +type ExtrasReportsListOK struct { +} + +func (o *ExtrasReportsListOK) Error() string { + return fmt.Sprintf("[GET /extras/reports/][%d] extrasReportsListOK ", 200) +} + +func (o *ExtrasReportsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_reports_read_parameters.go b/netbox/client/extras/extras_reports_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dd28ccaea2f6498daad1a3fa0b3bba2b457c6f33 --- /dev/null +++ b/netbox/client/extras/extras_reports_read_parameters.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasReportsReadParams creates a new ExtrasReportsReadParams object +// with the default values initialized. +func NewExtrasReportsReadParams() *ExtrasReportsReadParams { + var () + return &ExtrasReportsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasReportsReadParamsWithTimeout creates a new ExtrasReportsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasReportsReadParamsWithTimeout(timeout time.Duration) *ExtrasReportsReadParams { + var () + return &ExtrasReportsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasReportsReadParamsWithContext creates a new ExtrasReportsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasReportsReadParamsWithContext(ctx context.Context) *ExtrasReportsReadParams { + var () + return &ExtrasReportsReadParams{ + + Context: ctx, + } +} + +// NewExtrasReportsReadParamsWithHTTPClient creates a new ExtrasReportsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasReportsReadParamsWithHTTPClient(client *http.Client) *ExtrasReportsReadParams { + var () + return &ExtrasReportsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasReportsReadParams contains all the parameters to send to the API endpoint +for the extras reports read operation typically these are written to a http.Request +*/ +type ExtrasReportsReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras reports read params +func (o *ExtrasReportsReadParams) WithTimeout(timeout time.Duration) *ExtrasReportsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras reports read params +func (o *ExtrasReportsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras reports read params +func (o *ExtrasReportsReadParams) WithContext(ctx context.Context) *ExtrasReportsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras reports read params +func (o *ExtrasReportsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras reports read params +func (o *ExtrasReportsReadParams) WithHTTPClient(client *http.Client) *ExtrasReportsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras reports read params +func (o *ExtrasReportsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras reports read params +func (o *ExtrasReportsReadParams) WithID(id string) *ExtrasReportsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras reports read params +func (o *ExtrasReportsReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasReportsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_reports_read_responses.go b/netbox/client/extras/extras_reports_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8db1a69949138b08c61fd848b1b45dc0843d7a5d --- /dev/null +++ b/netbox/client/extras/extras_reports_read_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasReportsReadReader is a Reader for the ExtrasReportsRead structure. +type ExtrasReportsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasReportsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasReportsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasReportsReadOK creates a ExtrasReportsReadOK with default headers values +func NewExtrasReportsReadOK() *ExtrasReportsReadOK { + return &ExtrasReportsReadOK{} +} + +/*ExtrasReportsReadOK handles this case with default header values. + +ExtrasReportsReadOK extras reports read o k +*/ +type ExtrasReportsReadOK struct { +} + +func (o *ExtrasReportsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/reports/{id}/][%d] extrasReportsReadOK ", 200) +} + +func (o *ExtrasReportsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_reports_run_parameters.go b/netbox/client/extras/extras_reports_run_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..aa662136a7adfd3796e635698c635ea43bbb5253 --- /dev/null +++ b/netbox/client/extras/extras_reports_run_parameters.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasReportsRunParams creates a new ExtrasReportsRunParams object +// with the default values initialized. +func NewExtrasReportsRunParams() *ExtrasReportsRunParams { + var () + return &ExtrasReportsRunParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasReportsRunParamsWithTimeout creates a new ExtrasReportsRunParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasReportsRunParamsWithTimeout(timeout time.Duration) *ExtrasReportsRunParams { + var () + return &ExtrasReportsRunParams{ + + timeout: timeout, + } +} + +// NewExtrasReportsRunParamsWithContext creates a new ExtrasReportsRunParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasReportsRunParamsWithContext(ctx context.Context) *ExtrasReportsRunParams { + var () + return &ExtrasReportsRunParams{ + + Context: ctx, + } +} + +// NewExtrasReportsRunParamsWithHTTPClient creates a new ExtrasReportsRunParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasReportsRunParamsWithHTTPClient(client *http.Client) *ExtrasReportsRunParams { + var () + return &ExtrasReportsRunParams{ + HTTPClient: client, + } +} + +/*ExtrasReportsRunParams contains all the parameters to send to the API endpoint +for the extras reports run operation typically these are written to a http.Request +*/ +type ExtrasReportsRunParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras reports run params +func (o *ExtrasReportsRunParams) WithTimeout(timeout time.Duration) *ExtrasReportsRunParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras reports run params +func (o *ExtrasReportsRunParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras reports run params +func (o *ExtrasReportsRunParams) WithContext(ctx context.Context) *ExtrasReportsRunParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras reports run params +func (o *ExtrasReportsRunParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras reports run params +func (o *ExtrasReportsRunParams) WithHTTPClient(client *http.Client) *ExtrasReportsRunParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras reports run params +func (o *ExtrasReportsRunParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras reports run params +func (o *ExtrasReportsRunParams) WithID(id string) *ExtrasReportsRunParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras reports run params +func (o *ExtrasReportsRunParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasReportsRunParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_reports_run_responses.go b/netbox/client/extras/extras_reports_run_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..994e80946d83b0955610d5ceabc33437ce1d67b4 --- /dev/null +++ b/netbox/client/extras/extras_reports_run_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasReportsRunReader is a Reader for the ExtrasReportsRun structure. +type ExtrasReportsRunReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasReportsRunReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasReportsRunCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasReportsRunCreated creates a ExtrasReportsRunCreated with default headers values +func NewExtrasReportsRunCreated() *ExtrasReportsRunCreated { + return &ExtrasReportsRunCreated{} +} + +/*ExtrasReportsRunCreated handles this case with default header values. + +ExtrasReportsRunCreated extras reports run created +*/ +type ExtrasReportsRunCreated struct { +} + +func (o *ExtrasReportsRunCreated) Error() string { + return fmt.Sprintf("[POST /extras/reports/{id}/run/][%d] extrasReportsRunCreated ", 201) +} + +func (o *ExtrasReportsRunCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_tags_create_parameters.go b/netbox/client/extras/extras_tags_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7a0178ab758cc1d2f5cb29c6473ab9974f447f40 --- /dev/null +++ b/netbox/client/extras/extras_tags_create_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasTagsCreateParams creates a new ExtrasTagsCreateParams object +// with the default values initialized. +func NewExtrasTagsCreateParams() *ExtrasTagsCreateParams { + var () + return &ExtrasTagsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTagsCreateParamsWithTimeout creates a new ExtrasTagsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTagsCreateParamsWithTimeout(timeout time.Duration) *ExtrasTagsCreateParams { + var () + return &ExtrasTagsCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasTagsCreateParamsWithContext creates a new ExtrasTagsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTagsCreateParamsWithContext(ctx context.Context) *ExtrasTagsCreateParams { + var () + return &ExtrasTagsCreateParams{ + + Context: ctx, + } +} + +// NewExtrasTagsCreateParamsWithHTTPClient creates a new ExtrasTagsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTagsCreateParamsWithHTTPClient(client *http.Client) *ExtrasTagsCreateParams { + var () + return &ExtrasTagsCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasTagsCreateParams contains all the parameters to send to the API endpoint +for the extras tags create operation typically these are written to a http.Request +*/ +type ExtrasTagsCreateParams struct { + + /*Data*/ + Data *models.Tag + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras tags create params +func (o *ExtrasTagsCreateParams) WithTimeout(timeout time.Duration) *ExtrasTagsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras tags create params +func (o *ExtrasTagsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras tags create params +func (o *ExtrasTagsCreateParams) WithContext(ctx context.Context) *ExtrasTagsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras tags create params +func (o *ExtrasTagsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras tags create params +func (o *ExtrasTagsCreateParams) WithHTTPClient(client *http.Client) *ExtrasTagsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras tags create params +func (o *ExtrasTagsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras tags create params +func (o *ExtrasTagsCreateParams) WithData(data *models.Tag) *ExtrasTagsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras tags create params +func (o *ExtrasTagsCreateParams) SetData(data *models.Tag) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTagsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_tags_create_responses.go b/netbox/client/extras/extras_tags_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4231e96eabb9cab07cbf3a03f3259ce5f396b5b8 --- /dev/null +++ b/netbox/client/extras/extras_tags_create_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTagsCreateReader is a Reader for the ExtrasTagsCreate structure. +type ExtrasTagsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTagsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasTagsCreateCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTagsCreateCreated creates a ExtrasTagsCreateCreated with default headers values +func NewExtrasTagsCreateCreated() *ExtrasTagsCreateCreated { + return &ExtrasTagsCreateCreated{} +} + +/*ExtrasTagsCreateCreated handles this case with default header values. + +ExtrasTagsCreateCreated extras tags create created +*/ +type ExtrasTagsCreateCreated struct { + Payload *models.Tag +} + +func (o *ExtrasTagsCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/tags/][%d] extrasTagsCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasTagsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Tag) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_tags_delete_parameters.go b/netbox/client/extras/extras_tags_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2811f2f42482af58e1492fc5c7669219499f26ee --- /dev/null +++ b/netbox/client/extras/extras_tags_delete_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTagsDeleteParams creates a new ExtrasTagsDeleteParams object +// with the default values initialized. +func NewExtrasTagsDeleteParams() *ExtrasTagsDeleteParams { + var () + return &ExtrasTagsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTagsDeleteParamsWithTimeout creates a new ExtrasTagsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTagsDeleteParamsWithTimeout(timeout time.Duration) *ExtrasTagsDeleteParams { + var () + return &ExtrasTagsDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasTagsDeleteParamsWithContext creates a new ExtrasTagsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTagsDeleteParamsWithContext(ctx context.Context) *ExtrasTagsDeleteParams { + var () + return &ExtrasTagsDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasTagsDeleteParamsWithHTTPClient creates a new ExtrasTagsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTagsDeleteParamsWithHTTPClient(client *http.Client) *ExtrasTagsDeleteParams { + var () + return &ExtrasTagsDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasTagsDeleteParams contains all the parameters to send to the API endpoint +for the extras tags delete operation typically these are written to a http.Request +*/ +type ExtrasTagsDeleteParams struct { + + /*ID + A unique integer value identifying this tag. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras tags delete params +func (o *ExtrasTagsDeleteParams) WithTimeout(timeout time.Duration) *ExtrasTagsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras tags delete params +func (o *ExtrasTagsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras tags delete params +func (o *ExtrasTagsDeleteParams) WithContext(ctx context.Context) *ExtrasTagsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras tags delete params +func (o *ExtrasTagsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras tags delete params +func (o *ExtrasTagsDeleteParams) WithHTTPClient(client *http.Client) *ExtrasTagsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras tags delete params +func (o *ExtrasTagsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras tags delete params +func (o *ExtrasTagsDeleteParams) WithID(id int64) *ExtrasTagsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras tags delete params +func (o *ExtrasTagsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTagsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_tags_delete_responses.go b/netbox/client/extras/extras_tags_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bc5e931fbb911c5574e06b914e1f18ce61929826 --- /dev/null +++ b/netbox/client/extras/extras_tags_delete_responses.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasTagsDeleteReader is a Reader for the ExtrasTagsDelete structure. +type ExtrasTagsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTagsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasTagsDeleteNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTagsDeleteNoContent creates a ExtrasTagsDeleteNoContent with default headers values +func NewExtrasTagsDeleteNoContent() *ExtrasTagsDeleteNoContent { + return &ExtrasTagsDeleteNoContent{} +} + +/*ExtrasTagsDeleteNoContent handles this case with default header values. + +ExtrasTagsDeleteNoContent extras tags delete no content +*/ +type ExtrasTagsDeleteNoContent struct { +} + +func (o *ExtrasTagsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/tags/{id}/][%d] extrasTagsDeleteNoContent ", 204) +} + +func (o *ExtrasTagsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_tags_list_parameters.go b/netbox/client/extras/extras_tags_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..00942640b7a176c17adc538cf5d721b33711e1a8 --- /dev/null +++ b/netbox/client/extras/extras_tags_list_parameters.go @@ -0,0 +1,281 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTagsListParams creates a new ExtrasTagsListParams object +// with the default values initialized. +func NewExtrasTagsListParams() *ExtrasTagsListParams { + var () + return &ExtrasTagsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTagsListParamsWithTimeout creates a new ExtrasTagsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTagsListParamsWithTimeout(timeout time.Duration) *ExtrasTagsListParams { + var () + return &ExtrasTagsListParams{ + + timeout: timeout, + } +} + +// NewExtrasTagsListParamsWithContext creates a new ExtrasTagsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTagsListParamsWithContext(ctx context.Context) *ExtrasTagsListParams { + var () + return &ExtrasTagsListParams{ + + Context: ctx, + } +} + +// NewExtrasTagsListParamsWithHTTPClient creates a new ExtrasTagsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTagsListParamsWithHTTPClient(client *http.Client) *ExtrasTagsListParams { + var () + return &ExtrasTagsListParams{ + HTTPClient: client, + } +} + +/*ExtrasTagsListParams contains all the parameters to send to the API endpoint +for the extras tags list operation typically these are written to a http.Request +*/ +type ExtrasTagsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras tags list params +func (o *ExtrasTagsListParams) WithTimeout(timeout time.Duration) *ExtrasTagsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras tags list params +func (o *ExtrasTagsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras tags list params +func (o *ExtrasTagsListParams) WithContext(ctx context.Context) *ExtrasTagsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras tags list params +func (o *ExtrasTagsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras tags list params +func (o *ExtrasTagsListParams) WithHTTPClient(client *http.Client) *ExtrasTagsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras tags list params +func (o *ExtrasTagsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras tags list params +func (o *ExtrasTagsListParams) WithLimit(limit *int64) *ExtrasTagsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras tags list params +func (o *ExtrasTagsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the extras tags list params +func (o *ExtrasTagsListParams) WithName(name *string) *ExtrasTagsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the extras tags list params +func (o *ExtrasTagsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the extras tags list params +func (o *ExtrasTagsListParams) WithOffset(offset *int64) *ExtrasTagsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras tags list params +func (o *ExtrasTagsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the extras tags list params +func (o *ExtrasTagsListParams) WithQ(q *string) *ExtrasTagsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the extras tags list params +func (o *ExtrasTagsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSlug adds the slug to the extras tags list params +func (o *ExtrasTagsListParams) WithSlug(slug *string) *ExtrasTagsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the extras tags list params +func (o *ExtrasTagsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTagsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_tags_list_responses.go b/netbox/client/extras/extras_tags_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2b9a5d2da4c77f79eb8e0b09ec8c76fdab52fdad --- /dev/null +++ b/netbox/client/extras/extras_tags_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTagsListReader is a Reader for the ExtrasTagsList structure. +type ExtrasTagsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTagsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTagsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTagsListOK creates a ExtrasTagsListOK with default headers values +func NewExtrasTagsListOK() *ExtrasTagsListOK { + return &ExtrasTagsListOK{} +} + +/*ExtrasTagsListOK handles this case with default header values. + +ExtrasTagsListOK extras tags list o k +*/ +type ExtrasTagsListOK struct { + Payload *ExtrasTagsListOKBody +} + +func (o *ExtrasTagsListOK) Error() string { + return fmt.Sprintf("[GET /extras/tags/][%d] extrasTagsListOK %+v", 200, o.Payload) +} + +func (o *ExtrasTagsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(ExtrasTagsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*ExtrasTagsListOKBody extras tags list o k body +swagger:model ExtrasTagsListOKBody +*/ +type ExtrasTagsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Tag `json:"results"` +} + +// Validate validates this extras tags list o k body +func (o *ExtrasTagsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ExtrasTagsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("extrasTagsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *ExtrasTagsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("extrasTagsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasTagsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("extrasTagsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasTagsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("extrasTagsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extrasTagsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ExtrasTagsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ExtrasTagsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasTagsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/extras/extras_tags_partial_update_parameters.go b/netbox/client/extras/extras_tags_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3c78e3f2df80ad524d20f8984329c2249dfa7e60 --- /dev/null +++ b/netbox/client/extras/extras_tags_partial_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasTagsPartialUpdateParams creates a new ExtrasTagsPartialUpdateParams object +// with the default values initialized. +func NewExtrasTagsPartialUpdateParams() *ExtrasTagsPartialUpdateParams { + var () + return &ExtrasTagsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTagsPartialUpdateParamsWithTimeout creates a new ExtrasTagsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTagsPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasTagsPartialUpdateParams { + var () + return &ExtrasTagsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasTagsPartialUpdateParamsWithContext creates a new ExtrasTagsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTagsPartialUpdateParamsWithContext(ctx context.Context) *ExtrasTagsPartialUpdateParams { + var () + return &ExtrasTagsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasTagsPartialUpdateParamsWithHTTPClient creates a new ExtrasTagsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTagsPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasTagsPartialUpdateParams { + var () + return &ExtrasTagsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasTagsPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras tags partial update operation typically these are written to a http.Request +*/ +type ExtrasTagsPartialUpdateParams struct { + + /*Data*/ + Data *models.Tag + /*ID + A unique integer value identifying this tag. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasTagsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) WithContext(ctx context.Context) *ExtrasTagsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasTagsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) WithData(data *models.Tag) *ExtrasTagsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) SetData(data *models.Tag) { + o.Data = data +} + +// WithID adds the id to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) WithID(id int64) *ExtrasTagsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras tags partial update params +func (o *ExtrasTagsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTagsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_tags_partial_update_responses.go b/netbox/client/extras/extras_tags_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7d85b2e10063bf8a18f7a73b73988757294fdce1 --- /dev/null +++ b/netbox/client/extras/extras_tags_partial_update_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTagsPartialUpdateReader is a Reader for the ExtrasTagsPartialUpdate structure. +type ExtrasTagsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTagsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTagsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTagsPartialUpdateOK creates a ExtrasTagsPartialUpdateOK with default headers values +func NewExtrasTagsPartialUpdateOK() *ExtrasTagsPartialUpdateOK { + return &ExtrasTagsPartialUpdateOK{} +} + +/*ExtrasTagsPartialUpdateOK handles this case with default header values. + +ExtrasTagsPartialUpdateOK extras tags partial update o k +*/ +type ExtrasTagsPartialUpdateOK struct { + Payload *models.Tag +} + +func (o *ExtrasTagsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/tags/{id}/][%d] extrasTagsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasTagsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Tag) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_tags_read_parameters.go b/netbox/client/extras/extras_tags_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3009cf4242629b4fab3d8d9fa5d5439244b1168d --- /dev/null +++ b/netbox/client/extras/extras_tags_read_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTagsReadParams creates a new ExtrasTagsReadParams object +// with the default values initialized. +func NewExtrasTagsReadParams() *ExtrasTagsReadParams { + var () + return &ExtrasTagsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTagsReadParamsWithTimeout creates a new ExtrasTagsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTagsReadParamsWithTimeout(timeout time.Duration) *ExtrasTagsReadParams { + var () + return &ExtrasTagsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasTagsReadParamsWithContext creates a new ExtrasTagsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTagsReadParamsWithContext(ctx context.Context) *ExtrasTagsReadParams { + var () + return &ExtrasTagsReadParams{ + + Context: ctx, + } +} + +// NewExtrasTagsReadParamsWithHTTPClient creates a new ExtrasTagsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTagsReadParamsWithHTTPClient(client *http.Client) *ExtrasTagsReadParams { + var () + return &ExtrasTagsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasTagsReadParams contains all the parameters to send to the API endpoint +for the extras tags read operation typically these are written to a http.Request +*/ +type ExtrasTagsReadParams struct { + + /*ID + A unique integer value identifying this tag. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras tags read params +func (o *ExtrasTagsReadParams) WithTimeout(timeout time.Duration) *ExtrasTagsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras tags read params +func (o *ExtrasTagsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras tags read params +func (o *ExtrasTagsReadParams) WithContext(ctx context.Context) *ExtrasTagsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras tags read params +func (o *ExtrasTagsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras tags read params +func (o *ExtrasTagsReadParams) WithHTTPClient(client *http.Client) *ExtrasTagsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras tags read params +func (o *ExtrasTagsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras tags read params +func (o *ExtrasTagsReadParams) WithID(id int64) *ExtrasTagsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras tags read params +func (o *ExtrasTagsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTagsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_tags_read_responses.go b/netbox/client/extras/extras_tags_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4b6dfb764f9f0214a0416076413785c3aeece8be --- /dev/null +++ b/netbox/client/extras/extras_tags_read_responses.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// ExtrasTagsReadReader is a Reader for the ExtrasTagsRead structure. +type ExtrasTagsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTagsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTagsReadOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewExtrasTagsReadOK creates a ExtrasTagsReadOK with default headers values +func NewExtrasTagsReadOK() *ExtrasTagsReadOK { + return &ExtrasTagsReadOK{} +} + +/*ExtrasTagsReadOK handles this case with default header values. + +ExtrasTagsReadOK extras tags read o k +*/ +type ExtrasTagsReadOK struct { + Payload *models.Tag +} + +func (o *ExtrasTagsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/tags/{id}/][%d] extrasTagsReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasTagsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Tag) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_tags_update_parameters.go b/netbox/client/extras/extras_tags_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a89bfcfbe35c4ab628ddc86eeb28ea1cbe455931 --- /dev/null +++ b/netbox/client/extras/extras_tags_update_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// NewExtrasTagsUpdateParams creates a new ExtrasTagsUpdateParams object +// with the default values initialized. +func NewExtrasTagsUpdateParams() *ExtrasTagsUpdateParams { + var () + return &ExtrasTagsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTagsUpdateParamsWithTimeout creates a new ExtrasTagsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTagsUpdateParamsWithTimeout(timeout time.Duration) *ExtrasTagsUpdateParams { + var () + return &ExtrasTagsUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasTagsUpdateParamsWithContext creates a new ExtrasTagsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTagsUpdateParamsWithContext(ctx context.Context) *ExtrasTagsUpdateParams { + var () + return &ExtrasTagsUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasTagsUpdateParamsWithHTTPClient creates a new ExtrasTagsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTagsUpdateParamsWithHTTPClient(client *http.Client) *ExtrasTagsUpdateParams { + var () + return &ExtrasTagsUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasTagsUpdateParams contains all the parameters to send to the API endpoint +for the extras tags update operation typically these are written to a http.Request +*/ +type ExtrasTagsUpdateParams struct { + + /*Data*/ + Data *models.Tag + /*ID + A unique integer value identifying this tag. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras tags update params +func (o *ExtrasTagsUpdateParams) WithTimeout(timeout time.Duration) *ExtrasTagsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras tags update params +func (o *ExtrasTagsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras tags update params +func (o *ExtrasTagsUpdateParams) WithContext(ctx context.Context) *ExtrasTagsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras tags update params +func (o *ExtrasTagsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras tags update params +func (o *ExtrasTagsUpdateParams) WithHTTPClient(client *http.Client) *ExtrasTagsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras tags update params +func (o *ExtrasTagsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras tags update params +func (o *ExtrasTagsUpdateParams) WithData(data *models.Tag) *ExtrasTagsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras tags update params +func (o *ExtrasTagsUpdateParams) SetData(data *models.Tag) { + o.Data = data +} + +// WithID adds the id to the extras tags update params +func (o *ExtrasTagsUpdateParams) WithID(id int64) *ExtrasTagsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras tags update params +func (o *ExtrasTagsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTagsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amprefixes_list_responses.go b/netbox/client/extras/extras_tags_update_responses.go similarity index 64% rename from netbox/client/ipam/ip_amprefixes_list_responses.go rename to netbox/client/extras/extras_tags_update_responses.go index 47a823c14ba64e577cc2e4314922652743975ed0..b92c1e7e6cfb9202bdd1e55a32ec1bc4ad73a66a 100644 --- a/netbox/client/ipam/ip_amprefixes_list_responses.go +++ b/netbox/client/extras/extras_tags_update_responses.go @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package ipam +package extras // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command @@ -27,20 +27,20 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) -// IPAMPrefixesListReader is a Reader for the IPAMPrefixesList structure. -type IPAMPrefixesListReader struct { +// ExtrasTagsUpdateReader is a Reader for the ExtrasTagsUpdate structure. +type ExtrasTagsUpdateReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. -func (o *IPAMPrefixesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { +func (o *ExtrasTagsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: - result := NewIPAMPrefixesListOK() + result := NewExtrasTagsUpdateOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } @@ -51,26 +51,26 @@ func (o *IPAMPrefixesListReader) ReadResponse(response runtime.ClientResponse, c } } -// NewIPAMPrefixesListOK creates a IPAMPrefixesListOK with default headers values -func NewIPAMPrefixesListOK() *IPAMPrefixesListOK { - return &IPAMPrefixesListOK{} +// NewExtrasTagsUpdateOK creates a ExtrasTagsUpdateOK with default headers values +func NewExtrasTagsUpdateOK() *ExtrasTagsUpdateOK { + return &ExtrasTagsUpdateOK{} } -/*IPAMPrefixesListOK handles this case with default header values. +/*ExtrasTagsUpdateOK handles this case with default header values. -IPAMPrefixesListOK ipam prefixes list o k +ExtrasTagsUpdateOK extras tags update o k */ -type IPAMPrefixesListOK struct { - Payload *models.IPAMPrefixesListOKBody +type ExtrasTagsUpdateOK struct { + Payload *models.Tag } -func (o *IPAMPrefixesListOK) Error() string { - return fmt.Sprintf("[GET /ipam/prefixes/][%d] ipamPrefixesListOK %+v", 200, o.Payload) +func (o *ExtrasTagsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/tags/{id}/][%d] extrasTagsUpdateOK %+v", 200, o.Payload) } -func (o *IPAMPrefixesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { +func (o *ExtrasTagsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.IPAMPrefixesListOKBody) + o.Payload = new(models.Tag) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_topology_maps_create_parameters.go b/netbox/client/extras/extras_topology_maps_create_parameters.go index 0935c06bc7ba81993acfd702667ae01835bd530a..18e3c575d054bd8139d166a809a018860c6482ab 100644 --- a/netbox/client/extras/extras_topology_maps_create_parameters.go +++ b/netbox/client/extras/extras_topology_maps_create_parameters.go @@ -20,18 +20,17 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasTopologyMapsCreateParams creates a new ExtrasTopologyMapsCreateParams object diff --git a/netbox/client/extras/extras_topology_maps_create_responses.go b/netbox/client/extras/extras_topology_maps_create_responses.go index a1b92be2b45857cf6c991857e213359b2884bbd0..6ab6390004c0ec4c06fc5e64155b9853699cd3c3 100644 --- a/netbox/client/extras/extras_topology_maps_create_responses.go +++ b/netbox/client/extras/extras_topology_maps_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasTopologyMapsCreateReader is a Reader for the ExtrasTopologyMapsCreate structure. @@ -61,7 +61,7 @@ func NewExtrasTopologyMapsCreateCreated() *ExtrasTopologyMapsCreateCreated { ExtrasTopologyMapsCreateCreated extras topology maps create created */ type ExtrasTopologyMapsCreateCreated struct { - Payload *models.WritableTopologyMap + Payload *models.TopologyMap } func (o *ExtrasTopologyMapsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasTopologyMapsCreateCreated) Error() string { func (o *ExtrasTopologyMapsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableTopologyMap) + o.Payload = new(models.TopologyMap) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_topology_maps_delete_parameters.go b/netbox/client/extras/extras_topology_maps_delete_parameters.go index ddb6ea4d010784326cfd339fef85e5a9ff93e6c7..64fd59d4069cba967e4edad67ed0813c49418659 100644 --- a/netbox/client/extras/extras_topology_maps_delete_parameters.go +++ b/netbox/client/extras/extras_topology_maps_delete_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_topology_maps_list_parameters.go b/netbox/client/extras/extras_topology_maps_list_parameters.go index 45c0274b2bc46fc29fcee6551a8c83162d87a70e..d848ddc328b60d9fa0abe4d20d2ee95859c2a426 100644 --- a/netbox/client/extras/extras_topology_maps_list_parameters.go +++ b/netbox/client/extras/extras_topology_maps_list_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_topology_maps_list_responses.go b/netbox/client/extras/extras_topology_maps_list_responses.go index 3ae731d171cc1c20417f5e9da4f33b2b35b49c25..e2a95a615cf708f7b15ecb50648adf4a3b28323e 100644 --- a/netbox/client/extras/extras_topology_maps_list_responses.go +++ b/netbox/client/extras/extras_topology_maps_list_responses.go @@ -22,12 +22,16 @@ package extras import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasTopologyMapsListReader is a Reader for the ExtrasTopologyMapsList structure. @@ -61,7 +65,7 @@ func NewExtrasTopologyMapsListOK() *ExtrasTopologyMapsListOK { ExtrasTopologyMapsListOK extras topology maps list o k */ type ExtrasTopologyMapsListOK struct { - Payload *models.ExtrasTopologyMapsListOKBody + Payload *ExtrasTopologyMapsListOKBody } func (o *ExtrasTopologyMapsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *ExtrasTopologyMapsListOK) Error() string { func (o *ExtrasTopologyMapsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.ExtrasTopologyMapsListOKBody) + o.Payload = new(ExtrasTopologyMapsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *ExtrasTopologyMapsListOK) readResponse(response runtime.ClientResponse, return nil } + +/*ExtrasTopologyMapsListOKBody extras topology maps list o k body +swagger:model ExtrasTopologyMapsListOKBody +*/ +type ExtrasTopologyMapsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.TopologyMap `json:"results"` +} + +// Validate validates this extras topology maps list o k body +func (o *ExtrasTopologyMapsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ExtrasTopologyMapsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("extrasTopologyMapsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *ExtrasTopologyMapsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("extrasTopologyMapsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasTopologyMapsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("extrasTopologyMapsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *ExtrasTopologyMapsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("extrasTopologyMapsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("extrasTopologyMapsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *ExtrasTopologyMapsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ExtrasTopologyMapsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasTopologyMapsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_partial_update_parameters.go b/netbox/client/extras/extras_topology_maps_partial_update_parameters.go index 9aa828757f801cfbeb588e716a3d325112be870a..84dbcef56de94a777cc52bc3d1a7547771a4fe33 100644 --- a/netbox/client/extras/extras_topology_maps_partial_update_parameters.go +++ b/netbox/client/extras/extras_topology_maps_partial_update_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasTopologyMapsPartialUpdateParams creates a new ExtrasTopologyMapsPartialUpdateParams object diff --git a/netbox/client/extras/extras_topology_maps_partial_update_responses.go b/netbox/client/extras/extras_topology_maps_partial_update_responses.go index 848f8608272ec60cfe18061ced7833cbd1921413..51fa6dc0f55b0c3b79db400c86e3257fe6773597 100644 --- a/netbox/client/extras/extras_topology_maps_partial_update_responses.go +++ b/netbox/client/extras/extras_topology_maps_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasTopologyMapsPartialUpdateReader is a Reader for the ExtrasTopologyMapsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewExtrasTopologyMapsPartialUpdateOK() *ExtrasTopologyMapsPartialUpdateOK { ExtrasTopologyMapsPartialUpdateOK extras topology maps partial update o k */ type ExtrasTopologyMapsPartialUpdateOK struct { - Payload *models.WritableTopologyMap + Payload *models.TopologyMap } func (o *ExtrasTopologyMapsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasTopologyMapsPartialUpdateOK) Error() string { func (o *ExtrasTopologyMapsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableTopologyMap) + o.Payload = new(models.TopologyMap) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/extras/extras_topology_maps_read_parameters.go b/netbox/client/extras/extras_topology_maps_read_parameters.go index 5e91d092c5bb65b5e2185c08e173ea77f12c19c9..a89af3f8f27e94ac6f1b89189845c6c766ce5d06 100644 --- a/netbox/client/extras/extras_topology_maps_read_parameters.go +++ b/netbox/client/extras/extras_topology_maps_read_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_topology_maps_read_responses.go b/netbox/client/extras/extras_topology_maps_read_responses.go index c9a95f4ead32a321b85d514cd1c2063ff886c42c..f3129bcb3d11408201746568293569d3fab62a2f 100644 --- a/netbox/client/extras/extras_topology_maps_read_responses.go +++ b/netbox/client/extras/extras_topology_maps_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasTopologyMapsReadReader is a Reader for the ExtrasTopologyMapsRead structure. diff --git a/netbox/client/extras/extras_topology_maps_render_parameters.go b/netbox/client/extras/extras_topology_maps_render_parameters.go index fd22e4ebc3394c97fa1d8d020ddc9e918968141d..78a9ad7d1c04b8d133c2d2adf9982f193d76da6e 100644 --- a/netbox/client/extras/extras_topology_maps_render_parameters.go +++ b/netbox/client/extras/extras_topology_maps_render_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/extras/extras_topology_maps_render_responses.go b/netbox/client/extras/extras_topology_maps_render_responses.go index 6d7ebdfb91cf99de3c52efcb2046276c8938bb2a..f1b973fbb712848bcb8c34d6ef9c48466adb74fa 100644 --- a/netbox/client/extras/extras_topology_maps_render_responses.go +++ b/netbox/client/extras/extras_topology_maps_render_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasTopologyMapsRenderReader is a Reader for the ExtrasTopologyMapsRender structure. diff --git a/netbox/client/extras/extras_topology_maps_update_parameters.go b/netbox/client/extras/extras_topology_maps_update_parameters.go index f671e0f8d14bef9ea5ae3a73676840e296d46925..7d3bb7ffd47debfb3f3bdbefea563ae9f9f96d2b 100644 --- a/netbox/client/extras/extras_topology_maps_update_parameters.go +++ b/netbox/client/extras/extras_topology_maps_update_parameters.go @@ -20,11 +20,10 @@ package extras // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewExtrasTopologyMapsUpdateParams creates a new ExtrasTopologyMapsUpdateParams object diff --git a/netbox/client/extras/extras_topology_maps_update_responses.go b/netbox/client/extras/extras_topology_maps_update_responses.go index 167ae824751aae88a2c49da0e6cd11ee5aa2f984..15e1e3f765911afc5f4f4ee16d9e4e9b0619023a 100644 --- a/netbox/client/extras/extras_topology_maps_update_responses.go +++ b/netbox/client/extras/extras_topology_maps_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // ExtrasTopologyMapsUpdateReader is a Reader for the ExtrasTopologyMapsUpdate structure. @@ -61,7 +61,7 @@ func NewExtrasTopologyMapsUpdateOK() *ExtrasTopologyMapsUpdateOK { ExtrasTopologyMapsUpdateOK extras topology maps update o k */ type ExtrasTopologyMapsUpdateOK struct { - Payload *models.WritableTopologyMap + Payload *models.TopologyMap } func (o *ExtrasTopologyMapsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *ExtrasTopologyMapsUpdateOK) Error() string { func (o *ExtrasTopologyMapsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableTopologyMap) + o.Payload = new(models.TopologyMap) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amaggregates_create_parameters.go b/netbox/client/ipam/ip_a_m_aggregates_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amaggregates_create_parameters.go rename to netbox/client/ipam/ip_a_m_aggregates_create_parameters.go index 15d978813a0fecf0d3c23300f10973ee3c30fab3..0a8a009404177067d1e94d7f0bf1d248ca7fb8b3 100644 --- a/netbox/client/ipam/ip_amaggregates_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_aggregates_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMAggregatesCreateParams creates a new IPAMAggregatesCreateParams object diff --git a/netbox/client/ipam/ip_amaggregates_create_responses.go b/netbox/client/ipam/ip_a_m_aggregates_create_responses.go similarity index 94% rename from netbox/client/ipam/ip_amaggregates_create_responses.go rename to netbox/client/ipam/ip_a_m_aggregates_create_responses.go index c4f82dda9f9791730fc92bcbf8f1452d595dd24d..39fa728b2af8d772c62d39c0e3c27ac5014c3f16 100644 --- a/netbox/client/ipam/ip_amaggregates_create_responses.go +++ b/netbox/client/ipam/ip_a_m_aggregates_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMAggregatesCreateReader is a Reader for the IPAMAggregatesCreate structure. @@ -61,7 +61,7 @@ func NewIPAMAggregatesCreateCreated() *IPAMAggregatesCreateCreated { IPAMAggregatesCreateCreated ipam aggregates create created */ type IPAMAggregatesCreateCreated struct { - Payload *models.WritableAggregate + Payload *models.Aggregate } func (o *IPAMAggregatesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMAggregatesCreateCreated) Error() string { func (o *IPAMAggregatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableAggregate) + o.Payload = new(models.Aggregate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amaggregates_delete_parameters.go b/netbox/client/ipam/ip_a_m_aggregates_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amaggregates_delete_parameters.go rename to netbox/client/ipam/ip_a_m_aggregates_delete_parameters.go index da251711558b46119e47210fb44e0e034bbc8d17..34f3540d466d625ee46c3c71cb58cf704895b0bb 100644 --- a/netbox/client/ipam/ip_amaggregates_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_aggregates_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amaggregates_delete_responses.go b/netbox/client/ipam/ip_a_m_aggregates_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amaggregates_delete_responses.go rename to netbox/client/ipam/ip_a_m_aggregates_delete_responses.go diff --git a/netbox/client/ipam/ip_amaggregates_list_parameters.go b/netbox/client/ipam/ip_a_m_aggregates_list_parameters.go similarity index 88% rename from netbox/client/ipam/ip_amaggregates_list_parameters.go rename to netbox/client/ipam/ip_a_m_aggregates_list_parameters.go index 9a574db727957f9f59dca326df70d3e47a74b088..728616354dd9dcdfcb64c10132194e296d5fbace 100644 --- a/netbox/client/ipam/ip_amaggregates_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_aggregates_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -96,12 +95,16 @@ type IPAMAggregatesListParams struct { */ Offset *int64 + /*Prefix*/ + Prefix *string /*Q*/ Q *string /*Rir*/ Rir *string /*RirID*/ RirID *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -196,6 +199,17 @@ func (o *IPAMAggregatesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithPrefix adds the prefix to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithPrefix(prefix *string) *IPAMAggregatesListParams { + o.SetPrefix(prefix) + return o +} + +// SetPrefix adds the prefix to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetPrefix(prefix *string) { + o.Prefix = prefix +} + // WithQ adds the q to the ipam aggregates list params func (o *IPAMAggregatesListParams) WithQ(q *string) *IPAMAggregatesListParams { o.SetQ(q) @@ -229,6 +243,17 @@ func (o *IPAMAggregatesListParams) SetRirID(rirID *string) { o.RirID = rirID } +// WithTag adds the tag to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithTag(tag *string) *IPAMAggregatesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *IPAMAggregatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -317,6 +342,22 @@ func (o *IPAMAggregatesListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Prefix != nil { + + // query param prefix + var qrPrefix string + if o.Prefix != nil { + qrPrefix = *o.Prefix + } + qPrefix := qrPrefix + if qPrefix != "" { + if err := r.SetQueryParam("prefix", qPrefix); err != nil { + return err + } + } + + } + if o.Q != nil { // query param q @@ -365,6 +406,22 @@ func (o *IPAMAggregatesListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/ipam/ip_a_m_aggregates_list_responses.go b/netbox/client/ipam/ip_a_m_aggregates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d1c237800f5b221a9b81db0bed3e940ac680f972 --- /dev/null +++ b/netbox/client/ipam/ip_a_m_aggregates_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMAggregatesListReader is a Reader for the IPAMAggregatesList structure. +type IPAMAggregatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMAggregatesListOK creates a IPAMAggregatesListOK with default headers values +func NewIPAMAggregatesListOK() *IPAMAggregatesListOK { + return &IPAMAggregatesListOK{} +} + +/*IPAMAggregatesListOK handles this case with default header values. + +IPAMAggregatesListOK ipam aggregates list o k +*/ +type IPAMAggregatesListOK struct { + Payload *IPAMAggregatesListOKBody +} + +func (o *IPAMAggregatesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/aggregates/][%d] ipamAggregatesListOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMAggregatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMAggregatesListOKBody IP a m aggregates list o k body +swagger:model IPAMAggregatesListOKBody +*/ +type IPAMAggregatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Aggregate `json:"results"` +} + +// Validate validates this IP a m aggregates list o k body +func (o *IPAMAggregatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMAggregatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamAggregatesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMAggregatesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamAggregatesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMAggregatesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamAggregatesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMAggregatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamAggregatesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamAggregatesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMAggregatesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMAggregatesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMAggregatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amaggregates_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_aggregates_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amaggregates_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_aggregates_partial_update_parameters.go index b256992d833259f4541fae11a7ed614af41a3d8b..40916f02b8505737fdf6e9677e03f63efe2b72ee 100644 --- a/netbox/client/ipam/ip_amaggregates_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_aggregates_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMAggregatesPartialUpdateParams creates a new IPAMAggregatesPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amaggregates_partial_update_responses.go b/netbox/client/ipam/ip_a_m_aggregates_partial_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amaggregates_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_aggregates_partial_update_responses.go index 294692b954e7928df1dc0d1454fb58d502fea669..686d3c9cb810b15adef25614a62e324d54362739 100644 --- a/netbox/client/ipam/ip_amaggregates_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_aggregates_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMAggregatesPartialUpdateReader is a Reader for the IPAMAggregatesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMAggregatesPartialUpdateOK() *IPAMAggregatesPartialUpdateOK { IPAMAggregatesPartialUpdateOK ipam aggregates partial update o k */ type IPAMAggregatesPartialUpdateOK struct { - Payload *models.WritableAggregate + Payload *models.Aggregate } func (o *IPAMAggregatesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMAggregatesPartialUpdateOK) Error() string { func (o *IPAMAggregatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableAggregate) + o.Payload = new(models.Aggregate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amaggregates_read_parameters.go b/netbox/client/ipam/ip_a_m_aggregates_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amaggregates_read_parameters.go rename to netbox/client/ipam/ip_a_m_aggregates_read_parameters.go index 627f725d93e8fb5ac78e5225a62eca0b7bb27c70..a344f443087b34b0e06f7907b0eea8f95121a87c 100644 --- a/netbox/client/ipam/ip_amaggregates_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_aggregates_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amaggregates_read_responses.go b/netbox/client/ipam/ip_a_m_aggregates_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amaggregates_read_responses.go rename to netbox/client/ipam/ip_a_m_aggregates_read_responses.go index 0d23dd8b744b029b767bedbd49f1e693b5d87bd7..42da40ae8a18e15a3e9a9fe5bbdfc84f03639718 100644 --- a/netbox/client/ipam/ip_amaggregates_read_responses.go +++ b/netbox/client/ipam/ip_a_m_aggregates_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMAggregatesReadReader is a Reader for the IPAMAggregatesRead structure. diff --git a/netbox/client/ipam/ip_amaggregates_update_parameters.go b/netbox/client/ipam/ip_a_m_aggregates_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amaggregates_update_parameters.go rename to netbox/client/ipam/ip_a_m_aggregates_update_parameters.go index b3fa0432c3e0bdaa7727d7a1f3a2cdf7ad8c55ea..4bd757ae190cc8a3de45082062f0101c188f0369 100644 --- a/netbox/client/ipam/ip_amaggregates_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_aggregates_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMAggregatesUpdateParams creates a new IPAMAggregatesUpdateParams object diff --git a/netbox/client/ipam/ip_amaggregates_update_responses.go b/netbox/client/ipam/ip_a_m_aggregates_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amaggregates_update_responses.go rename to netbox/client/ipam/ip_a_m_aggregates_update_responses.go index 205b88c035f04dc69808494befd80415a93cff29..5f4ec8e3e2df2d728f5ff9caab82798eb126cb10 100644 --- a/netbox/client/ipam/ip_amaggregates_update_responses.go +++ b/netbox/client/ipam/ip_a_m_aggregates_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMAggregatesUpdateReader is a Reader for the IPAMAggregatesUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMAggregatesUpdateOK() *IPAMAggregatesUpdateOK { IPAMAggregatesUpdateOK ipam aggregates update o k */ type IPAMAggregatesUpdateOK struct { - Payload *models.WritableAggregate + Payload *models.Aggregate } func (o *IPAMAggregatesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMAggregatesUpdateOK) Error() string { func (o *IPAMAggregatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableAggregate) + o.Payload = new(models.Aggregate) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amchoices_list_parameters.go b/netbox/client/ipam/ip_a_m_choices_list_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amchoices_list_parameters.go rename to netbox/client/ipam/ip_a_m_choices_list_parameters.go index 9c2378f97de6cba05d90a69075cc3a9399ef592a..5587b7c53b2816ca9612db980b82b8a7060b8418 100644 --- a/netbox/client/ipam/ip_amchoices_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_choices_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amchoices_list_responses.go b/netbox/client/ipam/ip_a_m_choices_list_responses.go similarity index 100% rename from netbox/client/ipam/ip_amchoices_list_responses.go rename to netbox/client/ipam/ip_a_m_choices_list_responses.go diff --git a/netbox/client/ipam/ip_amchoices_read_parameters.go b/netbox/client/ipam/ip_a_m_choices_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amchoices_read_parameters.go rename to netbox/client/ipam/ip_a_m_choices_read_parameters.go index 834c1a3bfa325d5e38beb1eb1abd3be3cf07b9f7..fb1703211d1f2ba84ce60e5e28e2451da9dbff83 100644 --- a/netbox/client/ipam/ip_amchoices_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_choices_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amchoices_read_responses.go b/netbox/client/ipam/ip_a_m_choices_read_responses.go similarity index 100% rename from netbox/client/ipam/ip_amchoices_read_responses.go rename to netbox/client/ipam/ip_a_m_choices_read_responses.go diff --git a/netbox/client/ipam/ip_am_client.go b/netbox/client/ipam/ip_a_m_client.go similarity index 98% rename from netbox/client/ipam/ip_am_client.go rename to netbox/client/ipam/ip_a_m_client.go index a3a36f49bbce0f6dc8eb9175101848f1f283365d..7d15390b2ca97082f9313c82b7767555a4999286 100644 --- a/netbox/client/ipam/ip_am_client.go +++ b/netbox/client/ipam/ip_a_m_client.go @@ -155,7 +155,7 @@ func (a *Client) IPAMAggregatesDelete(params *IPAMAggregatesDeleteParams, authIn } /* -IPAMAggregatesList ipam aggregates list API +IPAMAggregatesList Call to super to allow for caching */ func (a *Client) IPAMAggregatesList(params *IPAMAggregatesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesListOK, error) { // TODO: Validate the params before sending @@ -213,7 +213,7 @@ func (a *Client) IPAMAggregatesPartialUpdate(params *IPAMAggregatesPartialUpdate } /* -IPAMAggregatesRead ipam aggregates read API +IPAMAggregatesRead Call to super to allow for caching */ func (a *Client) IPAMAggregatesRead(params *IPAMAggregatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesReadOK, error) { // TODO: Validate the params before sending @@ -329,7 +329,7 @@ func (a *Client) IPAMIPAddressesDelete(params *IPAMIPAddressesDeleteParams, auth } /* -IPAMIPAddressesList ipam ip addresses list API +IPAMIPAddressesList Call to super to allow for caching */ func (a *Client) IPAMIPAddressesList(params *IPAMIPAddressesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesListOK, error) { // TODO: Validate the params before sending @@ -387,7 +387,7 @@ func (a *Client) IPAMIPAddressesPartialUpdate(params *IPAMIPAddressesPartialUpda } /* -IPAMIPAddressesRead ipam ip addresses read API +IPAMIPAddressesRead Call to super to allow for caching */ func (a *Client) IPAMIPAddressesRead(params *IPAMIPAddressesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesReadOK, error) { // TODO: Validate the params before sending @@ -623,7 +623,7 @@ func (a *Client) IPAMPrefixesDelete(params *IPAMPrefixesDeleteParams, authInfo r } /* -IPAMPrefixesList ipam prefixes list API +IPAMPrefixesList Call to super to allow for caching */ func (a *Client) IPAMPrefixesList(params *IPAMPrefixesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesListOK, error) { // TODO: Validate the params before sending @@ -681,7 +681,7 @@ func (a *Client) IPAMPrefixesPartialUpdate(params *IPAMPrefixesPartialUpdatePara } /* -IPAMPrefixesRead ipam prefixes read API +IPAMPrefixesRead Call to super to allow for caching */ func (a *Client) IPAMPrefixesRead(params *IPAMPrefixesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesReadOK, error) { // TODO: Validate the params before sending @@ -797,7 +797,7 @@ func (a *Client) IPAMRirsDelete(params *IPAMRirsDeleteParams, authInfo runtime.C } /* -IPAMRirsList ipam rirs list API +IPAMRirsList Call to super to allow for caching */ func (a *Client) IPAMRirsList(params *IPAMRirsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsListOK, error) { // TODO: Validate the params before sending @@ -855,7 +855,7 @@ func (a *Client) IPAMRirsPartialUpdate(params *IPAMRirsPartialUpdateParams, auth } /* -IPAMRirsRead ipam rirs read API +IPAMRirsRead Call to super to allow for caching */ func (a *Client) IPAMRirsRead(params *IPAMRirsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsReadOK, error) { // TODO: Validate the params before sending @@ -971,7 +971,7 @@ func (a *Client) IPAMRolesDelete(params *IPAMRolesDeleteParams, authInfo runtime } /* -IPAMRolesList ipam roles list API +IPAMRolesList Call to super to allow for caching */ func (a *Client) IPAMRolesList(params *IPAMRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesListOK, error) { // TODO: Validate the params before sending @@ -1029,7 +1029,7 @@ func (a *Client) IPAMRolesPartialUpdate(params *IPAMRolesPartialUpdateParams, au } /* -IPAMRolesRead ipam roles read API +IPAMRolesRead Call to super to allow for caching */ func (a *Client) IPAMRolesRead(params *IPAMRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesReadOK, error) { // TODO: Validate the params before sending @@ -1145,7 +1145,7 @@ func (a *Client) IPAMServicesDelete(params *IPAMServicesDeleteParams, authInfo r } /* -IPAMServicesList ipam services list API +IPAMServicesList Call to super to allow for caching */ func (a *Client) IPAMServicesList(params *IPAMServicesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesListOK, error) { // TODO: Validate the params before sending @@ -1203,7 +1203,7 @@ func (a *Client) IPAMServicesPartialUpdate(params *IPAMServicesPartialUpdatePara } /* -IPAMServicesRead ipam services read API +IPAMServicesRead Call to super to allow for caching */ func (a *Client) IPAMServicesRead(params *IPAMServicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesReadOK, error) { // TODO: Validate the params before sending @@ -1319,7 +1319,7 @@ func (a *Client) IPAMVlanGroupsDelete(params *IPAMVlanGroupsDeleteParams, authIn } /* -IPAMVlanGroupsList ipam vlan groups list API +IPAMVlanGroupsList Call to super to allow for caching */ func (a *Client) IPAMVlanGroupsList(params *IPAMVlanGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsListOK, error) { // TODO: Validate the params before sending @@ -1377,7 +1377,7 @@ func (a *Client) IPAMVlanGroupsPartialUpdate(params *IPAMVlanGroupsPartialUpdate } /* -IPAMVlanGroupsRead ipam vlan groups read API +IPAMVlanGroupsRead Call to super to allow for caching */ func (a *Client) IPAMVlanGroupsRead(params *IPAMVlanGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsReadOK, error) { // TODO: Validate the params before sending @@ -1493,7 +1493,7 @@ func (a *Client) IPAMVlansDelete(params *IPAMVlansDeleteParams, authInfo runtime } /* -IPAMVlansList ipam vlans list API +IPAMVlansList Call to super to allow for caching */ func (a *Client) IPAMVlansList(params *IPAMVlansListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansListOK, error) { // TODO: Validate the params before sending @@ -1551,7 +1551,7 @@ func (a *Client) IPAMVlansPartialUpdate(params *IPAMVlansPartialUpdateParams, au } /* -IPAMVlansRead ipam vlans read API +IPAMVlansRead Call to super to allow for caching */ func (a *Client) IPAMVlansRead(params *IPAMVlansReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansReadOK, error) { // TODO: Validate the params before sending @@ -1667,7 +1667,7 @@ func (a *Client) IPAMVrfsDelete(params *IPAMVrfsDeleteParams, authInfo runtime.C } /* -IPAMVrfsList ipam vrfs list API +IPAMVrfsList Call to super to allow for caching */ func (a *Client) IPAMVrfsList(params *IPAMVrfsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsListOK, error) { // TODO: Validate the params before sending @@ -1725,7 +1725,7 @@ func (a *Client) IPAMVrfsPartialUpdate(params *IPAMVrfsPartialUpdateParams, auth } /* -IPAMVrfsRead ipam vrfs read API +IPAMVrfsRead Call to super to allow for caching */ func (a *Client) IPAMVrfsRead(params *IPAMVrfsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsReadOK, error) { // TODO: Validate the params before sending diff --git a/netbox/client/ipam/ip_amip_addresses_create_parameters.go b/netbox/client/ipam/ip_a_m_ip_addresses_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amip_addresses_create_parameters.go rename to netbox/client/ipam/ip_a_m_ip_addresses_create_parameters.go index 90ef06edc4ec7ab69e3a0cdc09c29592d2dc1188..8a0cd005a0c06b9eafa7b5f6c33578e5496649dc 100644 --- a/netbox/client/ipam/ip_amip_addresses_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMIPAddressesCreateParams creates a new IPAMIPAddressesCreateParams object diff --git a/netbox/client/ipam/ip_amip_addresses_create_responses.go b/netbox/client/ipam/ip_a_m_ip_addresses_create_responses.go similarity index 94% rename from netbox/client/ipam/ip_amip_addresses_create_responses.go rename to netbox/client/ipam/ip_a_m_ip_addresses_create_responses.go index 05729ded3217793f9b2576aee08b95018ebbcc68..e722000e9865bf10019a5eeb37b7306779a176ba 100644 --- a/netbox/client/ipam/ip_amip_addresses_create_responses.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMIPAddressesCreateReader is a Reader for the IPAMIPAddressesCreate structure. @@ -61,7 +61,7 @@ func NewIPAMIPAddressesCreateCreated() *IPAMIPAddressesCreateCreated { IPAMIPAddressesCreateCreated ipam Ip addresses create created */ type IPAMIPAddressesCreateCreated struct { - Payload *models.WritableIPAddress + Payload *models.IPAddress } func (o *IPAMIPAddressesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMIPAddressesCreateCreated) Error() string { func (o *IPAMIPAddressesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableIPAddress) + o.Payload = new(models.IPAddress) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amip_addresses_delete_parameters.go b/netbox/client/ipam/ip_a_m_ip_addresses_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amip_addresses_delete_parameters.go rename to netbox/client/ipam/ip_a_m_ip_addresses_delete_parameters.go index 8d4f9d12eca51438a759b99906108ab1a4a1ae13..cb81fc5ea95b89606e12b54f3236beca6040a046 100644 --- a/netbox/client/ipam/ip_amip_addresses_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amip_addresses_delete_responses.go b/netbox/client/ipam/ip_a_m_ip_addresses_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amip_addresses_delete_responses.go rename to netbox/client/ipam/ip_a_m_ip_addresses_delete_responses.go diff --git a/netbox/client/ipam/ip_amip_addresses_list_parameters.go b/netbox/client/ipam/ip_a_m_ip_addresses_list_parameters.go similarity index 79% rename from netbox/client/ipam/ip_amip_addresses_list_parameters.go rename to netbox/client/ipam/ip_a_m_ip_addresses_list_parameters.go index 2a03ebd91bc1f238e213627920e3b6543d99e743..06b9cf2a6227fc2384084cabd4cfa41733473576 100644 --- a/netbox/client/ipam/ip_amip_addresses_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,10 +76,14 @@ for the ipam ip addresses list operation typically these are written to a http.R */ type IPAMIPAddressesListParams struct { + /*Address*/ + Address *string /*Device*/ Device *string /*DeviceID*/ DeviceID *float64 + /*DNSName*/ + DNSName *string /*Family*/ Family *string /*IDIn @@ -88,6 +91,8 @@ type IPAMIPAddressesListParams struct { */ IDIn *string + /*Interface*/ + Interface *string /*InterfaceID*/ InterfaceID *string /*Limit @@ -110,8 +115,14 @@ type IPAMIPAddressesListParams struct { Role *string /*Status*/ Status *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string /*VirtualMachine*/ @@ -161,6 +172,17 @@ func (o *IPAMIPAddressesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithAddress adds the address to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithAddress(address *string) *IPAMIPAddressesListParams { + o.SetAddress(address) + return o +} + +// SetAddress adds the address to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetAddress(address *string) { + o.Address = address +} + // WithDevice adds the device to the ipam ip addresses list params func (o *IPAMIPAddressesListParams) WithDevice(device *string) *IPAMIPAddressesListParams { o.SetDevice(device) @@ -183,6 +205,17 @@ func (o *IPAMIPAddressesListParams) SetDeviceID(deviceID *float64) { o.DeviceID = deviceID } +// WithDNSName adds the dNSName to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithDNSName(dNSName *string) *IPAMIPAddressesListParams { + o.SetDNSName(dNSName) + return o +} + +// SetDNSName adds the dnsName to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetDNSName(dNSName *string) { + o.DNSName = dNSName +} + // WithFamily adds the family to the ipam ip addresses list params func (o *IPAMIPAddressesListParams) WithFamily(family *string) *IPAMIPAddressesListParams { o.SetFamily(family) @@ -205,6 +238,17 @@ func (o *IPAMIPAddressesListParams) SetIDIn(iDIn *string) { o.IDIn = iDIn } +// WithInterface adds the interfaceVar to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithInterface(interfaceVar *string) *IPAMIPAddressesListParams { + o.SetInterface(interfaceVar) + return o +} + +// SetInterface adds the interface to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetInterface(interfaceVar *string) { + o.Interface = interfaceVar +} + // WithInterfaceID adds the interfaceID to the ipam ip addresses list params func (o *IPAMIPAddressesListParams) WithInterfaceID(interfaceID *string) *IPAMIPAddressesListParams { o.SetInterfaceID(interfaceID) @@ -293,6 +337,17 @@ func (o *IPAMIPAddressesListParams) SetStatus(status *string) { o.Status = status } +// WithTag adds the tag to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTag(tag *string) *IPAMIPAddressesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the ipam ip addresses list params func (o *IPAMIPAddressesListParams) WithTenant(tenant *string) *IPAMIPAddressesListParams { o.SetTenant(tenant) @@ -304,6 +359,28 @@ func (o *IPAMIPAddressesListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTenantGroup(tenantGroup *string) *IPAMIPAddressesListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTenantGroupID(tenantGroupID *string) *IPAMIPAddressesListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the ipam ip addresses list params func (o *IPAMIPAddressesListParams) WithTenantID(tenantID *string) *IPAMIPAddressesListParams { o.SetTenantID(tenantID) @@ -367,6 +444,22 @@ func (o *IPAMIPAddressesListParams) WriteToRequest(r runtime.ClientRequest, reg } var res []error + if o.Address != nil { + + // query param address + var qrAddress string + if o.Address != nil { + qrAddress = *o.Address + } + qAddress := qrAddress + if qAddress != "" { + if err := r.SetQueryParam("address", qAddress); err != nil { + return err + } + } + + } + if o.Device != nil { // query param device @@ -399,6 +492,22 @@ func (o *IPAMIPAddressesListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.DNSName != nil { + + // query param dns_name + var qrDNSName string + if o.DNSName != nil { + qrDNSName = *o.DNSName + } + qDNSName := qrDNSName + if qDNSName != "" { + if err := r.SetQueryParam("dns_name", qDNSName); err != nil { + return err + } + } + + } + if o.Family != nil { // query param family @@ -431,6 +540,22 @@ func (o *IPAMIPAddressesListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.Interface != nil { + + // query param interface + var qrInterface string + if o.Interface != nil { + qrInterface = *o.Interface + } + qInterface := qrInterface + if qInterface != "" { + if err := r.SetQueryParam("interface", qInterface); err != nil { + return err + } + } + + } + if o.InterfaceID != nil { // query param interface_id @@ -559,6 +684,22 @@ func (o *IPAMIPAddressesListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -575,6 +716,38 @@ func (o *IPAMIPAddressesListParams) WriteToRequest(r runtime.ClientRequest, reg } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id diff --git a/netbox/client/ipam/ip_a_m_ip_addresses_list_responses.go b/netbox/client/ipam/ip_a_m_ip_addresses_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4c9d55c3424a6667247e2cde71d8b0b60962fd17 --- /dev/null +++ b/netbox/client/ipam/ip_a_m_ip_addresses_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMIPAddressesListReader is a Reader for the IPAMIPAddressesList structure. +type IPAMIPAddressesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMIPAddressesListOK creates a IPAMIPAddressesListOK with default headers values +func NewIPAMIPAddressesListOK() *IPAMIPAddressesListOK { + return &IPAMIPAddressesListOK{} +} + +/*IPAMIPAddressesListOK handles this case with default header values. + +IPAMIPAddressesListOK ipam Ip addresses list o k +*/ +type IPAMIPAddressesListOK struct { + Payload *IPAMIPAddressesListOKBody +} + +func (o *IPAMIPAddressesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/ip-addresses/][%d] ipamIpAddressesListOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMIPAddressesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMIPAddressesListOKBody IP a m IP addresses list o k body +swagger:model IPAMIPAddressesListOKBody +*/ +type IPAMIPAddressesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.IPAddress `json:"results"` +} + +// Validate validates this IP a m IP addresses list o k body +func (o *IPAMIPAddressesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMIPAddressesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamIpAddressesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMIPAddressesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamIpAddressesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMIPAddressesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamIpAddressesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMIPAddressesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamIpAddressesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamIpAddressesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMIPAddressesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMIPAddressesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMIPAddressesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amip_addresses_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_ip_addresses_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amip_addresses_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_ip_addresses_partial_update_parameters.go index eb480f900ac21c355097057d20deb7cbcdd30bc3..5383a53650f5de6cf3738bb4ebeab12717941b1f 100644 --- a/netbox/client/ipam/ip_amip_addresses_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMIPAddressesPartialUpdateParams creates a new IPAMIPAddressesPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amip_addresses_partial_update_responses.go b/netbox/client/ipam/ip_a_m_ip_addresses_partial_update_responses.go similarity index 95% rename from netbox/client/ipam/ip_amip_addresses_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_ip_addresses_partial_update_responses.go index 59770b270a93afe25c79b5c6a333ef44fb4a333a..164280f327b1df1c227a7d73cb0c0c24e2cad7fd 100644 --- a/netbox/client/ipam/ip_amip_addresses_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMIPAddressesPartialUpdateReader is a Reader for the IPAMIPAddressesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMIPAddressesPartialUpdateOK() *IPAMIPAddressesPartialUpdateOK { IPAMIPAddressesPartialUpdateOK ipam Ip addresses partial update o k */ type IPAMIPAddressesPartialUpdateOK struct { - Payload *models.WritableIPAddress + Payload *models.IPAddress } func (o *IPAMIPAddressesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMIPAddressesPartialUpdateOK) Error() string { func (o *IPAMIPAddressesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableIPAddress) + o.Payload = new(models.IPAddress) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amip_addresses_read_parameters.go b/netbox/client/ipam/ip_a_m_ip_addresses_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amip_addresses_read_parameters.go rename to netbox/client/ipam/ip_a_m_ip_addresses_read_parameters.go index b326478978744086e26aaf8eb10acc35a5d0f2c2..62374c2177d9c0a022f1659b5251356e4e1b4387 100644 --- a/netbox/client/ipam/ip_amip_addresses_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amip_addresses_read_responses.go b/netbox/client/ipam/ip_a_m_ip_addresses_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amip_addresses_read_responses.go rename to netbox/client/ipam/ip_a_m_ip_addresses_read_responses.go index b9b8d10bca8b940f6e3ae1ad7354c65a0ad01de9..74f743facd25364604f1a0a02afed0f4176e5498 100644 --- a/netbox/client/ipam/ip_amip_addresses_read_responses.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMIPAddressesReadReader is a Reader for the IPAMIPAddressesRead structure. diff --git a/netbox/client/ipam/ip_amip_addresses_update_parameters.go b/netbox/client/ipam/ip_a_m_ip_addresses_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amip_addresses_update_parameters.go rename to netbox/client/ipam/ip_a_m_ip_addresses_update_parameters.go index 54b097ec714785e382b5c146b26f759940356f15..d549c63c31396aa6d4f1e993da9d881f066f36d0 100644 --- a/netbox/client/ipam/ip_amip_addresses_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMIPAddressesUpdateParams creates a new IPAMIPAddressesUpdateParams object diff --git a/netbox/client/ipam/ip_amip_addresses_update_responses.go b/netbox/client/ipam/ip_a_m_ip_addresses_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amip_addresses_update_responses.go rename to netbox/client/ipam/ip_a_m_ip_addresses_update_responses.go index c9e917bd294465de33e25a0f84f77e7328fcffba..7beaf0d16b9102f93b2eb8f786f3f6ca55f338bc 100644 --- a/netbox/client/ipam/ip_amip_addresses_update_responses.go +++ b/netbox/client/ipam/ip_a_m_ip_addresses_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMIPAddressesUpdateReader is a Reader for the IPAMIPAddressesUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMIPAddressesUpdateOK() *IPAMIPAddressesUpdateOK { IPAMIPAddressesUpdateOK ipam Ip addresses update o k */ type IPAMIPAddressesUpdateOK struct { - Payload *models.WritableIPAddress + Payload *models.IPAddress } func (o *IPAMIPAddressesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMIPAddressesUpdateOK) Error() string { func (o *IPAMIPAddressesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableIPAddress) + o.Payload = new(models.IPAddress) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amprefixes_available_ips_create_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_available_ips_create_parameters.go similarity index 96% rename from netbox/client/ipam/ip_amprefixes_available_ips_create_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_available_ips_create_parameters.go index b16acd438f31269b414362697af72d8ef64f3691..eed086cb76696ac011f52c933ed19f144bfba32a 100644 --- a/netbox/client/ipam/ip_amprefixes_available_ips_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_available_ips_create_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMPrefixesAvailableIpsCreateParams creates a new IPAMPrefixesAvailableIpsCreateParams object @@ -80,7 +79,7 @@ for the ipam prefixes available ips create operation typically these are written type IPAMPrefixesAvailableIpsCreateParams struct { /*Data*/ - Data *models.Prefix + Data *models.WritablePrefix /*ID A unique integer value identifying this prefix. @@ -126,13 +125,13 @@ func (o *IPAMPrefixesAvailableIpsCreateParams) SetHTTPClient(client *http.Client } // WithData adds the data to the ipam prefixes available ips create params -func (o *IPAMPrefixesAvailableIpsCreateParams) WithData(data *models.Prefix) *IPAMPrefixesAvailableIpsCreateParams { +func (o *IPAMPrefixesAvailableIpsCreateParams) WithData(data *models.WritablePrefix) *IPAMPrefixesAvailableIpsCreateParams { o.SetData(data) return o } // SetData adds the data to the ipam prefixes available ips create params -func (o *IPAMPrefixesAvailableIpsCreateParams) SetData(data *models.Prefix) { +func (o *IPAMPrefixesAvailableIpsCreateParams) SetData(data *models.WritablePrefix) { o.Data = data } diff --git a/netbox/client/ipam/ip_amprefixes_available_ips_create_responses.go b/netbox/client/ipam/ip_a_m_prefixes_available_ips_create_responses.go similarity index 97% rename from netbox/client/ipam/ip_amprefixes_available_ips_create_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_available_ips_create_responses.go index 088dc493634857a6cdd13a2f1bdfecc891584650..5d7351f0377bad8afef985099cfb447377ddbcd5 100644 --- a/netbox/client/ipam/ip_amprefixes_available_ips_create_responses.go +++ b/netbox/client/ipam/ip_a_m_prefixes_available_ips_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMPrefixesAvailableIpsCreateReader is a Reader for the IPAMPrefixesAvailableIpsCreate structure. diff --git a/netbox/client/ipam/ip_amprefixes_available_ips_read_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_available_ips_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amprefixes_available_ips_read_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_available_ips_read_parameters.go index 95da2ec6361d1efc38c9bfd6c75adbe0436e3324..dddcfad0c75bba767687a76539bfa92313e9c9dd 100644 --- a/netbox/client/ipam/ip_amprefixes_available_ips_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_available_ips_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amprefixes_available_ips_read_responses.go b/netbox/client/ipam/ip_a_m_prefixes_available_ips_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amprefixes_available_ips_read_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_available_ips_read_responses.go index c358354e6de088233344b519cfcf464c7cba89ad..e1796b2fc1e189771ee23f2730d647c758f2f16f 100644 --- a/netbox/client/ipam/ip_amprefixes_available_ips_read_responses.go +++ b/netbox/client/ipam/ip_a_m_prefixes_available_ips_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMPrefixesAvailableIpsReadReader is a Reader for the IPAMPrefixesAvailableIpsRead structure. diff --git a/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_available_prefixes_create_parameters.go similarity index 96% rename from netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_available_prefixes_create_parameters.go index 7864c077b9e70a775f5af40fa1882c434d6cbcf4..8d565fbd333f30e34bc342b1da8de154ab6cc583 100644 --- a/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_available_prefixes_create_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMPrefixesAvailablePrefixesCreateParams creates a new IPAMPrefixesAvailablePrefixesCreateParams object @@ -80,7 +79,7 @@ for the ipam prefixes available prefixes create operation typically these are wr type IPAMPrefixesAvailablePrefixesCreateParams struct { /*Data*/ - Data *models.Prefix + Data *models.WritablePrefix /*ID A unique integer value identifying this prefix. @@ -126,13 +125,13 @@ func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetHTTPClient(client *http.C } // WithData adds the data to the ipam prefixes available prefixes create params -func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithData(data *models.Prefix) *IPAMPrefixesAvailablePrefixesCreateParams { +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithData(data *models.WritablePrefix) *IPAMPrefixesAvailablePrefixesCreateParams { o.SetData(data) return o } // SetData adds the data to the ipam prefixes available prefixes create params -func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetData(data *models.Prefix) { +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetData(data *models.WritablePrefix) { o.Data = data } diff --git a/netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go b/netbox/client/ipam/ip_a_m_prefixes_available_prefixes_create_responses.go similarity index 97% rename from netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_available_prefixes_create_responses.go index c34039f306cecf64fd5c03671a452ee18073e800..a257922fa45bcfcc21fe913d96ebcb5c09ed7594 100644 --- a/netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go +++ b/netbox/client/ipam/ip_a_m_prefixes_available_prefixes_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMPrefixesAvailablePrefixesCreateReader is a Reader for the IPAMPrefixesAvailablePrefixesCreate structure. diff --git a/netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_available_prefixes_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_available_prefixes_read_parameters.go index ffe2c3ccc46d6efc802c4733f1e0c9c6ec56b87b..80249eb30cc643400b4c1deebd3014925f68a9d8 100644 --- a/netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_available_prefixes_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go b/netbox/client/ipam/ip_a_m_prefixes_available_prefixes_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_available_prefixes_read_responses.go index 4ae9449d72db2e096a1519a5382a8536f115cbf0..3631f4ed8c0c559922d310d0e89114751b781249 100644 --- a/netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go +++ b/netbox/client/ipam/ip_a_m_prefixes_available_prefixes_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMPrefixesAvailablePrefixesReadReader is a Reader for the IPAMPrefixesAvailablePrefixesRead structure. diff --git a/netbox/client/ipam/ip_amprefixes_create_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amprefixes_create_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_create_parameters.go index 8eb3712d1ce6b89f3f591dd5b14ec3cef7f16e3c..410794e6d69ca5b8abb5ac050417f84a41f105ec 100644 --- a/netbox/client/ipam/ip_amprefixes_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMPrefixesCreateParams creates a new IPAMPrefixesCreateParams object diff --git a/netbox/client/ipam/ip_amprefixes_create_responses.go b/netbox/client/ipam/ip_a_m_prefixes_create_responses.go similarity index 95% rename from netbox/client/ipam/ip_amprefixes_create_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_create_responses.go index 744b7d2a6212d8dc45ee0ec467aa4ec29ebe64f2..8fa6e33c70dd85ac47acfd64df517681e9fe2a1c 100644 --- a/netbox/client/ipam/ip_amprefixes_create_responses.go +++ b/netbox/client/ipam/ip_a_m_prefixes_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMPrefixesCreateReader is a Reader for the IPAMPrefixesCreate structure. @@ -61,7 +61,7 @@ func NewIPAMPrefixesCreateCreated() *IPAMPrefixesCreateCreated { IPAMPrefixesCreateCreated ipam prefixes create created */ type IPAMPrefixesCreateCreated struct { - Payload *models.WritablePrefix + Payload *models.Prefix } func (o *IPAMPrefixesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMPrefixesCreateCreated) Error() string { func (o *IPAMPrefixesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePrefix) + o.Payload = new(models.Prefix) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amprefixes_delete_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amprefixes_delete_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_delete_parameters.go index f3ca330168bb4008113430e859c5e9fe28b76876..74e0bc7ed7028c607ec5629da829da7a437c41b1 100644 --- a/netbox/client/ipam/ip_amprefixes_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amprefixes_delete_responses.go b/netbox/client/ipam/ip_a_m_prefixes_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amprefixes_delete_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_delete_responses.go diff --git a/netbox/client/ipam/ip_amprefixes_list_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_list_parameters.go similarity index 86% rename from netbox/client/ipam/ip_amprefixes_list_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_list_parameters.go index 2223c81c95d745212b9b5a2558d42ee9f9e87b13..d217cef8abb03ef6e3c3f7940ed81574ce876b68 100644 --- a/netbox/client/ipam/ip_amprefixes_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -100,6 +99,8 @@ type IPAMPrefixesListParams struct { */ Offset *int64 + /*Prefix*/ + Prefix *string /*Q*/ Q *string /*Role*/ @@ -112,8 +113,14 @@ type IPAMPrefixesListParams struct { SiteID *string /*Status*/ Status *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string /*VlanID*/ @@ -244,6 +251,17 @@ func (o *IPAMPrefixesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithPrefix adds the prefix to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithPrefix(prefix *string) *IPAMPrefixesListParams { + o.SetPrefix(prefix) + return o +} + +// SetPrefix adds the prefix to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetPrefix(prefix *string) { + o.Prefix = prefix +} + // WithQ adds the q to the ipam prefixes list params func (o *IPAMPrefixesListParams) WithQ(q *string) *IPAMPrefixesListParams { o.SetQ(q) @@ -310,6 +328,17 @@ func (o *IPAMPrefixesListParams) SetStatus(status *string) { o.Status = status } +// WithTag adds the tag to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTag(tag *string) *IPAMPrefixesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the ipam prefixes list params func (o *IPAMPrefixesListParams) WithTenant(tenant *string) *IPAMPrefixesListParams { o.SetTenant(tenant) @@ -321,6 +350,28 @@ func (o *IPAMPrefixesListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTenantGroup(tenantGroup *string) *IPAMPrefixesListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTenantGroupID(tenantGroupID *string) *IPAMPrefixesListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the ipam prefixes list params func (o *IPAMPrefixesListParams) WithTenantID(tenantID *string) *IPAMPrefixesListParams { o.SetTenantID(tenantID) @@ -518,6 +569,22 @@ func (o *IPAMPrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg str } + if o.Prefix != nil { + + // query param prefix + var qrPrefix string + if o.Prefix != nil { + qrPrefix = *o.Prefix + } + qPrefix := qrPrefix + if qPrefix != "" { + if err := r.SetQueryParam("prefix", qPrefix); err != nil { + return err + } + } + + } + if o.Q != nil { // query param q @@ -614,6 +681,22 @@ func (o *IPAMPrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg str } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -630,6 +713,38 @@ func (o *IPAMPrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg str } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id diff --git a/netbox/client/ipam/ip_a_m_prefixes_list_responses.go b/netbox/client/ipam/ip_a_m_prefixes_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2df5396f923d45b40920174bed124268463b42c6 --- /dev/null +++ b/netbox/client/ipam/ip_a_m_prefixes_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMPrefixesListReader is a Reader for the IPAMPrefixesList structure. +type IPAMPrefixesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesListOK creates a IPAMPrefixesListOK with default headers values +func NewIPAMPrefixesListOK() *IPAMPrefixesListOK { + return &IPAMPrefixesListOK{} +} + +/*IPAMPrefixesListOK handles this case with default header values. + +IPAMPrefixesListOK ipam prefixes list o k +*/ +type IPAMPrefixesListOK struct { + Payload *IPAMPrefixesListOKBody +} + +func (o *IPAMPrefixesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/][%d] ipamPrefixesListOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMPrefixesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMPrefixesListOKBody IP a m prefixes list o k body +swagger:model IPAMPrefixesListOKBody +*/ +type IPAMPrefixesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Prefix `json:"results"` +} + +// Validate validates this IP a m prefixes list o k body +func (o *IPAMPrefixesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMPrefixesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamPrefixesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMPrefixesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamPrefixesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMPrefixesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamPrefixesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMPrefixesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamPrefixesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamPrefixesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMPrefixesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMPrefixesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMPrefixesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amprefixes_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amprefixes_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_partial_update_parameters.go index d48c984a53e55493fff77d4670a4ac7845cb222b..d880286b932349b65404386e49732de84f92b7a9 100644 --- a/netbox/client/ipam/ip_amprefixes_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMPrefixesPartialUpdateParams creates a new IPAMPrefixesPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amprefixes_partial_update_responses.go b/netbox/client/ipam/ip_a_m_prefixes_partial_update_responses.go similarity index 95% rename from netbox/client/ipam/ip_amprefixes_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_partial_update_responses.go index 96e1838654b82a8ab104dbaac18e4b3ad4db9ffc..fde2598e3c81b4ac05fc32feb1917abbe6d430ee 100644 --- a/netbox/client/ipam/ip_amprefixes_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_prefixes_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMPrefixesPartialUpdateReader is a Reader for the IPAMPrefixesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMPrefixesPartialUpdateOK() *IPAMPrefixesPartialUpdateOK { IPAMPrefixesPartialUpdateOK ipam prefixes partial update o k */ type IPAMPrefixesPartialUpdateOK struct { - Payload *models.WritablePrefix + Payload *models.Prefix } func (o *IPAMPrefixesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMPrefixesPartialUpdateOK) Error() string { func (o *IPAMPrefixesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePrefix) + o.Payload = new(models.Prefix) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amprefixes_read_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amprefixes_read_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_read_parameters.go index 7ec788cf49c5e2ef327dce6bd42e839527bc876f..39945c5225b748f2b31f47f034950a0195e26217 100644 --- a/netbox/client/ipam/ip_amprefixes_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amprefixes_read_responses.go b/netbox/client/ipam/ip_a_m_prefixes_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amprefixes_read_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_read_responses.go index b86b914f44d8cc28019e2351cee439daf5233d5a..ef1a0362899b2e250b4abe632c140b0414554bcc 100644 --- a/netbox/client/ipam/ip_amprefixes_read_responses.go +++ b/netbox/client/ipam/ip_a_m_prefixes_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMPrefixesReadReader is a Reader for the IPAMPrefixesRead structure. diff --git a/netbox/client/ipam/ip_amprefixes_update_parameters.go b/netbox/client/ipam/ip_a_m_prefixes_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amprefixes_update_parameters.go rename to netbox/client/ipam/ip_a_m_prefixes_update_parameters.go index 8d448886a300435da195a680e2662fc9ab9e543c..6e9035aaa8ebd87634801da91194027fe7500861 100644 --- a/netbox/client/ipam/ip_amprefixes_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_prefixes_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMPrefixesUpdateParams creates a new IPAMPrefixesUpdateParams object diff --git a/netbox/client/ipam/ip_amprefixes_update_responses.go b/netbox/client/ipam/ip_a_m_prefixes_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amprefixes_update_responses.go rename to netbox/client/ipam/ip_a_m_prefixes_update_responses.go index d292f5e1be6ce95bf12f0d6609f4b0a3fda4fbe5..4b78f24aa42550bad508736d7291df7da43cd8bc 100644 --- a/netbox/client/ipam/ip_amprefixes_update_responses.go +++ b/netbox/client/ipam/ip_a_m_prefixes_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMPrefixesUpdateReader is a Reader for the IPAMPrefixesUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMPrefixesUpdateOK() *IPAMPrefixesUpdateOK { IPAMPrefixesUpdateOK ipam prefixes update o k */ type IPAMPrefixesUpdateOK struct { - Payload *models.WritablePrefix + Payload *models.Prefix } func (o *IPAMPrefixesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMPrefixesUpdateOK) Error() string { func (o *IPAMPrefixesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritablePrefix) + o.Payload = new(models.Prefix) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amrirs_create_parameters.go b/netbox/client/ipam/ip_a_m_rirs_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amrirs_create_parameters.go rename to netbox/client/ipam/ip_a_m_rirs_create_parameters.go index d0f174759a1814c94efb4b8d76b195f81dfa103c..8f0b4b9db9863e2d27e98b5bd92f064f470071bd 100644 --- a/netbox/client/ipam/ip_amrirs_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_rirs_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMRirsCreateParams creates a new IPAMRirsCreateParams object diff --git a/netbox/client/ipam/ip_amrirs_create_responses.go b/netbox/client/ipam/ip_a_m_rirs_create_responses.go similarity index 97% rename from netbox/client/ipam/ip_amrirs_create_responses.go rename to netbox/client/ipam/ip_a_m_rirs_create_responses.go index 6bc360b967e26d793c5443b4177e7af0042dad07..dae09fcde93efbf7e16448a84a8bcc27855e5fe4 100644 --- a/netbox/client/ipam/ip_amrirs_create_responses.go +++ b/netbox/client/ipam/ip_a_m_rirs_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMRirsCreateReader is a Reader for the IPAMRirsCreate structure. diff --git a/netbox/client/ipam/ip_amrirs_delete_parameters.go b/netbox/client/ipam/ip_a_m_rirs_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amrirs_delete_parameters.go rename to netbox/client/ipam/ip_a_m_rirs_delete_parameters.go index 17f1be45bd92c427401af7b7a233e8e0251d8beb..29b4a75770b8e51b9d4841298f0c8b930f39c7a7 100644 --- a/netbox/client/ipam/ip_amrirs_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_rirs_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amrirs_delete_responses.go b/netbox/client/ipam/ip_a_m_rirs_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amrirs_delete_responses.go rename to netbox/client/ipam/ip_a_m_rirs_delete_responses.go diff --git a/netbox/client/ipam/ip_amrirs_list_parameters.go b/netbox/client/ipam/ip_a_m_rirs_list_parameters.go similarity index 93% rename from netbox/client/ipam/ip_amrirs_list_parameters.go rename to netbox/client/ipam/ip_a_m_rirs_list_parameters.go index 26d18def2683d7fcc684d55d4519954bf6958917..2c84d3dff402e682d6fb3f60bbfee89d32952fe4 100644 --- a/netbox/client/ipam/ip_amrirs_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_rirs_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -96,6 +95,8 @@ type IPAMRirsListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -192,6 +193,17 @@ func (o *IPAMRirsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the ipam rirs list params +func (o *IPAMRirsListParams) WithQ(q *string) *IPAMRirsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam rirs list params +func (o *IPAMRirsListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the ipam rirs list params func (o *IPAMRirsListParams) WithSlug(slug *string) *IPAMRirsListParams { o.SetSlug(slug) @@ -291,6 +303,22 @@ func (o *IPAMRirsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/ipam/ip_a_m_rirs_list_responses.go b/netbox/client/ipam/ip_a_m_rirs_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..372b029b46dad14330a7bd326bbea0a4d5dd9cdb --- /dev/null +++ b/netbox/client/ipam/ip_a_m_rirs_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRirsListReader is a Reader for the IPAMRirsList structure. +type IPAMRirsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRirsListOK creates a IPAMRirsListOK with default headers values +func NewIPAMRirsListOK() *IPAMRirsListOK { + return &IPAMRirsListOK{} +} + +/*IPAMRirsListOK handles this case with default header values. + +IPAMRirsListOK ipam rirs list o k +*/ +type IPAMRirsListOK struct { + Payload *IPAMRirsListOKBody +} + +func (o *IPAMRirsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/rirs/][%d] ipamRirsListOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMRirsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMRirsListOKBody IP a m rirs list o k body +swagger:model IPAMRirsListOKBody +*/ +type IPAMRirsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.RIR `json:"results"` +} + +// Validate validates this IP a m rirs list o k body +func (o *IPAMRirsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMRirsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamRirsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMRirsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamRirsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMRirsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamRirsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMRirsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamRirsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamRirsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMRirsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMRirsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMRirsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amrirs_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_rirs_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amrirs_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_rirs_partial_update_parameters.go index 9f6f306a311eb8690be9169c0154f2b65c725794..9e30ee09132deb917ab59cb59361f45165e8c0b6 100644 --- a/netbox/client/ipam/ip_amrirs_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_rirs_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMRirsPartialUpdateParams creates a new IPAMRirsPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amrirs_partial_update_responses.go b/netbox/client/ipam/ip_a_m_rirs_partial_update_responses.go similarity index 97% rename from netbox/client/ipam/ip_amrirs_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_rirs_partial_update_responses.go index fc3375b57af9f053942cd422688bad1a3ba22454..6f3dedd66c307cacfdc1aab3592c2fb567e9f555 100644 --- a/netbox/client/ipam/ip_amrirs_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_rirs_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMRirsPartialUpdateReader is a Reader for the IPAMRirsPartialUpdate structure. diff --git a/netbox/client/ipam/ip_amrirs_read_parameters.go b/netbox/client/ipam/ip_a_m_rirs_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amrirs_read_parameters.go rename to netbox/client/ipam/ip_a_m_rirs_read_parameters.go index 5a09b46a6adfafbeaf3a50e63f287c0743e5ac5b..ef6fb46659526b6cff41962ec1651f89304d434a 100644 --- a/netbox/client/ipam/ip_amrirs_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_rirs_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amrirs_read_responses.go b/netbox/client/ipam/ip_a_m_rirs_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amrirs_read_responses.go rename to netbox/client/ipam/ip_a_m_rirs_read_responses.go index 8a2865c999e1b40c6d6ac11f91675d3a7f86b265..12a8f801c4178adfa28c435514dcf09d9f90bfc7 100644 --- a/netbox/client/ipam/ip_amrirs_read_responses.go +++ b/netbox/client/ipam/ip_a_m_rirs_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMRirsReadReader is a Reader for the IPAMRirsRead structure. diff --git a/netbox/client/ipam/ip_amrirs_update_parameters.go b/netbox/client/ipam/ip_a_m_rirs_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amrirs_update_parameters.go rename to netbox/client/ipam/ip_a_m_rirs_update_parameters.go index 3f0622f61d3e203a79efd261b57e8c2752223436..3d4aa27c3bbc76236841668dc0b7de42fc732aa4 100644 --- a/netbox/client/ipam/ip_amrirs_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_rirs_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMRirsUpdateParams creates a new IPAMRirsUpdateParams object diff --git a/netbox/client/ipam/ip_amrirs_update_responses.go b/netbox/client/ipam/ip_a_m_rirs_update_responses.go similarity index 97% rename from netbox/client/ipam/ip_amrirs_update_responses.go rename to netbox/client/ipam/ip_a_m_rirs_update_responses.go index 1ca524872ea00494a02b9da1c91a0c0b147254ef..7fbaf4cccd80d99a69025923c287199bb9fa7abb 100644 --- a/netbox/client/ipam/ip_amrirs_update_responses.go +++ b/netbox/client/ipam/ip_a_m_rirs_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMRirsUpdateReader is a Reader for the IPAMRirsUpdate structure. diff --git a/netbox/client/ipam/ip_amroles_create_parameters.go b/netbox/client/ipam/ip_a_m_roles_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amroles_create_parameters.go rename to netbox/client/ipam/ip_a_m_roles_create_parameters.go index a5fd44319e673f37967abf536a194e8b3459f77f..eac25987a84f9bbcb83b8fee3fe56f4e13eec7a3 100644 --- a/netbox/client/ipam/ip_amroles_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_roles_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMRolesCreateParams creates a new IPAMRolesCreateParams object diff --git a/netbox/client/ipam/ip_amroles_create_responses.go b/netbox/client/ipam/ip_a_m_roles_create_responses.go similarity index 97% rename from netbox/client/ipam/ip_amroles_create_responses.go rename to netbox/client/ipam/ip_a_m_roles_create_responses.go index 05fe3d7ecb143f675e3df685297065d947f3867e..b148be702951aab907d7d49ce3d661c1d4b2b9bd 100644 --- a/netbox/client/ipam/ip_amroles_create_responses.go +++ b/netbox/client/ipam/ip_a_m_roles_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMRolesCreateReader is a Reader for the IPAMRolesCreate structure. diff --git a/netbox/client/ipam/ip_amroles_delete_parameters.go b/netbox/client/ipam/ip_a_m_roles_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amroles_delete_parameters.go rename to netbox/client/ipam/ip_a_m_roles_delete_parameters.go index 98f1227ff0b77a06fafcdb93ef121cc14d951023..58914e5ef71db99a06d340d3abdc55dad016de64 100644 --- a/netbox/client/ipam/ip_amroles_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_roles_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amroles_delete_responses.go b/netbox/client/ipam/ip_a_m_roles_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amroles_delete_responses.go rename to netbox/client/ipam/ip_a_m_roles_delete_responses.go diff --git a/netbox/client/ipam/ip_amroles_list_parameters.go b/netbox/client/ipam/ip_a_m_roles_list_parameters.go similarity index 86% rename from netbox/client/ipam/ip_amroles_list_parameters.go rename to netbox/client/ipam/ip_a_m_roles_list_parameters.go index fb3f80168bf0d0e2bfb64b0184171bde8420bfc5..a81b9195094f0051f3283277a00ab84fddccd10a 100644 --- a/netbox/client/ipam/ip_amroles_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_roles_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the ipam roles list operation typically these are written to a http.Request */ type IPAMRolesListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type IPAMRolesListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -130,6 +133,17 @@ func (o *IPAMRolesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the ipam roles list params +func (o *IPAMRolesListParams) WithID(id *string) *IPAMRolesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles list params +func (o *IPAMRolesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the ipam roles list params func (o *IPAMRolesListParams) WithLimit(limit *int64) *IPAMRolesListParams { o.SetLimit(limit) @@ -163,6 +177,17 @@ func (o *IPAMRolesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the ipam roles list params +func (o *IPAMRolesListParams) WithQ(q *string) *IPAMRolesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam roles list params +func (o *IPAMRolesListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the ipam roles list params func (o *IPAMRolesListParams) WithSlug(slug *string) *IPAMRolesListParams { o.SetSlug(slug) @@ -182,6 +207,22 @@ func (o *IPAMRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -230,6 +271,22 @@ func (o *IPAMRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/ipam/ip_a_m_roles_list_responses.go b/netbox/client/ipam/ip_a_m_roles_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ea06743d40e8b1b3d6b2950a8bdadba951416764 --- /dev/null +++ b/netbox/client/ipam/ip_a_m_roles_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMRolesListReader is a Reader for the IPAMRolesList structure. +type IPAMRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRolesListOK creates a IPAMRolesListOK with default headers values +func NewIPAMRolesListOK() *IPAMRolesListOK { + return &IPAMRolesListOK{} +} + +/*IPAMRolesListOK handles this case with default header values. + +IPAMRolesListOK ipam roles list o k +*/ +type IPAMRolesListOK struct { + Payload *IPAMRolesListOKBody +} + +func (o *IPAMRolesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/roles/][%d] ipamRolesListOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMRolesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMRolesListOKBody IP a m roles list o k body +swagger:model IPAMRolesListOKBody +*/ +type IPAMRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Role `json:"results"` +} + +// Validate validates this IP a m roles list o k body +func (o *IPAMRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamRolesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMRolesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamRolesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMRolesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamRolesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamRolesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamRolesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMRolesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMRolesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amroles_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_roles_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amroles_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_roles_partial_update_parameters.go index 192bcb01c46b23d69c81cc097789242f3a403d72..a7111d532157fd92398430111c1cb3bef68b5d2e 100644 --- a/netbox/client/ipam/ip_amroles_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_roles_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMRolesPartialUpdateParams creates a new IPAMRolesPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amroles_partial_update_responses.go b/netbox/client/ipam/ip_a_m_roles_partial_update_responses.go similarity index 97% rename from netbox/client/ipam/ip_amroles_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_roles_partial_update_responses.go index f2dd6ad0bb69a70a1d096968beea34502262068f..9c56fb92d2cb96074434853202c41eaa6b12a433 100644 --- a/netbox/client/ipam/ip_amroles_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_roles_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMRolesPartialUpdateReader is a Reader for the IPAMRolesPartialUpdate structure. diff --git a/netbox/client/ipam/ip_amroles_read_parameters.go b/netbox/client/ipam/ip_a_m_roles_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amroles_read_parameters.go rename to netbox/client/ipam/ip_a_m_roles_read_parameters.go index 0543e0f7acfe958ba106edbcbc2a97f50c6260fb..c0e786e47674f554ea92fb8cdcc76dceebcc02e8 100644 --- a/netbox/client/ipam/ip_amroles_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_roles_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amroles_read_responses.go b/netbox/client/ipam/ip_a_m_roles_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amroles_read_responses.go rename to netbox/client/ipam/ip_a_m_roles_read_responses.go index 055923d7ddb8bac869054429cc9d79034ff51159..0adfdc1ad7d3edd6c3062a938ff1bafeeaf82ad4 100644 --- a/netbox/client/ipam/ip_amroles_read_responses.go +++ b/netbox/client/ipam/ip_a_m_roles_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMRolesReadReader is a Reader for the IPAMRolesRead structure. diff --git a/netbox/client/ipam/ip_amroles_update_parameters.go b/netbox/client/ipam/ip_a_m_roles_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amroles_update_parameters.go rename to netbox/client/ipam/ip_a_m_roles_update_parameters.go index 86cd84e0a5c3057041e7c1e9cac730fadfe272b7..d8b49a025ef9e836d99d19847d56adaab5d65ab7 100644 --- a/netbox/client/ipam/ip_amroles_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_roles_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMRolesUpdateParams creates a new IPAMRolesUpdateParams object diff --git a/netbox/client/ipam/ip_amroles_update_responses.go b/netbox/client/ipam/ip_a_m_roles_update_responses.go similarity index 97% rename from netbox/client/ipam/ip_amroles_update_responses.go rename to netbox/client/ipam/ip_a_m_roles_update_responses.go index d57107b33bd7bf8c7c46134b0facf443e9d6bbff..aead09c97be91e2109218a142b4df935828fd236 100644 --- a/netbox/client/ipam/ip_amroles_update_responses.go +++ b/netbox/client/ipam/ip_a_m_roles_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMRolesUpdateReader is a Reader for the IPAMRolesUpdate structure. diff --git a/netbox/client/ipam/ip_amservices_create_parameters.go b/netbox/client/ipam/ip_a_m_services_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amservices_create_parameters.go rename to netbox/client/ipam/ip_a_m_services_create_parameters.go index 7b16d4211c086fb4644abd7eabb5f00134d46745..fecfe7938ab6dfb98ee4dd9b61fd763ace8ff978 100644 --- a/netbox/client/ipam/ip_amservices_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_services_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMServicesCreateParams creates a new IPAMServicesCreateParams object diff --git a/netbox/client/ipam/ip_amservices_create_responses.go b/netbox/client/ipam/ip_a_m_services_create_responses.go similarity index 94% rename from netbox/client/ipam/ip_amservices_create_responses.go rename to netbox/client/ipam/ip_a_m_services_create_responses.go index 488a672421b130d61a4226f99ca056ea60c17f7c..ef6898002ee2be0f883cec81a47bf52a6d077696 100644 --- a/netbox/client/ipam/ip_amservices_create_responses.go +++ b/netbox/client/ipam/ip_a_m_services_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMServicesCreateReader is a Reader for the IPAMServicesCreate structure. @@ -61,7 +61,7 @@ func NewIPAMServicesCreateCreated() *IPAMServicesCreateCreated { IPAMServicesCreateCreated ipam services create created */ type IPAMServicesCreateCreated struct { - Payload *models.WritableService + Payload *models.Service } func (o *IPAMServicesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMServicesCreateCreated) Error() string { func (o *IPAMServicesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableService) + o.Payload = new(models.Service) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amservices_delete_parameters.go b/netbox/client/ipam/ip_a_m_services_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amservices_delete_parameters.go rename to netbox/client/ipam/ip_a_m_services_delete_parameters.go index f11b0bfa9cb68cf94fef37baa2f0f79474357bef..661398c6280461c4a92b674021dc8fe214160f2f 100644 --- a/netbox/client/ipam/ip_amservices_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_services_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amservices_delete_responses.go b/netbox/client/ipam/ip_a_m_services_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amservices_delete_responses.go rename to netbox/client/ipam/ip_a_m_services_delete_responses.go diff --git a/netbox/client/ipam/ip_amservices_list_parameters.go b/netbox/client/ipam/ip_a_m_services_list_parameters.go similarity index 84% rename from netbox/client/ipam/ip_amservices_list_parameters.go rename to netbox/client/ipam/ip_a_m_services_list_parameters.go index c8544626fc7f5158a68194092bc9ec2f02dcdf0c..8eefa094eb36651de89c61d8674b27dea26dcb76 100644 --- a/netbox/client/ipam/ip_amservices_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_services_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -81,6 +80,8 @@ type IPAMServicesListParams struct { Device *string /*DeviceID*/ DeviceID *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -94,9 +95,13 @@ type IPAMServicesListParams struct { */ Offset *int64 /*Port*/ - Port *float64 + Port *string /*Protocol*/ Protocol *string + /*Q*/ + Q *string + /*Tag*/ + Tag *string /*VirtualMachine*/ VirtualMachine *string /*VirtualMachineID*/ @@ -162,6 +167,17 @@ func (o *IPAMServicesListParams) SetDeviceID(deviceID *string) { o.DeviceID = deviceID } +// WithID adds the id to the ipam services list params +func (o *IPAMServicesListParams) WithID(id *string) *IPAMServicesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services list params +func (o *IPAMServicesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the ipam services list params func (o *IPAMServicesListParams) WithLimit(limit *int64) *IPAMServicesListParams { o.SetLimit(limit) @@ -196,13 +212,13 @@ func (o *IPAMServicesListParams) SetOffset(offset *int64) { } // WithPort adds the port to the ipam services list params -func (o *IPAMServicesListParams) WithPort(port *float64) *IPAMServicesListParams { +func (o *IPAMServicesListParams) WithPort(port *string) *IPAMServicesListParams { o.SetPort(port) return o } // SetPort adds the port to the ipam services list params -func (o *IPAMServicesListParams) SetPort(port *float64) { +func (o *IPAMServicesListParams) SetPort(port *string) { o.Port = port } @@ -217,6 +233,28 @@ func (o *IPAMServicesListParams) SetProtocol(protocol *string) { o.Protocol = protocol } +// WithQ adds the q to the ipam services list params +func (o *IPAMServicesListParams) WithQ(q *string) *IPAMServicesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam services list params +func (o *IPAMServicesListParams) SetQ(q *string) { + o.Q = q +} + +// WithTag adds the tag to the ipam services list params +func (o *IPAMServicesListParams) WithTag(tag *string) *IPAMServicesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam services list params +func (o *IPAMServicesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithVirtualMachine adds the virtualMachine to the ipam services list params func (o *IPAMServicesListParams) WithVirtualMachine(virtualMachine *string) *IPAMServicesListParams { o.SetVirtualMachine(virtualMachine) @@ -279,6 +317,22 @@ func (o *IPAMServicesListParams) WriteToRequest(r runtime.ClientRequest, reg str } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -330,11 +384,11 @@ func (o *IPAMServicesListParams) WriteToRequest(r runtime.ClientRequest, reg str if o.Port != nil { // query param port - var qrPort float64 + var qrPort string if o.Port != nil { qrPort = *o.Port } - qPort := swag.FormatFloat64(qrPort) + qPort := qrPort if qPort != "" { if err := r.SetQueryParam("port", qPort); err != nil { return err @@ -359,6 +413,38 @@ func (o *IPAMServicesListParams) WriteToRequest(r runtime.ClientRequest, reg str } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.VirtualMachine != nil { // query param virtual_machine diff --git a/netbox/client/ipam/ip_a_m_services_list_responses.go b/netbox/client/ipam/ip_a_m_services_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f3bc4ddd5e19bd552295ca55798364e2f8c4247f --- /dev/null +++ b/netbox/client/ipam/ip_a_m_services_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMServicesListReader is a Reader for the IPAMServicesList structure. +type IPAMServicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMServicesListOK creates a IPAMServicesListOK with default headers values +func NewIPAMServicesListOK() *IPAMServicesListOK { + return &IPAMServicesListOK{} +} + +/*IPAMServicesListOK handles this case with default header values. + +IPAMServicesListOK ipam services list o k +*/ +type IPAMServicesListOK struct { + Payload *IPAMServicesListOKBody +} + +func (o *IPAMServicesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/services/][%d] ipamServicesListOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMServicesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMServicesListOKBody IP a m services list o k body +swagger:model IPAMServicesListOKBody +*/ +type IPAMServicesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Service `json:"results"` +} + +// Validate validates this IP a m services list o k body +func (o *IPAMServicesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMServicesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamServicesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMServicesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamServicesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMServicesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamServicesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMServicesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamServicesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamServicesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMServicesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMServicesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMServicesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amservices_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_services_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amservices_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_services_partial_update_parameters.go index 7363e4efd516f408a259d618e961792d04b9f2ea..358cd2407d0e1cb4590b43d2a47d29a149079d55 100644 --- a/netbox/client/ipam/ip_amservices_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_services_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMServicesPartialUpdateParams creates a new IPAMServicesPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amservices_partial_update_responses.go b/netbox/client/ipam/ip_a_m_services_partial_update_responses.go similarity index 95% rename from netbox/client/ipam/ip_amservices_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_services_partial_update_responses.go index db21bb718014b2e85bd07ac3988775c2cb77e2e5..94da2dee0537b985b24ca73d5572b2970f31cc92 100644 --- a/netbox/client/ipam/ip_amservices_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_services_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMServicesPartialUpdateReader is a Reader for the IPAMServicesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMServicesPartialUpdateOK() *IPAMServicesPartialUpdateOK { IPAMServicesPartialUpdateOK ipam services partial update o k */ type IPAMServicesPartialUpdateOK struct { - Payload *models.WritableService + Payload *models.Service } func (o *IPAMServicesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMServicesPartialUpdateOK) Error() string { func (o *IPAMServicesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableService) + o.Payload = new(models.Service) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amservices_read_parameters.go b/netbox/client/ipam/ip_a_m_services_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amservices_read_parameters.go rename to netbox/client/ipam/ip_a_m_services_read_parameters.go index 6a9dae2a0a4354ce71d1bace39399ce9a8a27d57..67d6e071e3cdd09dfb9100ecd24312ce4923b911 100644 --- a/netbox/client/ipam/ip_amservices_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_services_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amservices_read_responses.go b/netbox/client/ipam/ip_a_m_services_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amservices_read_responses.go rename to netbox/client/ipam/ip_a_m_services_read_responses.go index 01d78a30c9b315d9de346b85aa10c646eea4e3fe..2ec3b657c8c58f41093d545ef690be0228d86c8e 100644 --- a/netbox/client/ipam/ip_amservices_read_responses.go +++ b/netbox/client/ipam/ip_a_m_services_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMServicesReadReader is a Reader for the IPAMServicesRead structure. diff --git a/netbox/client/ipam/ip_amservices_update_parameters.go b/netbox/client/ipam/ip_a_m_services_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amservices_update_parameters.go rename to netbox/client/ipam/ip_a_m_services_update_parameters.go index e423e4fe6a6374199392ce72475ff3b3554bc685..8161e49f2857083210864881de801481ae8bed7b 100644 --- a/netbox/client/ipam/ip_amservices_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_services_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMServicesUpdateParams creates a new IPAMServicesUpdateParams object diff --git a/netbox/client/ipam/ip_amservices_update_responses.go b/netbox/client/ipam/ip_a_m_services_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amservices_update_responses.go rename to netbox/client/ipam/ip_a_m_services_update_responses.go index 3ccf5363254b28edb6c05ec3c202ce7796cd2e39..63a7440c2d7a4287c334528ae8652909c02884d8 100644 --- a/netbox/client/ipam/ip_amservices_update_responses.go +++ b/netbox/client/ipam/ip_a_m_services_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMServicesUpdateReader is a Reader for the IPAMServicesUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMServicesUpdateOK() *IPAMServicesUpdateOK { IPAMServicesUpdateOK ipam services update o k */ type IPAMServicesUpdateOK struct { - Payload *models.WritableService + Payload *models.Service } func (o *IPAMServicesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMServicesUpdateOK) Error() string { func (o *IPAMServicesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableService) + o.Payload = new(models.Service) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvlan_groups_create_parameters.go b/netbox/client/ipam/ip_a_m_vlan_groups_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvlan_groups_create_parameters.go rename to netbox/client/ipam/ip_a_m_vlan_groups_create_parameters.go index 5a9a756c49421e5f304090b42d23c61deead1ab9..700f7947b035d7172a73eaefc4bb76c91d6dd11d 100644 --- a/netbox/client/ipam/ip_amvlan_groups_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVlanGroupsCreateParams creates a new IPAMVlanGroupsCreateParams object diff --git a/netbox/client/ipam/ip_amvlan_groups_create_responses.go b/netbox/client/ipam/ip_a_m_vlan_groups_create_responses.go similarity index 94% rename from netbox/client/ipam/ip_amvlan_groups_create_responses.go rename to netbox/client/ipam/ip_a_m_vlan_groups_create_responses.go index 7bc50977cf82cb99489ddc8bdfce4ec7f3a468b5..7d982490eb3949894b061a784092c507124125f1 100644 --- a/netbox/client/ipam/ip_amvlan_groups_create_responses.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVlanGroupsCreateReader is a Reader for the IPAMVlanGroupsCreate structure. @@ -61,7 +61,7 @@ func NewIPAMVlanGroupsCreateCreated() *IPAMVlanGroupsCreateCreated { IPAMVlanGroupsCreateCreated ipam vlan groups create created */ type IPAMVlanGroupsCreateCreated struct { - Payload *models.WritableVLANGroup + Payload *models.VLANGroup } func (o *IPAMVlanGroupsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVlanGroupsCreateCreated) Error() string { func (o *IPAMVlanGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVLANGroup) + o.Payload = new(models.VLANGroup) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvlan_groups_delete_parameters.go b/netbox/client/ipam/ip_a_m_vlan_groups_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amvlan_groups_delete_parameters.go rename to netbox/client/ipam/ip_a_m_vlan_groups_delete_parameters.go index 46a262a4ec1146642fee5e71ac753675ec57a886..188d90905b0f3fe971ed6b56491dc5e5dacb8764 100644 --- a/netbox/client/ipam/ip_amvlan_groups_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amvlan_groups_delete_responses.go b/netbox/client/ipam/ip_a_m_vlan_groups_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amvlan_groups_delete_responses.go rename to netbox/client/ipam/ip_a_m_vlan_groups_delete_responses.go diff --git a/netbox/client/ipam/ip_amvlan_groups_list_parameters.go b/netbox/client/ipam/ip_a_m_vlan_groups_list_parameters.go similarity index 88% rename from netbox/client/ipam/ip_amvlan_groups_list_parameters.go rename to netbox/client/ipam/ip_a_m_vlan_groups_list_parameters.go index 827349ee9c28d225febbc6c43f14e9ddd9584536..80af4043c43a4f85a90c9a203d1ab10cc644142d 100644 --- a/netbox/client/ipam/ip_amvlan_groups_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the ipam vlan groups list operation typically these are written to a http.Re */ type IPAMVlanGroupsListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type IPAMVlanGroupsListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Site*/ Site *string /*SiteID*/ @@ -134,6 +137,17 @@ func (o *IPAMVlanGroupsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithID(id *string) *IPAMVlanGroupsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the ipam vlan groups list params func (o *IPAMVlanGroupsListParams) WithLimit(limit *int64) *IPAMVlanGroupsListParams { o.SetLimit(limit) @@ -167,6 +181,17 @@ func (o *IPAMVlanGroupsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithQ(q *string) *IPAMVlanGroupsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetQ(q *string) { + o.Q = q +} + // WithSite adds the site to the ipam vlan groups list params func (o *IPAMVlanGroupsListParams) WithSite(site *string) *IPAMVlanGroupsListParams { o.SetSite(site) @@ -208,6 +233,22 @@ func (o *IPAMVlanGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg s } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -256,6 +297,22 @@ func (o *IPAMVlanGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Site != nil { // query param site diff --git a/netbox/client/ipam/ip_a_m_vlan_groups_list_responses.go b/netbox/client/ipam/ip_a_m_vlan_groups_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..407b3197cab64093c098904f22772340a704905a --- /dev/null +++ b/netbox/client/ipam/ip_a_m_vlan_groups_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlanGroupsListReader is a Reader for the IPAMVlanGroupsList structure. +type IPAMVlanGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlanGroupsListOK creates a IPAMVlanGroupsListOK with default headers values +func NewIPAMVlanGroupsListOK() *IPAMVlanGroupsListOK { + return &IPAMVlanGroupsListOK{} +} + +/*IPAMVlanGroupsListOK handles this case with default header values. + +IPAMVlanGroupsListOK ipam vlan groups list o k +*/ +type IPAMVlanGroupsListOK struct { + Payload *IPAMVlanGroupsListOKBody +} + +func (o *IPAMVlanGroupsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlan-groups/][%d] ipamVlanGroupsListOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMVlanGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMVlanGroupsListOKBody IP a m vlan groups list o k body +swagger:model IPAMVlanGroupsListOKBody +*/ +type IPAMVlanGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.VLANGroup `json:"results"` +} + +// Validate validates this IP a m vlan groups list o k body +func (o *IPAMVlanGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMVlanGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamVlanGroupsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMVlanGroupsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamVlanGroupsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMVlanGroupsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamVlanGroupsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMVlanGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamVlanGroupsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamVlanGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMVlanGroupsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMVlanGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVlanGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_vlan_groups_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_vlan_groups_partial_update_parameters.go index 69b3c7b75a1205e1f4a50531e3e6f131db057e40..1df58224819efe588a4248bf5f5b3ae40a42f929 100644 --- a/netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVlanGroupsPartialUpdateParams creates a new IPAMVlanGroupsPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amvlan_groups_partial_update_responses.go b/netbox/client/ipam/ip_a_m_vlan_groups_partial_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amvlan_groups_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_vlan_groups_partial_update_responses.go index 62fb3414f94f918571a4be38453797859dd15476..5a1649a7717c4a588501df3b4d37281915fdf767 100644 --- a/netbox/client/ipam/ip_amvlan_groups_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVlanGroupsPartialUpdateReader is a Reader for the IPAMVlanGroupsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMVlanGroupsPartialUpdateOK() *IPAMVlanGroupsPartialUpdateOK { IPAMVlanGroupsPartialUpdateOK ipam vlan groups partial update o k */ type IPAMVlanGroupsPartialUpdateOK struct { - Payload *models.WritableVLANGroup + Payload *models.VLANGroup } func (o *IPAMVlanGroupsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVlanGroupsPartialUpdateOK) Error() string { func (o *IPAMVlanGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVLANGroup) + o.Payload = new(models.VLANGroup) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvlan_groups_read_parameters.go b/netbox/client/ipam/ip_a_m_vlan_groups_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amvlan_groups_read_parameters.go rename to netbox/client/ipam/ip_a_m_vlan_groups_read_parameters.go index 9872ce4a14a1e7208385ded907a4cf6cc7b05447..078baca768e80582f6e9bee3d0f27f02ca7b3a97 100644 --- a/netbox/client/ipam/ip_amvlan_groups_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amvlan_groups_read_responses.go b/netbox/client/ipam/ip_a_m_vlan_groups_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amvlan_groups_read_responses.go rename to netbox/client/ipam/ip_a_m_vlan_groups_read_responses.go index 08914ce53ef70dda80eb98761552769d1942984b..c67969a23ddca6eac39c9f53750843955332fc25 100644 --- a/netbox/client/ipam/ip_amvlan_groups_read_responses.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVlanGroupsReadReader is a Reader for the IPAMVlanGroupsRead structure. diff --git a/netbox/client/ipam/ip_amvlan_groups_update_parameters.go b/netbox/client/ipam/ip_a_m_vlan_groups_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvlan_groups_update_parameters.go rename to netbox/client/ipam/ip_a_m_vlan_groups_update_parameters.go index fbd5662df4e79031a9da68c17471147ded9e5fbf..c91cd1a31f0fb72d66b8f2d9d633faba2f236838 100644 --- a/netbox/client/ipam/ip_amvlan_groups_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVlanGroupsUpdateParams creates a new IPAMVlanGroupsUpdateParams object diff --git a/netbox/client/ipam/ip_amvlan_groups_update_responses.go b/netbox/client/ipam/ip_a_m_vlan_groups_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amvlan_groups_update_responses.go rename to netbox/client/ipam/ip_a_m_vlan_groups_update_responses.go index 01c63cc39553094b1d4deaa8712b52f7f99de27d..faffc97949395dc1c8a38afd9d17f0c50e5aeb29 100644 --- a/netbox/client/ipam/ip_amvlan_groups_update_responses.go +++ b/netbox/client/ipam/ip_a_m_vlan_groups_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVlanGroupsUpdateReader is a Reader for the IPAMVlanGroupsUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMVlanGroupsUpdateOK() *IPAMVlanGroupsUpdateOK { IPAMVlanGroupsUpdateOK ipam vlan groups update o k */ type IPAMVlanGroupsUpdateOK struct { - Payload *models.WritableVLANGroup + Payload *models.VLANGroup } func (o *IPAMVlanGroupsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVlanGroupsUpdateOK) Error() string { func (o *IPAMVlanGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVLANGroup) + o.Payload = new(models.VLANGroup) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvlans_create_parameters.go b/netbox/client/ipam/ip_a_m_vlans_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvlans_create_parameters.go rename to netbox/client/ipam/ip_a_m_vlans_create_parameters.go index 9be43038b237d8e9a30492fcdb0cb1fcf87beef5..4a8e8910d20b4b6de5a2338478cdf9419bec375a 100644 --- a/netbox/client/ipam/ip_amvlans_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlans_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVlansCreateParams creates a new IPAMVlansCreateParams object diff --git a/netbox/client/ipam/ip_amvlans_create_responses.go b/netbox/client/ipam/ip_a_m_vlans_create_responses.go similarity index 95% rename from netbox/client/ipam/ip_amvlans_create_responses.go rename to netbox/client/ipam/ip_a_m_vlans_create_responses.go index fab34265be7f3a8c70d229c9f0a63b677c15aaea..b8177d1c4dcaedfaabda5dbd8f4cebfc0f09af78 100644 --- a/netbox/client/ipam/ip_amvlans_create_responses.go +++ b/netbox/client/ipam/ip_a_m_vlans_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVlansCreateReader is a Reader for the IPAMVlansCreate structure. @@ -61,7 +61,7 @@ func NewIPAMVlansCreateCreated() *IPAMVlansCreateCreated { IPAMVlansCreateCreated ipam vlans create created */ type IPAMVlansCreateCreated struct { - Payload *models.WritableVLAN + Payload *models.VLAN } func (o *IPAMVlansCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVlansCreateCreated) Error() string { func (o *IPAMVlansCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVLAN) + o.Payload = new(models.VLAN) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvlans_delete_parameters.go b/netbox/client/ipam/ip_a_m_vlans_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amvlans_delete_parameters.go rename to netbox/client/ipam/ip_a_m_vlans_delete_parameters.go index ad0ab879cbd4c83b3e33822f162bf18d3e65a9d6..60d943aeaa6ada0e5a2f54054183e5af8ac826e4 100644 --- a/netbox/client/ipam/ip_amvlans_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlans_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amvlans_delete_responses.go b/netbox/client/ipam/ip_a_m_vlans_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amvlans_delete_responses.go rename to netbox/client/ipam/ip_a_m_vlans_delete_responses.go diff --git a/netbox/client/ipam/ip_amvlans_list_parameters.go b/netbox/client/ipam/ip_a_m_vlans_list_parameters.go similarity index 84% rename from netbox/client/ipam/ip_amvlans_list_parameters.go rename to netbox/client/ipam/ip_a_m_vlans_list_parameters.go index 652225cd3be3dd342f28bde764d5c3bcaaa78b2a..30a27c15eb6b295e8f73b8137860f06068ecbfa8 100644 --- a/netbox/client/ipam/ip_amvlans_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlans_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -110,12 +109,18 @@ type IPAMVlansListParams struct { SiteID *string /*Status*/ Status *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string /*Vid*/ - Vid *float64 + Vid *string timeout time.Duration Context context.Context @@ -287,6 +292,17 @@ func (o *IPAMVlansListParams) SetStatus(status *string) { o.Status = status } +// WithTag adds the tag to the ipam vlans list params +func (o *IPAMVlansListParams) WithTag(tag *string) *IPAMVlansListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam vlans list params +func (o *IPAMVlansListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the ipam vlans list params func (o *IPAMVlansListParams) WithTenant(tenant *string) *IPAMVlansListParams { o.SetTenant(tenant) @@ -298,6 +314,28 @@ func (o *IPAMVlansListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the ipam vlans list params +func (o *IPAMVlansListParams) WithTenantGroup(tenantGroup *string) *IPAMVlansListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the ipam vlans list params +func (o *IPAMVlansListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the ipam vlans list params +func (o *IPAMVlansListParams) WithTenantGroupID(tenantGroupID *string) *IPAMVlansListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the ipam vlans list params +func (o *IPAMVlansListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the ipam vlans list params func (o *IPAMVlansListParams) WithTenantID(tenantID *string) *IPAMVlansListParams { o.SetTenantID(tenantID) @@ -310,13 +348,13 @@ func (o *IPAMVlansListParams) SetTenantID(tenantID *string) { } // WithVid adds the vid to the ipam vlans list params -func (o *IPAMVlansListParams) WithVid(vid *float64) *IPAMVlansListParams { +func (o *IPAMVlansListParams) WithVid(vid *string) *IPAMVlansListParams { o.SetVid(vid) return o } // SetVid adds the vid to the ipam vlans list params -func (o *IPAMVlansListParams) SetVid(vid *float64) { +func (o *IPAMVlansListParams) SetVid(vid *string) { o.Vid = vid } @@ -520,6 +558,22 @@ func (o *IPAMVlansListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -536,6 +590,38 @@ func (o *IPAMVlansListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id @@ -555,11 +641,11 @@ func (o *IPAMVlansListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt if o.Vid != nil { // query param vid - var qrVid float64 + var qrVid string if o.Vid != nil { qrVid = *o.Vid } - qVid := swag.FormatFloat64(qrVid) + qVid := qrVid if qVid != "" { if err := r.SetQueryParam("vid", qVid); err != nil { return err diff --git a/netbox/client/ipam/ip_a_m_vlans_list_responses.go b/netbox/client/ipam/ip_a_m_vlans_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e06edb5a92c3a8abaa1995ecbd867e04c639a9c0 --- /dev/null +++ b/netbox/client/ipam/ip_a_m_vlans_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVlansListReader is a Reader for the IPAMVlansList structure. +type IPAMVlansListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlansListOK creates a IPAMVlansListOK with default headers values +func NewIPAMVlansListOK() *IPAMVlansListOK { + return &IPAMVlansListOK{} +} + +/*IPAMVlansListOK handles this case with default header values. + +IPAMVlansListOK ipam vlans list o k +*/ +type IPAMVlansListOK struct { + Payload *IPAMVlansListOKBody +} + +func (o *IPAMVlansListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlans/][%d] ipamVlansListOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMVlansListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMVlansListOKBody IP a m vlans list o k body +swagger:model IPAMVlansListOKBody +*/ +type IPAMVlansListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.VLAN `json:"results"` +} + +// Validate validates this IP a m vlans list o k body +func (o *IPAMVlansListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMVlansListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamVlansListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMVlansListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamVlansListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMVlansListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamVlansListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMVlansListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamVlansListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamVlansListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMVlansListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMVlansListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVlansListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amvlans_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_vlans_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvlans_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_vlans_partial_update_parameters.go index 3bb7a2356b0c12322876dc12e4a16848a17fcb55..ce30b05c391ddc7a71d787b177c7afa7b0d3a9bb 100644 --- a/netbox/client/ipam/ip_amvlans_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlans_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVlansPartialUpdateParams creates a new IPAMVlansPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amvlans_partial_update_responses.go b/netbox/client/ipam/ip_a_m_vlans_partial_update_responses.go similarity index 95% rename from netbox/client/ipam/ip_amvlans_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_vlans_partial_update_responses.go index 0b064aecca6b1bb644f41a2b3b97687ae5cdea71..5404980fc221bde9afe48d6e541d6d975860f4d4 100644 --- a/netbox/client/ipam/ip_amvlans_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_vlans_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVlansPartialUpdateReader is a Reader for the IPAMVlansPartialUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMVlansPartialUpdateOK() *IPAMVlansPartialUpdateOK { IPAMVlansPartialUpdateOK ipam vlans partial update o k */ type IPAMVlansPartialUpdateOK struct { - Payload *models.WritableVLAN + Payload *models.VLAN } func (o *IPAMVlansPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVlansPartialUpdateOK) Error() string { func (o *IPAMVlansPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVLAN) + o.Payload = new(models.VLAN) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvlans_read_parameters.go b/netbox/client/ipam/ip_a_m_vlans_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amvlans_read_parameters.go rename to netbox/client/ipam/ip_a_m_vlans_read_parameters.go index e2de89b5139e6f5aef2a3e1cc0b6e362ecb9311a..db8ff773af6a04d13c0fe7d387e69511f632f8b6 100644 --- a/netbox/client/ipam/ip_amvlans_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlans_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amvlans_read_responses.go b/netbox/client/ipam/ip_a_m_vlans_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amvlans_read_responses.go rename to netbox/client/ipam/ip_a_m_vlans_read_responses.go index f32ac9c08d146fd417b5e995a64278d1f4202c4d..ef5a84012926537bef173aa241814a7019082b9a 100644 --- a/netbox/client/ipam/ip_amvlans_read_responses.go +++ b/netbox/client/ipam/ip_a_m_vlans_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVlansReadReader is a Reader for the IPAMVlansRead structure. diff --git a/netbox/client/ipam/ip_amvlans_update_parameters.go b/netbox/client/ipam/ip_a_m_vlans_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvlans_update_parameters.go rename to netbox/client/ipam/ip_a_m_vlans_update_parameters.go index 9768c16011df165d63a5eebb2b0c0c8e842339c0..4545c4ac191459d6ed281b413958276834b859d2 100644 --- a/netbox/client/ipam/ip_amvlans_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_vlans_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVlansUpdateParams creates a new IPAMVlansUpdateParams object diff --git a/netbox/client/ipam/ip_amvlans_update_responses.go b/netbox/client/ipam/ip_a_m_vlans_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amvlans_update_responses.go rename to netbox/client/ipam/ip_a_m_vlans_update_responses.go index 8d7d1e7ca78c229387217bff001ed477b1ac2f10..cb912f9da5fe388870cf747ad72d9d2fd30167ee 100644 --- a/netbox/client/ipam/ip_amvlans_update_responses.go +++ b/netbox/client/ipam/ip_a_m_vlans_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVlansUpdateReader is a Reader for the IPAMVlansUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMVlansUpdateOK() *IPAMVlansUpdateOK { IPAMVlansUpdateOK ipam vlans update o k */ type IPAMVlansUpdateOK struct { - Payload *models.WritableVLAN + Payload *models.VLAN } func (o *IPAMVlansUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVlansUpdateOK) Error() string { func (o *IPAMVlansUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVLAN) + o.Payload = new(models.VLAN) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvrfs_create_parameters.go b/netbox/client/ipam/ip_a_m_vrfs_create_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvrfs_create_parameters.go rename to netbox/client/ipam/ip_a_m_vrfs_create_parameters.go index 45ba2af69f9c6b4a6663d63f12f8dfe2f6191412..e55b6414e23c6f3f45986e8355d1b284db8a408b 100644 --- a/netbox/client/ipam/ip_amvrfs_create_parameters.go +++ b/netbox/client/ipam/ip_a_m_vrfs_create_parameters.go @@ -20,18 +20,17 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVrfsCreateParams creates a new IPAMVrfsCreateParams object diff --git a/netbox/client/ipam/ip_amvrfs_create_responses.go b/netbox/client/ipam/ip_a_m_vrfs_create_responses.go similarity index 95% rename from netbox/client/ipam/ip_amvrfs_create_responses.go rename to netbox/client/ipam/ip_a_m_vrfs_create_responses.go index 70d70ee2a9cb94b50c33fc1393f29555db83ec29..a7f98ae2d6e0f3081457a6663c3059ed64b8402f 100644 --- a/netbox/client/ipam/ip_amvrfs_create_responses.go +++ b/netbox/client/ipam/ip_a_m_vrfs_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVrfsCreateReader is a Reader for the IPAMVrfsCreate structure. @@ -61,7 +61,7 @@ func NewIPAMVrfsCreateCreated() *IPAMVrfsCreateCreated { IPAMVrfsCreateCreated ipam vrfs create created */ type IPAMVrfsCreateCreated struct { - Payload *models.WritableVRF + Payload *models.VRF } func (o *IPAMVrfsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVrfsCreateCreated) Error() string { func (o *IPAMVrfsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVRF) + o.Payload = new(models.VRF) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvrfs_delete_parameters.go b/netbox/client/ipam/ip_a_m_vrfs_delete_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amvrfs_delete_parameters.go rename to netbox/client/ipam/ip_a_m_vrfs_delete_parameters.go index f2d4b38f1578a068ea3f44f663d8dc0ebf191863..04c617e2c7436bb34b751fe4fe3e1235310708da 100644 --- a/netbox/client/ipam/ip_amvrfs_delete_parameters.go +++ b/netbox/client/ipam/ip_a_m_vrfs_delete_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amvrfs_delete_responses.go b/netbox/client/ipam/ip_a_m_vrfs_delete_responses.go similarity index 100% rename from netbox/client/ipam/ip_amvrfs_delete_responses.go rename to netbox/client/ipam/ip_a_m_vrfs_delete_responses.go diff --git a/netbox/client/ipam/ip_amvrfs_list_parameters.go b/netbox/client/ipam/ip_a_m_vrfs_list_parameters.go similarity index 81% rename from netbox/client/ipam/ip_amvrfs_list_parameters.go rename to netbox/client/ipam/ip_a_m_vrfs_list_parameters.go index d84f154a2b29b4e990d42470906e59925fb68f4e..255492185429ae33c083ac1733b3ab392445dfca 100644 --- a/netbox/client/ipam/ip_amvrfs_list_parameters.go +++ b/netbox/client/ipam/ip_a_m_vrfs_list_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -100,8 +99,14 @@ type IPAMVrfsListParams struct { Q *string /*Rd*/ Rd *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string @@ -220,6 +225,17 @@ func (o *IPAMVrfsListParams) SetRd(rd *string) { o.Rd = rd } +// WithTag adds the tag to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTag(tag *string) *IPAMVrfsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the ipam vrfs list params func (o *IPAMVrfsListParams) WithTenant(tenant *string) *IPAMVrfsListParams { o.SetTenant(tenant) @@ -231,6 +247,28 @@ func (o *IPAMVrfsListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTenantGroup(tenantGroup *string) *IPAMVrfsListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTenantGroupID(tenantGroupID *string) *IPAMVrfsListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the ipam vrfs list params func (o *IPAMVrfsListParams) WithTenantID(tenantID *string) *IPAMVrfsListParams { o.SetTenantID(tenantID) @@ -362,6 +400,22 @@ func (o *IPAMVrfsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -378,6 +432,38 @@ func (o *IPAMVrfsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt. } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id diff --git a/netbox/client/ipam/ip_a_m_vrfs_list_responses.go b/netbox/client/ipam/ip_a_m_vrfs_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..169a7c1109f6aba1736b3ac51e61d76be7030bfb --- /dev/null +++ b/netbox/client/ipam/ip_a_m_vrfs_list_responses.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package ipam + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + + strfmt "github.com/go-openapi/strfmt" + + models "github.com/digitalocean/go-netbox/netbox/models" +) + +// IPAMVrfsListReader is a Reader for the IPAMVrfsList structure. +type IPAMVrfsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVrfsListOK creates a IPAMVrfsListOK with default headers values +func NewIPAMVrfsListOK() *IPAMVrfsListOK { + return &IPAMVrfsListOK{} +} + +/*IPAMVrfsListOK handles this case with default header values. + +IPAMVrfsListOK ipam vrfs list o k +*/ +type IPAMVrfsListOK struct { + Payload *IPAMVrfsListOKBody +} + +func (o *IPAMVrfsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vrfs/][%d] ipamVrfsListOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(IPAMVrfsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/*IPAMVrfsListOKBody IP a m vrfs list o k body +swagger:model IPAMVrfsListOKBody +*/ +type IPAMVrfsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.VRF `json:"results"` +} + +// Validate validates this IP a m vrfs list o k body +func (o *IPAMVrfsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IPAMVrfsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("ipamVrfsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *IPAMVrfsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("ipamVrfsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMVrfsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("ipamVrfsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *IPAMVrfsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("ipamVrfsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipamVrfsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *IPAMVrfsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IPAMVrfsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVrfsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/ipam/ip_amvrfs_partial_update_parameters.go b/netbox/client/ipam/ip_a_m_vrfs_partial_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvrfs_partial_update_parameters.go rename to netbox/client/ipam/ip_a_m_vrfs_partial_update_parameters.go index b8847cd87c3f916d0e5d3e4fbb62d6434d7174f1..a929b4e19d60f0db15b51e26b645e51a5158e962 100644 --- a/netbox/client/ipam/ip_amvrfs_partial_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_vrfs_partial_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVrfsPartialUpdateParams creates a new IPAMVrfsPartialUpdateParams object diff --git a/netbox/client/ipam/ip_amvrfs_partial_update_responses.go b/netbox/client/ipam/ip_a_m_vrfs_partial_update_responses.go similarity index 95% rename from netbox/client/ipam/ip_amvrfs_partial_update_responses.go rename to netbox/client/ipam/ip_a_m_vrfs_partial_update_responses.go index 2b181741233ad1ca01830e2dbba14ea8edad53c2..98403acc490e9cd6abed113bf0ce64d3accf37ee 100644 --- a/netbox/client/ipam/ip_amvrfs_partial_update_responses.go +++ b/netbox/client/ipam/ip_a_m_vrfs_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVrfsPartialUpdateReader is a Reader for the IPAMVrfsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMVrfsPartialUpdateOK() *IPAMVrfsPartialUpdateOK { IPAMVrfsPartialUpdateOK ipam vrfs partial update o k */ type IPAMVrfsPartialUpdateOK struct { - Payload *models.WritableVRF + Payload *models.VRF } func (o *IPAMVrfsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVrfsPartialUpdateOK) Error() string { func (o *IPAMVrfsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVRF) + o.Payload = new(models.VRF) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amvrfs_read_parameters.go b/netbox/client/ipam/ip_a_m_vrfs_read_parameters.go similarity index 99% rename from netbox/client/ipam/ip_amvrfs_read_parameters.go rename to netbox/client/ipam/ip_a_m_vrfs_read_parameters.go index 4dfcd850a6f7dd7f7b72813eb3eacc55f58e4b0e..9d162e8749da583c92cb65a35958506b24d76c40 100644 --- a/netbox/client/ipam/ip_amvrfs_read_parameters.go +++ b/netbox/client/ipam/ip_a_m_vrfs_read_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/ipam/ip_amvrfs_read_responses.go b/netbox/client/ipam/ip_a_m_vrfs_read_responses.go similarity index 97% rename from netbox/client/ipam/ip_amvrfs_read_responses.go rename to netbox/client/ipam/ip_a_m_vrfs_read_responses.go index 56e62931a006e72a5de389ac05760bdf4ba7f44b..effe4b01f530dc062863e8fa709148a09de9feb4 100644 --- a/netbox/client/ipam/ip_amvrfs_read_responses.go +++ b/netbox/client/ipam/ip_a_m_vrfs_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVrfsReadReader is a Reader for the IPAMVrfsRead structure. diff --git a/netbox/client/ipam/ip_amvrfs_update_parameters.go b/netbox/client/ipam/ip_a_m_vrfs_update_parameters.go similarity index 98% rename from netbox/client/ipam/ip_amvrfs_update_parameters.go rename to netbox/client/ipam/ip_a_m_vrfs_update_parameters.go index 9d7ad623e78b4bdbddd2c8389b814a71e6ba2b10..7601369716ab04185cbfacb7cf3139a74c3cbcd1 100644 --- a/netbox/client/ipam/ip_amvrfs_update_parameters.go +++ b/netbox/client/ipam/ip_a_m_vrfs_update_parameters.go @@ -20,11 +20,10 @@ package ipam // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewIPAMVrfsUpdateParams creates a new IPAMVrfsUpdateParams object diff --git a/netbox/client/ipam/ip_amvrfs_update_responses.go b/netbox/client/ipam/ip_a_m_vrfs_update_responses.go similarity index 94% rename from netbox/client/ipam/ip_amvrfs_update_responses.go rename to netbox/client/ipam/ip_a_m_vrfs_update_responses.go index 972bf844c2d91092424642bf95f8c5face189f20..a8de7850b778cadcd03ca1dfa5f09a9539bc4139 100644 --- a/netbox/client/ipam/ip_amvrfs_update_responses.go +++ b/netbox/client/ipam/ip_a_m_vrfs_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // IPAMVrfsUpdateReader is a Reader for the IPAMVrfsUpdate structure. @@ -61,7 +61,7 @@ func NewIPAMVrfsUpdateOK() *IPAMVrfsUpdateOK { IPAMVrfsUpdateOK ipam vrfs update o k */ type IPAMVrfsUpdateOK struct { - Payload *models.WritableVRF + Payload *models.VRF } func (o *IPAMVrfsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *IPAMVrfsUpdateOK) Error() string { func (o *IPAMVrfsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVRF) + o.Payload = new(models.VRF) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/ipam/ip_amroles_list_responses.go b/netbox/client/ipam/ip_amroles_list_responses.go deleted file mode 100644 index 984bfb92b60d42ba6588471dbf0502798bc54d2a..0000000000000000000000000000000000000000 --- a/netbox/client/ipam/ip_amroles_list_responses.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ipam - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/digitalocean/go-netbox/netbox/models" -) - -// IPAMRolesListReader is a Reader for the IPAMRolesList structure. -type IPAMRolesListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *IPAMRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewIPAMRolesListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewIPAMRolesListOK creates a IPAMRolesListOK with default headers values -func NewIPAMRolesListOK() *IPAMRolesListOK { - return &IPAMRolesListOK{} -} - -/*IPAMRolesListOK handles this case with default header values. - -IPAMRolesListOK ipam roles list o k -*/ -type IPAMRolesListOK struct { - Payload *models.IPAMRolesListOKBody -} - -func (o *IPAMRolesListOK) Error() string { - return fmt.Sprintf("[GET /ipam/roles/][%d] ipamRolesListOK %+v", 200, o.Payload) -} - -func (o *IPAMRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IPAMRolesListOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/netbox/client/ipam/ip_amvlan_groups_list_responses.go b/netbox/client/ipam/ip_amvlan_groups_list_responses.go deleted file mode 100644 index 40e70dacf243e9e36aece7315d910777fab96328..0000000000000000000000000000000000000000 --- a/netbox/client/ipam/ip_amvlan_groups_list_responses.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ipam - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/digitalocean/go-netbox/netbox/models" -) - -// IPAMVlanGroupsListReader is a Reader for the IPAMVlanGroupsList structure. -type IPAMVlanGroupsListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *IPAMVlanGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewIPAMVlanGroupsListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewIPAMVlanGroupsListOK creates a IPAMVlanGroupsListOK with default headers values -func NewIPAMVlanGroupsListOK() *IPAMVlanGroupsListOK { - return &IPAMVlanGroupsListOK{} -} - -/*IPAMVlanGroupsListOK handles this case with default header values. - -IPAMVlanGroupsListOK ipam vlan groups list o k -*/ -type IPAMVlanGroupsListOK struct { - Payload *models.IPAMVlanGroupsListOKBody -} - -func (o *IPAMVlanGroupsListOK) Error() string { - return fmt.Sprintf("[GET /ipam/vlan-groups/][%d] ipamVlanGroupsListOK %+v", 200, o.Payload) -} - -func (o *IPAMVlanGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IPAMVlanGroupsListOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/netbox/client/ipam/ip_amvlans_list_responses.go b/netbox/client/ipam/ip_amvlans_list_responses.go deleted file mode 100644 index 6b6c0c1526bdf0bb6c8b66ec63f08e475f6bfcd3..0000000000000000000000000000000000000000 --- a/netbox/client/ipam/ip_amvlans_list_responses.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ipam - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/digitalocean/go-netbox/netbox/models" -) - -// IPAMVlansListReader is a Reader for the IPAMVlansList structure. -type IPAMVlansListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *IPAMVlansListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewIPAMVlansListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewIPAMVlansListOK creates a IPAMVlansListOK with default headers values -func NewIPAMVlansListOK() *IPAMVlansListOK { - return &IPAMVlansListOK{} -} - -/*IPAMVlansListOK handles this case with default header values. - -IPAMVlansListOK ipam vlans list o k -*/ -type IPAMVlansListOK struct { - Payload *models.IPAMVlansListOKBody -} - -func (o *IPAMVlansListOK) Error() string { - return fmt.Sprintf("[GET /ipam/vlans/][%d] ipamVlansListOK %+v", 200, o.Payload) -} - -func (o *IPAMVlansListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IPAMVlansListOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/netbox/client/ipam/ip_amvrfs_list_responses.go b/netbox/client/ipam/ip_amvrfs_list_responses.go deleted file mode 100644 index 884edd215a020f439beb5f1dc4651d7254c9238e..0000000000000000000000000000000000000000 --- a/netbox/client/ipam/ip_amvrfs_list_responses.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package ipam - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "io" - - "github.com/go-openapi/runtime" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/digitalocean/go-netbox/netbox/models" -) - -// IPAMVrfsListReader is a Reader for the IPAMVrfsList structure. -type IPAMVrfsListReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *IPAMVrfsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - - case 200: - result := NewIPAMVrfsListOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - - default: - return nil, runtime.NewAPIError("unknown error", response, response.Code()) - } -} - -// NewIPAMVrfsListOK creates a IPAMVrfsListOK with default headers values -func NewIPAMVrfsListOK() *IPAMVrfsListOK { - return &IPAMVrfsListOK{} -} - -/*IPAMVrfsListOK handles this case with default header values. - -IPAMVrfsListOK ipam vrfs list o k -*/ -type IPAMVrfsListOK struct { - Payload *models.IPAMVrfsListOKBody -} - -func (o *IPAMVrfsListOK) Error() string { - return fmt.Sprintf("[GET /ipam/vrfs/][%d] ipamVrfsListOK %+v", 200, o.Payload) -} - -func (o *IPAMVrfsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(models.IPAMVrfsListOKBody) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/netbox/client/net_box_client.go b/netbox/client/net_box_client.go index dd3bbbe4ce992861ede0ba0a61d5bfece0ae881b..e96ce34a0ffcc14db7d1d4f879e581596a7bb34e 100644 --- a/netbox/client/net_box_client.go +++ b/netbox/client/net_box_client.go @@ -58,9 +58,6 @@ func NewHTTPClient(formats strfmt.Registry) *NetBox { // using a customizable transport config. func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *NetBox { // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } if cfg == nil { cfg = DefaultTransportConfig() } @@ -72,6 +69,11 @@ func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Net // New creates a new net box client func New(transport runtime.ClientTransport, formats strfmt.Registry) *NetBox { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + cli := new(NetBox) cli.Transport = transport diff --git a/netbox/client/secrets/secrets_choices_list_parameters.go b/netbox/client/secrets/secrets_choices_list_parameters.go index f195561ab050848252a9228b66ffe1908951f78e..8012099f5433e12496a070d17e7478bd490d3e14 100644 --- a/netbox/client/secrets/secrets_choices_list_parameters.go +++ b/netbox/client/secrets/secrets_choices_list_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/secrets/secrets_choices_read_parameters.go b/netbox/client/secrets/secrets_choices_read_parameters.go index 9f8e92d12ab7ebef8334ebba0a5911cad380e5e0..595fbd121f5900009ccf150bf61c5c3444f1436d 100644 --- a/netbox/client/secrets/secrets_choices_read_parameters.go +++ b/netbox/client/secrets/secrets_choices_read_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/secrets/secrets_client.go b/netbox/client/secrets/secrets_client.go index 43f4525c0d5981678f354ea048c7f3c6e4d4c3c9..dda11a9f35b25253d400fe5443693bbf1e9fd234 100644 --- a/netbox/client/secrets/secrets_client.go +++ b/netbox/client/secrets/secrets_client.go @@ -97,9 +97,9 @@ func (a *Client) SecretsChoicesRead(params *SecretsChoicesReadParams, authInfo r } /* -SecretsGenerateRsaKeyPairList This endpoint can be used to generate a new RSA key pair. The keys are returned in PEM format. +SecretsGenerateRsaKeyPairList this endpoint can be used to generate a new r s a key pair the keys are returned in p e m format - { +{ "public_key": "<public key>", "private_key": "<private key>" } @@ -231,7 +231,7 @@ func (a *Client) SecretsSecretRolesDelete(params *SecretsSecretRolesDeleteParams } /* -SecretsSecretRolesList secrets secret roles list API +SecretsSecretRolesList Call to super to allow for caching */ func (a *Client) SecretsSecretRolesList(params *SecretsSecretRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesListOK, error) { // TODO: Validate the params before sending @@ -289,7 +289,7 @@ func (a *Client) SecretsSecretRolesPartialUpdate(params *SecretsSecretRolesParti } /* -SecretsSecretRolesRead secrets secret roles read API +SecretsSecretRolesRead Call to super to allow for caching */ func (a *Client) SecretsSecretRolesRead(params *SecretsSecretRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesReadOK, error) { // TODO: Validate the params before sending diff --git a/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go b/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go index 617c6d1e722415ca996c16f2f6969af83df71a62..26bca5eb94305938c8a2b1eff7487622574c1c5b 100644 --- a/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go +++ b/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/secrets/secrets_get_session_key_create_parameters.go b/netbox/client/secrets/secrets_get_session_key_create_parameters.go index 1b6a820097561c84b1b1f8ca570e72162a45d7b2..bc454ad7913e8590564f95a53aa4fdb32dae7b1b 100644 --- a/netbox/client/secrets/secrets_get_session_key_create_parameters.go +++ b/netbox/client/secrets/secrets_get_session_key_create_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/secrets/secrets_secret_roles_create_parameters.go b/netbox/client/secrets/secrets_secret_roles_create_parameters.go index 90798732940f9bda0bf2d7a7c935c21bc4210af7..a109b41498543c9873c754c46e743afc6ee87065 100644 --- a/netbox/client/secrets/secrets_secret_roles_create_parameters.go +++ b/netbox/client/secrets/secrets_secret_roles_create_parameters.go @@ -20,18 +20,17 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewSecretsSecretRolesCreateParams creates a new SecretsSecretRolesCreateParams object diff --git a/netbox/client/secrets/secrets_secret_roles_create_responses.go b/netbox/client/secrets/secrets_secret_roles_create_responses.go index 3e7f580817b55d7fa214fa505666f41314c6cef2..ceae6ba7d54d05a20e0ffbfb811825ab09d2ee12 100644 --- a/netbox/client/secrets/secrets_secret_roles_create_responses.go +++ b/netbox/client/secrets/secrets_secret_roles_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretRolesCreateReader is a Reader for the SecretsSecretRolesCreate structure. diff --git a/netbox/client/secrets/secrets_secret_roles_delete_parameters.go b/netbox/client/secrets/secrets_secret_roles_delete_parameters.go index a817be2b5584a9afc2f64e7343b8858fe9899d35..a6553fb1233df531290f95c2f2e4245894ffdc7b 100644 --- a/netbox/client/secrets/secrets_secret_roles_delete_parameters.go +++ b/netbox/client/secrets/secrets_secret_roles_delete_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/secrets/secrets_secret_roles_list_parameters.go b/netbox/client/secrets/secrets_secret_roles_list_parameters.go index 3f348ef34d6741b0c8da0f03baa66e4d9b20387f..6f5fb649839a744f33c3a1b9e020817ca12204fc 100644 --- a/netbox/client/secrets/secrets_secret_roles_list_parameters.go +++ b/netbox/client/secrets/secrets_secret_roles_list_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the secrets secret roles list operation typically these are written to a htt */ type SecretsSecretRolesListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type SecretsSecretRolesListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -130,6 +133,17 @@ func (o *SecretsSecretRolesListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithID(id *string) *SecretsSecretRolesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the secrets secret roles list params func (o *SecretsSecretRolesListParams) WithLimit(limit *int64) *SecretsSecretRolesListParams { o.SetLimit(limit) @@ -163,6 +177,17 @@ func (o *SecretsSecretRolesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithQ(q *string) *SecretsSecretRolesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the secrets secret roles list params func (o *SecretsSecretRolesListParams) WithSlug(slug *string) *SecretsSecretRolesListParams { o.SetSlug(slug) @@ -182,6 +207,22 @@ func (o *SecretsSecretRolesListParams) WriteToRequest(r runtime.ClientRequest, r } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -230,6 +271,22 @@ func (o *SecretsSecretRolesListParams) WriteToRequest(r runtime.ClientRequest, r } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/secrets/secrets_secret_roles_list_responses.go b/netbox/client/secrets/secrets_secret_roles_list_responses.go index 5c9ef19dc52d5bfd004d82e84eda06f55d50c77c..f804e03c2c58c325c0cb2e974b566a4e9ece3465 100644 --- a/netbox/client/secrets/secrets_secret_roles_list_responses.go +++ b/netbox/client/secrets/secrets_secret_roles_list_responses.go @@ -22,12 +22,16 @@ package secrets import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretRolesListReader is a Reader for the SecretsSecretRolesList structure. @@ -61,7 +65,7 @@ func NewSecretsSecretRolesListOK() *SecretsSecretRolesListOK { SecretsSecretRolesListOK secrets secret roles list o k */ type SecretsSecretRolesListOK struct { - Payload *models.SecretsSecretRolesListOKBody + Payload *SecretsSecretRolesListOKBody } func (o *SecretsSecretRolesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *SecretsSecretRolesListOK) Error() string { func (o *SecretsSecretRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.SecretsSecretRolesListOKBody) + o.Payload = new(SecretsSecretRolesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *SecretsSecretRolesListOK) readResponse(response runtime.ClientResponse, return nil } + +/*SecretsSecretRolesListOKBody secrets secret roles list o k body +swagger:model SecretsSecretRolesListOKBody +*/ +type SecretsSecretRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.SecretRole `json:"results"` +} + +// Validate validates this secrets secret roles list o k body +func (o *SecretsSecretRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *SecretsSecretRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("secretsSecretRolesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *SecretsSecretRolesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("secretsSecretRolesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *SecretsSecretRolesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("secretsSecretRolesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *SecretsSecretRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("secretsSecretRolesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secretsSecretRolesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *SecretsSecretRolesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SecretsSecretRolesListOKBody) UnmarshalBinary(b []byte) error { + var res SecretsSecretRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go b/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go index 8d5cc745c8fe3c9fbdc1d170fc2adbde7e362925..655c7ed98f4add3a399582fdacf52a30d195984f 100644 --- a/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go +++ b/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewSecretsSecretRolesPartialUpdateParams creates a new SecretsSecretRolesPartialUpdateParams object diff --git a/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go b/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go index e32c3b91f7702618b2a8da843e53b8985fe874b1..ea311a8435fad156deee6c57c30ead64642dbbf5 100644 --- a/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go +++ b/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretRolesPartialUpdateReader is a Reader for the SecretsSecretRolesPartialUpdate structure. diff --git a/netbox/client/secrets/secrets_secret_roles_read_parameters.go b/netbox/client/secrets/secrets_secret_roles_read_parameters.go index 2f77a4f65a2eef7bca89d1bb5c4c0d801af47049..d36d7f95ae1bfa72441870e5968f7d4cf15c42fc 100644 --- a/netbox/client/secrets/secrets_secret_roles_read_parameters.go +++ b/netbox/client/secrets/secrets_secret_roles_read_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/secrets/secrets_secret_roles_read_responses.go b/netbox/client/secrets/secrets_secret_roles_read_responses.go index 1af11f6c14a5e89d8c28b7e7774e29dcd338feba..f96f9db75acf9e50791f8b7d0fef90b7ee144478 100644 --- a/netbox/client/secrets/secrets_secret_roles_read_responses.go +++ b/netbox/client/secrets/secrets_secret_roles_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretRolesReadReader is a Reader for the SecretsSecretRolesRead structure. diff --git a/netbox/client/secrets/secrets_secret_roles_update_parameters.go b/netbox/client/secrets/secrets_secret_roles_update_parameters.go index fbee6d49aba90a6efc85fc32120666b3782e66bd..964982eddaea54ad7d9a3d6e2a098ae9725b6748 100644 --- a/netbox/client/secrets/secrets_secret_roles_update_parameters.go +++ b/netbox/client/secrets/secrets_secret_roles_update_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewSecretsSecretRolesUpdateParams creates a new SecretsSecretRolesUpdateParams object diff --git a/netbox/client/secrets/secrets_secret_roles_update_responses.go b/netbox/client/secrets/secrets_secret_roles_update_responses.go index 335f724487a27e1f7e48cd067d48e8df7f73c075..8ef63898c36bff7f9c4be42fb6202b61155bc056 100644 --- a/netbox/client/secrets/secrets_secret_roles_update_responses.go +++ b/netbox/client/secrets/secrets_secret_roles_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretRolesUpdateReader is a Reader for the SecretsSecretRolesUpdate structure. diff --git a/netbox/client/secrets/secrets_secrets_create_parameters.go b/netbox/client/secrets/secrets_secrets_create_parameters.go index 955ef7ab1ea0a86232f6c82744d81e5caa663f25..18fd884e731afc9d1d61dd11c0c90b9d9d823911 100644 --- a/netbox/client/secrets/secrets_secrets_create_parameters.go +++ b/netbox/client/secrets/secrets_secrets_create_parameters.go @@ -20,18 +20,17 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewSecretsSecretsCreateParams creates a new SecretsSecretsCreateParams object diff --git a/netbox/client/secrets/secrets_secrets_create_responses.go b/netbox/client/secrets/secrets_secrets_create_responses.go index 7bfc7027c6cf5da208fa54b539a31fb4fcf15b95..4c172e18347aeb1a577c34991830dec6c084c0a0 100644 --- a/netbox/client/secrets/secrets_secrets_create_responses.go +++ b/netbox/client/secrets/secrets_secrets_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretsCreateReader is a Reader for the SecretsSecretsCreate structure. @@ -61,7 +61,7 @@ func NewSecretsSecretsCreateCreated() *SecretsSecretsCreateCreated { SecretsSecretsCreateCreated secrets secrets create created */ type SecretsSecretsCreateCreated struct { - Payload *models.WritableSecret + Payload *models.Secret } func (o *SecretsSecretsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *SecretsSecretsCreateCreated) Error() string { func (o *SecretsSecretsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableSecret) + o.Payload = new(models.Secret) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/secrets/secrets_secrets_delete_parameters.go b/netbox/client/secrets/secrets_secrets_delete_parameters.go index b4d4592dc9538bb267463dc4e092a5b547d19274..e959851515f059bf6ab8b85719453719ddcf66e3 100644 --- a/netbox/client/secrets/secrets_secrets_delete_parameters.go +++ b/netbox/client/secrets/secrets_secrets_delete_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/secrets/secrets_secrets_list_parameters.go b/netbox/client/secrets/secrets_secrets_list_parameters.go index 0692ae4daaccc84a04c2fbf43f5df493b1b52bc3..6fe1509150c5ed7489da66e4cb90ea7359604b74 100644 --- a/netbox/client/secrets/secrets_secrets_list_parameters.go +++ b/netbox/client/secrets/secrets_secrets_list_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -104,6 +103,8 @@ type SecretsSecretsListParams struct { Role *string /*RoleID*/ RoleID *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -242,6 +243,17 @@ func (o *SecretsSecretsListParams) SetRoleID(roleID *string) { o.RoleID = roleID } +// WithTag adds the tag to the secrets secrets list params +func (o *SecretsSecretsListParams) WithTag(tag *string) *SecretsSecretsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the secrets secrets list params +func (o *SecretsSecretsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *SecretsSecretsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -394,6 +406,22 @@ func (o *SecretsSecretsListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/secrets/secrets_secrets_list_responses.go b/netbox/client/secrets/secrets_secrets_list_responses.go index be87d65932209ca7660ab366f13d93ced04766d8..34883f445b4b327a3e13c0e4ef2122ee97571546 100644 --- a/netbox/client/secrets/secrets_secrets_list_responses.go +++ b/netbox/client/secrets/secrets_secrets_list_responses.go @@ -22,12 +22,16 @@ package secrets import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretsListReader is a Reader for the SecretsSecretsList structure. @@ -61,7 +65,7 @@ func NewSecretsSecretsListOK() *SecretsSecretsListOK { SecretsSecretsListOK secrets secrets list o k */ type SecretsSecretsListOK struct { - Payload *models.SecretsSecretsListOKBody + Payload *SecretsSecretsListOKBody } func (o *SecretsSecretsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *SecretsSecretsListOK) Error() string { func (o *SecretsSecretsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.SecretsSecretsListOKBody) + o.Payload = new(SecretsSecretsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *SecretsSecretsListOK) readResponse(response runtime.ClientResponse, con return nil } + +/*SecretsSecretsListOKBody secrets secrets list o k body +swagger:model SecretsSecretsListOKBody +*/ +type SecretsSecretsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Secret `json:"results"` +} + +// Validate validates this secrets secrets list o k body +func (o *SecretsSecretsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *SecretsSecretsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("secretsSecretsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *SecretsSecretsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("secretsSecretsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *SecretsSecretsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("secretsSecretsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *SecretsSecretsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("secretsSecretsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secretsSecretsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *SecretsSecretsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SecretsSecretsListOKBody) UnmarshalBinary(b []byte) error { + var res SecretsSecretsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/secrets/secrets_secrets_partial_update_parameters.go b/netbox/client/secrets/secrets_secrets_partial_update_parameters.go index fcd0af324d9b9b66a85cda1e518ce3efd02eaa80..0799963eb912f5ff9d54af9ce43e43a5f2d9a476 100644 --- a/netbox/client/secrets/secrets_secrets_partial_update_parameters.go +++ b/netbox/client/secrets/secrets_secrets_partial_update_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewSecretsSecretsPartialUpdateParams creates a new SecretsSecretsPartialUpdateParams object diff --git a/netbox/client/secrets/secrets_secrets_partial_update_responses.go b/netbox/client/secrets/secrets_secrets_partial_update_responses.go index 283b1aa073e05c6e43e831b3c5f14b57c317794e..63af87ada082f14ec67b6d58b1f9e539337d02c3 100644 --- a/netbox/client/secrets/secrets_secrets_partial_update_responses.go +++ b/netbox/client/secrets/secrets_secrets_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretsPartialUpdateReader is a Reader for the SecretsSecretsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewSecretsSecretsPartialUpdateOK() *SecretsSecretsPartialUpdateOK { SecretsSecretsPartialUpdateOK secrets secrets partial update o k */ type SecretsSecretsPartialUpdateOK struct { - Payload *models.WritableSecret + Payload *models.Secret } func (o *SecretsSecretsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *SecretsSecretsPartialUpdateOK) Error() string { func (o *SecretsSecretsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableSecret) + o.Payload = new(models.Secret) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/secrets/secrets_secrets_read_parameters.go b/netbox/client/secrets/secrets_secrets_read_parameters.go index 080922f09c4a94219c3b2305bd36fc94809d14aa..d81390f2453b6812c4e871c7a9e3ad0b176865e7 100644 --- a/netbox/client/secrets/secrets_secrets_read_parameters.go +++ b/netbox/client/secrets/secrets_secrets_read_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/secrets/secrets_secrets_read_responses.go b/netbox/client/secrets/secrets_secrets_read_responses.go index 2f7b82f1a2f3b5c73edfae430a1d02605e39ce72..6ecdeef539fe1abaff240f3f7a6f211805642d11 100644 --- a/netbox/client/secrets/secrets_secrets_read_responses.go +++ b/netbox/client/secrets/secrets_secrets_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretsReadReader is a Reader for the SecretsSecretsRead structure. diff --git a/netbox/client/secrets/secrets_secrets_update_parameters.go b/netbox/client/secrets/secrets_secrets_update_parameters.go index 9e0f8e6c297ff20358c4c2d5d8b25d74eaa4fa0b..7a0a82246f30db25b228adcfeeee68704e93a032 100644 --- a/netbox/client/secrets/secrets_secrets_update_parameters.go +++ b/netbox/client/secrets/secrets_secrets_update_parameters.go @@ -20,11 +20,10 @@ package secrets // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewSecretsSecretsUpdateParams creates a new SecretsSecretsUpdateParams object diff --git a/netbox/client/secrets/secrets_secrets_update_responses.go b/netbox/client/secrets/secrets_secrets_update_responses.go index a956a68dc8ac784a69256dcc4f87d1538dff90e7..a308c254fd5374b3c53edfe738240c857c10d1d3 100644 --- a/netbox/client/secrets/secrets_secrets_update_responses.go +++ b/netbox/client/secrets/secrets_secrets_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // SecretsSecretsUpdateReader is a Reader for the SecretsSecretsUpdate structure. @@ -61,7 +61,7 @@ func NewSecretsSecretsUpdateOK() *SecretsSecretsUpdateOK { SecretsSecretsUpdateOK secrets secrets update o k */ type SecretsSecretsUpdateOK struct { - Payload *models.WritableSecret + Payload *models.Secret } func (o *SecretsSecretsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *SecretsSecretsUpdateOK) Error() string { func (o *SecretsSecretsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableSecret) + o.Payload = new(models.Secret) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/tenancy/tenancy_choices_list_parameters.go b/netbox/client/tenancy/tenancy_choices_list_parameters.go index 65e9a94c6b52d2b3681b311c7dc5b7910d2a6b2e..ca2d11e4334d3a014a187f0dee71274370ade167 100644 --- a/netbox/client/tenancy/tenancy_choices_list_parameters.go +++ b/netbox/client/tenancy/tenancy_choices_list_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/tenancy/tenancy_choices_read_parameters.go b/netbox/client/tenancy/tenancy_choices_read_parameters.go index 9a325aab1857f96e944204d5d36ac4b499d7bba0..43006292306ca9098f41c7b91684f9d9c3522b9a 100644 --- a/netbox/client/tenancy/tenancy_choices_read_parameters.go +++ b/netbox/client/tenancy/tenancy_choices_read_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/tenancy/tenancy_client.go b/netbox/client/tenancy/tenancy_client.go index 455ac4d50a33d7a50321c584838525f1b0ac15c7..c0464e40298d6faf3eca83279cbe05fdfb5c73f4 100644 --- a/netbox/client/tenancy/tenancy_client.go +++ b/netbox/client/tenancy/tenancy_client.go @@ -155,7 +155,7 @@ func (a *Client) TenancyTenantGroupsDelete(params *TenancyTenantGroupsDeletePara } /* -TenancyTenantGroupsList tenancy tenant groups list API +TenancyTenantGroupsList Call to super to allow for caching */ func (a *Client) TenancyTenantGroupsList(params *TenancyTenantGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsListOK, error) { // TODO: Validate the params before sending @@ -213,7 +213,7 @@ func (a *Client) TenancyTenantGroupsPartialUpdate(params *TenancyTenantGroupsPar } /* -TenancyTenantGroupsRead tenancy tenant groups read API +TenancyTenantGroupsRead Call to super to allow for caching */ func (a *Client) TenancyTenantGroupsRead(params *TenancyTenantGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsReadOK, error) { // TODO: Validate the params before sending @@ -329,7 +329,7 @@ func (a *Client) TenancyTenantsDelete(params *TenancyTenantsDeleteParams, authIn } /* -TenancyTenantsList tenancy tenants list API +TenancyTenantsList Call to super to allow for caching */ func (a *Client) TenancyTenantsList(params *TenancyTenantsListParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsListOK, error) { // TODO: Validate the params before sending @@ -387,7 +387,7 @@ func (a *Client) TenancyTenantsPartialUpdate(params *TenancyTenantsPartialUpdate } /* -TenancyTenantsRead tenancy tenants read API +TenancyTenantsRead Call to super to allow for caching */ func (a *Client) TenancyTenantsRead(params *TenancyTenantsReadParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsReadOK, error) { // TODO: Validate the params before sending diff --git a/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go index e2da622433ff6c017547256cc38681bef65583b9..5a220a5c198957bfde5b9bd9071286a6ae492957 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go @@ -20,18 +20,17 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewTenancyTenantGroupsCreateParams creates a new TenancyTenantGroupsCreateParams object diff --git a/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go index 9f21308b286e5036da4e89f0ab5b83dd8bd0e47b..f9e95b55f713c43a3c4b968b600829a61e638fc1 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantGroupsCreateReader is a Reader for the TenancyTenantGroupsCreate structure. diff --git a/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go index ceb93faa79d8aeb61be406e726614343369b210b..83f3fe379c8e268f80c8663603679326f3ddc124 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go index 5eaa4a3cb3454d9a70b4bef83fec7adbe771bd88..7571ce8f977053d002cc290166d951191652deca 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the tenancy tenant groups list operation typically these are written to a ht */ type TenancyTenantGroupsListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type TenancyTenantGroupsListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -130,6 +133,17 @@ func (o *TenancyTenantGroupsListParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } +// WithID adds the id to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithID(id *string) *TenancyTenantGroupsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the tenancy tenant groups list params func (o *TenancyTenantGroupsListParams) WithLimit(limit *int64) *TenancyTenantGroupsListParams { o.SetLimit(limit) @@ -163,6 +177,17 @@ func (o *TenancyTenantGroupsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithQ(q *string) *TenancyTenantGroupsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the tenancy tenant groups list params func (o *TenancyTenantGroupsListParams) WithSlug(slug *string) *TenancyTenantGroupsListParams { o.SetSlug(slug) @@ -182,6 +207,22 @@ func (o *TenancyTenantGroupsListParams) WriteToRequest(r runtime.ClientRequest, } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -230,6 +271,22 @@ func (o *TenancyTenantGroupsListParams) WriteToRequest(r runtime.ClientRequest, } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go index 2de417389a79f089543aab7e53613ce608732dfb..016df37f14b947aca7c8139387f3baa5a145266b 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go @@ -22,12 +22,16 @@ package tenancy import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantGroupsListReader is a Reader for the TenancyTenantGroupsList structure. @@ -61,7 +65,7 @@ func NewTenancyTenantGroupsListOK() *TenancyTenantGroupsListOK { TenancyTenantGroupsListOK tenancy tenant groups list o k */ type TenancyTenantGroupsListOK struct { - Payload *models.TenancyTenantGroupsListOKBody + Payload *TenancyTenantGroupsListOKBody } func (o *TenancyTenantGroupsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *TenancyTenantGroupsListOK) Error() string { func (o *TenancyTenantGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.TenancyTenantGroupsListOKBody) + o.Payload = new(TenancyTenantGroupsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *TenancyTenantGroupsListOK) readResponse(response runtime.ClientResponse return nil } + +/*TenancyTenantGroupsListOKBody tenancy tenant groups list o k body +swagger:model TenancyTenantGroupsListOKBody +*/ +type TenancyTenantGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.TenantGroup `json:"results"` +} + +// Validate validates this tenancy tenant groups list o k body +func (o *TenancyTenantGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyTenantGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("tenancyTenantGroupsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *TenancyTenantGroupsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("tenancyTenantGroupsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyTenantGroupsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("tenancyTenantGroupsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyTenantGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("tenancyTenantGroupsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyTenantGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *TenancyTenantGroupsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *TenancyTenantGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyTenantGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go index 882a6c2cd64a017d5eea60460fb06de788c0177b..eb8219d2443c3efc24332a62d44b6149f7e0040a 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewTenancyTenantGroupsPartialUpdateParams creates a new TenancyTenantGroupsPartialUpdateParams object diff --git a/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go index 19444b8cb88d30507045c47d515ee081593909a5..4f72c46b024c05157964adcde125b2c2e61f197d 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantGroupsPartialUpdateReader is a Reader for the TenancyTenantGroupsPartialUpdate structure. diff --git a/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go index 67c8bb1e9deb8c9675e7e5c34190d5dbe7398b76..e21500a44d631d84cad44ec7050ae7bf45b59db9 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go index 364fe3b2fa74525e4fdc09cdd198793c71fb1622..abddebe272b044714d4b4ed9a092895d27b54f11 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantGroupsReadReader is a Reader for the TenancyTenantGroupsRead structure. diff --git a/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go index 73bedaedd186dda4c43d970624f472886eeade44..9412c8c1261cbc6ea6f834a6b3b5e0b328dd4b8e 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewTenancyTenantGroupsUpdateParams creates a new TenancyTenantGroupsUpdateParams object diff --git a/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go index bcfea4bc41c26c5db7c50cb1e1419b3582ba1d79..24afde2f2bce7fbedfb53dff38609b6008e070f7 100644 --- a/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go +++ b/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantGroupsUpdateReader is a Reader for the TenancyTenantGroupsUpdate structure. diff --git a/netbox/client/tenancy/tenancy_tenants_create_parameters.go b/netbox/client/tenancy/tenancy_tenants_create_parameters.go index 0d07794029a6a3b4af0f2d8d4c52db9136dcd6a6..c40e00f83b49f2fd2dc6eef66cb50add2b67d85b 100644 --- a/netbox/client/tenancy/tenancy_tenants_create_parameters.go +++ b/netbox/client/tenancy/tenancy_tenants_create_parameters.go @@ -20,18 +20,17 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewTenancyTenantsCreateParams creates a new TenancyTenantsCreateParams object diff --git a/netbox/client/tenancy/tenancy_tenants_create_responses.go b/netbox/client/tenancy/tenancy_tenants_create_responses.go index 9a75edf85715bd62d5ddc167c6dec0e423cefb35..687445df8cf980b59e4b1a3121aacdf4dcee6554 100644 --- a/netbox/client/tenancy/tenancy_tenants_create_responses.go +++ b/netbox/client/tenancy/tenancy_tenants_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantsCreateReader is a Reader for the TenancyTenantsCreate structure. @@ -61,7 +61,7 @@ func NewTenancyTenantsCreateCreated() *TenancyTenantsCreateCreated { TenancyTenantsCreateCreated tenancy tenants create created */ type TenancyTenantsCreateCreated struct { - Payload *models.WritableTenant + Payload *models.Tenant } func (o *TenancyTenantsCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *TenancyTenantsCreateCreated) Error() string { func (o *TenancyTenantsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableTenant) + o.Payload = new(models.Tenant) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/tenancy/tenancy_tenants_delete_parameters.go b/netbox/client/tenancy/tenancy_tenants_delete_parameters.go index 543d4c2d71568a0b813aec4ba7cd43562b6dbe40..7aca5d734b71cd86f215057baef20915ea915b89 100644 --- a/netbox/client/tenancy/tenancy_tenants_delete_parameters.go +++ b/netbox/client/tenancy/tenancy_tenants_delete_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/tenancy/tenancy_tenants_list_parameters.go b/netbox/client/tenancy/tenancy_tenants_list_parameters.go index 80e91ea7d17db6543c4c0174a1bcc139ba16df4c..acebf450e1ae4376df01405b9fde2c3635af4ce2 100644 --- a/netbox/client/tenancy/tenancy_tenants_list_parameters.go +++ b/netbox/client/tenancy/tenancy_tenants_list_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -100,6 +99,10 @@ type TenancyTenantsListParams struct { Offset *int64 /*Q*/ Q *string + /*Slug*/ + Slug *string + /*Tag*/ + Tag *string timeout time.Duration Context context.Context @@ -216,6 +219,28 @@ func (o *TenancyTenantsListParams) SetQ(q *string) { o.Q = q } +// WithSlug adds the slug to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithSlug(slug *string) *TenancyTenantsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithTag adds the tag to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithTag(tag *string) *TenancyTenantsListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetTag(tag *string) { + o.Tag = tag +} + // WriteToRequest writes these params to a swagger request func (o *TenancyTenantsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -336,6 +361,38 @@ func (o *TenancyTenantsListParams) WriteToRequest(r runtime.ClientRequest, reg s } + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/tenancy/tenancy_tenants_list_responses.go b/netbox/client/tenancy/tenancy_tenants_list_responses.go index 038e7afcbfd657c5a1f4b76250d3a1b472a85e9f..779821c2f754f64f3182fb73a34a2f4780e3efaf 100644 --- a/netbox/client/tenancy/tenancy_tenants_list_responses.go +++ b/netbox/client/tenancy/tenancy_tenants_list_responses.go @@ -22,12 +22,16 @@ package tenancy import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantsListReader is a Reader for the TenancyTenantsList structure. @@ -61,7 +65,7 @@ func NewTenancyTenantsListOK() *TenancyTenantsListOK { TenancyTenantsListOK tenancy tenants list o k */ type TenancyTenantsListOK struct { - Payload *models.TenancyTenantsListOKBody + Payload *TenancyTenantsListOKBody } func (o *TenancyTenantsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *TenancyTenantsListOK) Error() string { func (o *TenancyTenantsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.TenancyTenantsListOKBody) + o.Payload = new(TenancyTenantsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *TenancyTenantsListOK) readResponse(response runtime.ClientResponse, con return nil } + +/*TenancyTenantsListOKBody tenancy tenants list o k body +swagger:model TenancyTenantsListOKBody +*/ +type TenancyTenantsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Tenant `json:"results"` +} + +// Validate validates this tenancy tenants list o k body +func (o *TenancyTenantsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *TenancyTenantsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("tenancyTenantsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *TenancyTenantsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("tenancyTenantsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyTenantsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("tenancyTenantsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *TenancyTenantsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("tenancyTenantsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenancyTenantsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *TenancyTenantsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *TenancyTenantsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyTenantsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go b/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go index 30efff81a3e1d45bfb77533a73252397365ab8d9..978db780d3098acd3d55f6e5ee0f6098746d5552 100644 --- a/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go +++ b/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewTenancyTenantsPartialUpdateParams creates a new TenancyTenantsPartialUpdateParams object diff --git a/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go b/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go index 238bdd4c3fcdf84655a2b15b3fcf90f7432f9f64..3a0ac1389ea6abfda376f1dfb3773b0a439841c5 100644 --- a/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go +++ b/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantsPartialUpdateReader is a Reader for the TenancyTenantsPartialUpdate structure. @@ -61,7 +61,7 @@ func NewTenancyTenantsPartialUpdateOK() *TenancyTenantsPartialUpdateOK { TenancyTenantsPartialUpdateOK tenancy tenants partial update o k */ type TenancyTenantsPartialUpdateOK struct { - Payload *models.WritableTenant + Payload *models.Tenant } func (o *TenancyTenantsPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *TenancyTenantsPartialUpdateOK) Error() string { func (o *TenancyTenantsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableTenant) + o.Payload = new(models.Tenant) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/tenancy/tenancy_tenants_read_parameters.go b/netbox/client/tenancy/tenancy_tenants_read_parameters.go index 51a9700d30bfe1bc8ea1e7463818ad68950394c1..e486d9c49f9fad750687cdd1443a79c90f3d7e08 100644 --- a/netbox/client/tenancy/tenancy_tenants_read_parameters.go +++ b/netbox/client/tenancy/tenancy_tenants_read_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/tenancy/tenancy_tenants_read_responses.go b/netbox/client/tenancy/tenancy_tenants_read_responses.go index 7d30c2846c8d79c5f4b15a46ff1d9e5ec87b9755..0af2d62c8b68d33e042f1059da10baa5780a69a4 100644 --- a/netbox/client/tenancy/tenancy_tenants_read_responses.go +++ b/netbox/client/tenancy/tenancy_tenants_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantsReadReader is a Reader for the TenancyTenantsRead structure. diff --git a/netbox/client/tenancy/tenancy_tenants_update_parameters.go b/netbox/client/tenancy/tenancy_tenants_update_parameters.go index a4c978e4a2a44167d23835438103063b0d950859..c2b00433a54b5ff7ecbb6899d455219ad3a8aca0 100644 --- a/netbox/client/tenancy/tenancy_tenants_update_parameters.go +++ b/netbox/client/tenancy/tenancy_tenants_update_parameters.go @@ -20,11 +20,10 @@ package tenancy // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewTenancyTenantsUpdateParams creates a new TenancyTenantsUpdateParams object diff --git a/netbox/client/tenancy/tenancy_tenants_update_responses.go b/netbox/client/tenancy/tenancy_tenants_update_responses.go index 548dbd1acf5269b79c0eec9e79c877d1d018deff..524eb1a0def860e105c9a9e16b2fb06cfe90f6be 100644 --- a/netbox/client/tenancy/tenancy_tenants_update_responses.go +++ b/netbox/client/tenancy/tenancy_tenants_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // TenancyTenantsUpdateReader is a Reader for the TenancyTenantsUpdate structure. @@ -61,7 +61,7 @@ func NewTenancyTenantsUpdateOK() *TenancyTenantsUpdateOK { TenancyTenantsUpdateOK tenancy tenants update o k */ type TenancyTenantsUpdateOK struct { - Payload *models.WritableTenant + Payload *models.Tenant } func (o *TenancyTenantsUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *TenancyTenantsUpdateOK) Error() string { func (o *TenancyTenantsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableTenant) + o.Payload = new(models.Tenant) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_choices_list_parameters.go b/netbox/client/virtualization/virtualization_choices_list_parameters.go index c16325827b28baf8ac77e3723c729a0afb43ed7f..bab362424fb981ca125dc291129f306200c3528d 100644 --- a/netbox/client/virtualization/virtualization_choices_list_parameters.go +++ b/netbox/client/virtualization/virtualization_choices_list_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_choices_read_parameters.go b/netbox/client/virtualization/virtualization_choices_read_parameters.go index 5936d9543f821cf91c8d26628dbc46236f435c0b..4c75336225a10ce33815a5910bbac26ef6dde4b6 100644 --- a/netbox/client/virtualization/virtualization_choices_read_parameters.go +++ b/netbox/client/virtualization/virtualization_choices_read_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_client.go b/netbox/client/virtualization/virtualization_client.go index b6368d4721ae3e73429bb5187a529d1e558f7c2f..4c9d6e63a256f8d2d09a91dc9b413c5600c92d8a 100644 --- a/netbox/client/virtualization/virtualization_client.go +++ b/netbox/client/virtualization/virtualization_client.go @@ -155,7 +155,7 @@ func (a *Client) VirtualizationClusterGroupsDelete(params *VirtualizationCluster } /* -VirtualizationClusterGroupsList virtualization cluster groups list API +VirtualizationClusterGroupsList Call to super to allow for caching */ func (a *Client) VirtualizationClusterGroupsList(params *VirtualizationClusterGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsListOK, error) { // TODO: Validate the params before sending @@ -213,7 +213,7 @@ func (a *Client) VirtualizationClusterGroupsPartialUpdate(params *Virtualization } /* -VirtualizationClusterGroupsRead virtualization cluster groups read API +VirtualizationClusterGroupsRead Call to super to allow for caching */ func (a *Client) VirtualizationClusterGroupsRead(params *VirtualizationClusterGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsReadOK, error) { // TODO: Validate the params before sending @@ -329,7 +329,7 @@ func (a *Client) VirtualizationClusterTypesDelete(params *VirtualizationClusterT } /* -VirtualizationClusterTypesList virtualization cluster types list API +VirtualizationClusterTypesList Call to super to allow for caching */ func (a *Client) VirtualizationClusterTypesList(params *VirtualizationClusterTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesListOK, error) { // TODO: Validate the params before sending @@ -387,7 +387,7 @@ func (a *Client) VirtualizationClusterTypesPartialUpdate(params *VirtualizationC } /* -VirtualizationClusterTypesRead virtualization cluster types read API +VirtualizationClusterTypesRead Call to super to allow for caching */ func (a *Client) VirtualizationClusterTypesRead(params *VirtualizationClusterTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesReadOK, error) { // TODO: Validate the params before sending @@ -503,7 +503,7 @@ func (a *Client) VirtualizationClustersDelete(params *VirtualizationClustersDele } /* -VirtualizationClustersList virtualization clusters list API +VirtualizationClustersList Call to super to allow for caching */ func (a *Client) VirtualizationClustersList(params *VirtualizationClustersListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersListOK, error) { // TODO: Validate the params before sending @@ -561,7 +561,7 @@ func (a *Client) VirtualizationClustersPartialUpdate(params *VirtualizationClust } /* -VirtualizationClustersRead virtualization clusters read API +VirtualizationClustersRead Call to super to allow for caching */ func (a *Client) VirtualizationClustersRead(params *VirtualizationClustersReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersReadOK, error) { // TODO: Validate the params before sending @@ -677,7 +677,7 @@ func (a *Client) VirtualizationInterfacesDelete(params *VirtualizationInterfaces } /* -VirtualizationInterfacesList virtualization interfaces list API +VirtualizationInterfacesList Call to super to allow for caching */ func (a *Client) VirtualizationInterfacesList(params *VirtualizationInterfacesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesListOK, error) { // TODO: Validate the params before sending @@ -735,7 +735,7 @@ func (a *Client) VirtualizationInterfacesPartialUpdate(params *VirtualizationInt } /* -VirtualizationInterfacesRead virtualization interfaces read API +VirtualizationInterfacesRead Call to super to allow for caching */ func (a *Client) VirtualizationInterfacesRead(params *VirtualizationInterfacesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesReadOK, error) { // TODO: Validate the params before sending @@ -851,7 +851,7 @@ func (a *Client) VirtualizationVirtualMachinesDelete(params *VirtualizationVirtu } /* -VirtualizationVirtualMachinesList virtualization virtual machines list API +VirtualizationVirtualMachinesList Call to super to allow for caching */ func (a *Client) VirtualizationVirtualMachinesList(params *VirtualizationVirtualMachinesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesListOK, error) { // TODO: Validate the params before sending @@ -909,7 +909,7 @@ func (a *Client) VirtualizationVirtualMachinesPartialUpdate(params *Virtualizati } /* -VirtualizationVirtualMachinesRead virtualization virtual machines read API +VirtualizationVirtualMachinesRead Call to super to allow for caching */ func (a *Client) VirtualizationVirtualMachinesRead(params *VirtualizationVirtualMachinesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesReadOK, error) { // TODO: Validate the params before sending diff --git a/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go index a590acf34ad8eccadf2cd0e80735f65f4bd44517..e64652ac215cedc057fe02db0e50b395f11b438c 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go @@ -20,18 +20,17 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClusterGroupsCreateParams creates a new VirtualizationClusterGroupsCreateParams object diff --git a/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go index e524dfa114bfafce5086dce3f460fe79603e4498..f6d09d507c6f482900c7e0786f02faf5efafe1b6 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterGroupsCreateReader is a Reader for the VirtualizationClusterGroupsCreate structure. diff --git a/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go index 6650a4bf234bc0440945ec65845f80061bf00b9b..70d8dfc603ce2c8b1b7ea2be30de41e7c32e8f04 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go index 69ec092fc534a91d8bfba28f962be3589c11f029..80c32cf117897d88f63f45572e270d012ee84038 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the virtualization cluster groups list operation typically these are written */ type VirtualizationClusterGroupsListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type VirtualizationClusterGroupsListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -130,6 +133,17 @@ func (o *VirtualizationClusterGroupsListParams) SetHTTPClient(client *http.Clien o.HTTPClient = client } +// WithID adds the id to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithID(id *string) *VirtualizationClusterGroupsListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the virtualization cluster groups list params func (o *VirtualizationClusterGroupsListParams) WithLimit(limit *int64) *VirtualizationClusterGroupsListParams { o.SetLimit(limit) @@ -163,6 +177,17 @@ func (o *VirtualizationClusterGroupsListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithQ(q *string) *VirtualizationClusterGroupsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the virtualization cluster groups list params func (o *VirtualizationClusterGroupsListParams) WithSlug(slug *string) *VirtualizationClusterGroupsListParams { o.SetSlug(slug) @@ -182,6 +207,22 @@ func (o *VirtualizationClusterGroupsListParams) WriteToRequest(r runtime.ClientR } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -230,6 +271,22 @@ func (o *VirtualizationClusterGroupsListParams) WriteToRequest(r runtime.ClientR } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go index d02401924fce48a1980e9d75f63fff40b9e21547..0c30f3d63a0781916e1adf76f07e63cdd44aaccf 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go @@ -22,12 +22,16 @@ package virtualization import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterGroupsListReader is a Reader for the VirtualizationClusterGroupsList structure. @@ -61,7 +65,7 @@ func NewVirtualizationClusterGroupsListOK() *VirtualizationClusterGroupsListOK { VirtualizationClusterGroupsListOK virtualization cluster groups list o k */ type VirtualizationClusterGroupsListOK struct { - Payload *models.VirtualizationClusterGroupsListOKBody + Payload *VirtualizationClusterGroupsListOKBody } func (o *VirtualizationClusterGroupsListOK) Error() string { @@ -70,7 +74,7 @@ func (o *VirtualizationClusterGroupsListOK) Error() string { func (o *VirtualizationClusterGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.VirtualizationClusterGroupsListOKBody) + o.Payload = new(VirtualizationClusterGroupsListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *VirtualizationClusterGroupsListOK) readResponse(response runtime.Client return nil } + +/*VirtualizationClusterGroupsListOKBody virtualization cluster groups list o k body +swagger:model VirtualizationClusterGroupsListOKBody +*/ +type VirtualizationClusterGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ClusterGroup `json:"results"` +} + +// Validate validates this virtualization cluster groups list o k body +func (o *VirtualizationClusterGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *VirtualizationClusterGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationClusterGroupsListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClusterGroupsListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationClusterGroupsListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClusterGroupsListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationClusterGroupsListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClusterGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationClusterGroupsListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualizationClusterGroupsListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *VirtualizationClusterGroupsListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *VirtualizationClusterGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClusterGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go index 7f83baa870c2dbb2ce9315c04f30bb35bc463e5f..2bd1341c526294546589248f8d5acf12b2b286e1 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClusterGroupsPartialUpdateParams creates a new VirtualizationClusterGroupsPartialUpdateParams object diff --git a/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go index 4056d756fa908ba83f5b685eda33f0eb4e0001c4..ed03dfd43a64f48349971b3d3e83a2686e7240a6 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterGroupsPartialUpdateReader is a Reader for the VirtualizationClusterGroupsPartialUpdate structure. diff --git a/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go index d6e2cf85f38fedf07a2c1d30b6be9168712f1b64..00d3f5b1c8e42c6002fc61b1a61137fdde832f12 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go index db0c61649ce0f4c1884581472acdccc26f8c561d..82b82039b000fb64b605d424fb9c010bb54d1cde 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterGroupsReadReader is a Reader for the VirtualizationClusterGroupsRead structure. diff --git a/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go index 607ac97ed72c99b445a2a1c0f20d8af0202f2059..aef2449fe6ed8ece869077e39d98eba5302a0121 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClusterGroupsUpdateParams creates a new VirtualizationClusterGroupsUpdateParams object diff --git a/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go index d520331395b194c1be89c501a16d2e8597db0ce6..3aef79a8284f85a161209b56753a4fdd674b1a04 100644 --- a/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterGroupsUpdateReader is a Reader for the VirtualizationClusterGroupsUpdate structure. diff --git a/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go index e235ea5aee402ca4176aa334dba723286d055517..2482b43e894e7c2ad27c86f7f5636bb9091fab75 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go @@ -20,18 +20,17 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClusterTypesCreateParams creates a new VirtualizationClusterTypesCreateParams object diff --git a/netbox/client/virtualization/virtualization_cluster_types_create_responses.go b/netbox/client/virtualization/virtualization_cluster_types_create_responses.go index 0993ab11fda9671438184a2e82dad73814b8ffad..5fc287915fb69d32b35017d4ed78c0abb303c806 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_create_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_types_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterTypesCreateReader is a Reader for the VirtualizationClusterTypesCreate structure. diff --git a/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go index 1f25901f2a742d6c79f2249bd60416ac1e3a1452..4712601f74fa86437440b34c18c13c7ee0a47d97 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go index cf4d45412227ba9a536e5b4e73543b2dc4fd963a..3ab6b43307f20dcec58b4dbbb6366ce3f33270a1 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -77,6 +76,8 @@ for the virtualization cluster types list operation typically these are written */ type VirtualizationClusterTypesListParams struct { + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -89,6 +90,8 @@ type VirtualizationClusterTypesListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*Slug*/ Slug *string @@ -130,6 +133,17 @@ func (o *VirtualizationClusterTypesListParams) SetHTTPClient(client *http.Client o.HTTPClient = client } +// WithID adds the id to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithID(id *string) *VirtualizationClusterTypesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the virtualization cluster types list params func (o *VirtualizationClusterTypesListParams) WithLimit(limit *int64) *VirtualizationClusterTypesListParams { o.SetLimit(limit) @@ -163,6 +177,17 @@ func (o *VirtualizationClusterTypesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithQ(q *string) *VirtualizationClusterTypesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetQ(q *string) { + o.Q = q +} + // WithSlug adds the slug to the virtualization cluster types list params func (o *VirtualizationClusterTypesListParams) WithSlug(slug *string) *VirtualizationClusterTypesListParams { o.SetSlug(slug) @@ -182,6 +207,22 @@ func (o *VirtualizationClusterTypesListParams) WriteToRequest(r runtime.ClientRe } var res []error + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -230,6 +271,22 @@ func (o *VirtualizationClusterTypesListParams) WriteToRequest(r runtime.ClientRe } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.Slug != nil { // query param slug diff --git a/netbox/client/virtualization/virtualization_cluster_types_list_responses.go b/netbox/client/virtualization/virtualization_cluster_types_list_responses.go index 71e144895ca97c1a07f4d3def97d576c1ca7504b..9be4a121171ade8c23dac6623b3cdb1da52a9020 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_list_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_types_list_responses.go @@ -22,12 +22,16 @@ package virtualization import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterTypesListReader is a Reader for the VirtualizationClusterTypesList structure. @@ -61,7 +65,7 @@ func NewVirtualizationClusterTypesListOK() *VirtualizationClusterTypesListOK { VirtualizationClusterTypesListOK virtualization cluster types list o k */ type VirtualizationClusterTypesListOK struct { - Payload *models.VirtualizationClusterTypesListOKBody + Payload *VirtualizationClusterTypesListOKBody } func (o *VirtualizationClusterTypesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *VirtualizationClusterTypesListOK) Error() string { func (o *VirtualizationClusterTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.VirtualizationClusterTypesListOKBody) + o.Payload = new(VirtualizationClusterTypesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *VirtualizationClusterTypesListOK) readResponse(response runtime.ClientR return nil } + +/*VirtualizationClusterTypesListOKBody virtualization cluster types list o k body +swagger:model VirtualizationClusterTypesListOKBody +*/ +type VirtualizationClusterTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.ClusterType `json:"results"` +} + +// Validate validates this virtualization cluster types list o k body +func (o *VirtualizationClusterTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *VirtualizationClusterTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationClusterTypesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClusterTypesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationClusterTypesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClusterTypesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationClusterTypesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClusterTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationClusterTypesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualizationClusterTypesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *VirtualizationClusterTypesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *VirtualizationClusterTypesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClusterTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go index 5ed9188df70f86d50701c7a74435910241a09c7c..2d19fdccd3801521e29f3d08b5ab388a05c04317 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClusterTypesPartialUpdateParams creates a new VirtualizationClusterTypesPartialUpdateParams object diff --git a/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go b/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go index 433095bf6613183567b6a76a647a0e522a6cd265..b3642167b95f5d42b549b20c28aaea25124ba426 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterTypesPartialUpdateReader is a Reader for the VirtualizationClusterTypesPartialUpdate structure. diff --git a/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go index e8813a7074e11f1bdbe04debee06b43846554367..8033b3fe1039b2137605f5ab9d6d379deef0e92f 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_cluster_types_read_responses.go b/netbox/client/virtualization/virtualization_cluster_types_read_responses.go index 0b76a2a02fe3c34b89fec1ee69edb5e1ec5e7a14..39ee1e3a77aa67ede89eaa3ab3d7354fc838c325 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_read_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_types_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterTypesReadReader is a Reader for the VirtualizationClusterTypesRead structure. diff --git a/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go index 3c610e48423802dac9a393ecba802357ff058a16..ff2b081e7ce2d1684b7008c97864ffb481426104 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go +++ b/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClusterTypesUpdateParams creates a new VirtualizationClusterTypesUpdateParams object diff --git a/netbox/client/virtualization/virtualization_cluster_types_update_responses.go b/netbox/client/virtualization/virtualization_cluster_types_update_responses.go index 30ec8b23cd4855c4f045b3bebaecd396e69232f1..54c99edfc390f3bee27700b06cf533ec65e33387 100644 --- a/netbox/client/virtualization/virtualization_cluster_types_update_responses.go +++ b/netbox/client/virtualization/virtualization_cluster_types_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClusterTypesUpdateReader is a Reader for the VirtualizationClusterTypesUpdate structure. diff --git a/netbox/client/virtualization/virtualization_clusters_create_parameters.go b/netbox/client/virtualization/virtualization_clusters_create_parameters.go index 4bada449340fbf6147da9c56918fadc1c9feaddc..649ffb5372321aa1cd0e91f39343dba76de59a69 100644 --- a/netbox/client/virtualization/virtualization_clusters_create_parameters.go +++ b/netbox/client/virtualization/virtualization_clusters_create_parameters.go @@ -20,18 +20,17 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClustersCreateParams creates a new VirtualizationClustersCreateParams object diff --git a/netbox/client/virtualization/virtualization_clusters_create_responses.go b/netbox/client/virtualization/virtualization_clusters_create_responses.go index c53ceacff8200bd7dc422766db35de84e16d1ae1..6867b7e930545a3e0ec3e0b5024025ec7f7bd913 100644 --- a/netbox/client/virtualization/virtualization_clusters_create_responses.go +++ b/netbox/client/virtualization/virtualization_clusters_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClustersCreateReader is a Reader for the VirtualizationClustersCreate structure. @@ -61,7 +61,7 @@ func NewVirtualizationClustersCreateCreated() *VirtualizationClustersCreateCreat VirtualizationClustersCreateCreated virtualization clusters create created */ type VirtualizationClustersCreateCreated struct { - Payload *models.WritableCluster + Payload *models.Cluster } func (o *VirtualizationClustersCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationClustersCreateCreated) Error() string { func (o *VirtualizationClustersCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCluster) + o.Payload = new(models.Cluster) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_clusters_delete_parameters.go b/netbox/client/virtualization/virtualization_clusters_delete_parameters.go index 50dac184a6e703941d72f6703311bca5b799ebdd..f3893ee268c213a217fc81f68f36a43d4e9d65e8 100644 --- a/netbox/client/virtualization/virtualization_clusters_delete_parameters.go +++ b/netbox/client/virtualization/virtualization_clusters_delete_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_clusters_list_parameters.go b/netbox/client/virtualization/virtualization_clusters_list_parameters.go index c1fd970dd2fcb54a99e8d97e1e63776d6ecaed6b..6ec75e20027414f647a09468e666ca3a67f6d979 100644 --- a/netbox/client/virtualization/virtualization_clusters_list_parameters.go +++ b/netbox/client/virtualization/virtualization_clusters_list_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -104,6 +103,8 @@ type VirtualizationClustersListParams struct { Site *string /*SiteID*/ SiteID *string + /*Tag*/ + Tag *string /*Type*/ Type *string /*TypeID*/ @@ -246,6 +247,17 @@ func (o *VirtualizationClustersListParams) SetSiteID(siteID *string) { o.SiteID = siteID } +// WithTag adds the tag to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithTag(tag *string) *VirtualizationClustersListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithType adds the typeVar to the virtualization clusters list params func (o *VirtualizationClustersListParams) WithType(typeVar *string) *VirtualizationClustersListParams { o.SetType(typeVar) @@ -420,6 +432,22 @@ func (o *VirtualizationClustersListParams) WriteToRequest(r runtime.ClientReques } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Type != nil { // query param type diff --git a/netbox/client/virtualization/virtualization_clusters_list_responses.go b/netbox/client/virtualization/virtualization_clusters_list_responses.go index c61053f24812d4e223ddd42d76209964ef436f2e..084d71dfdd9e62e1b3812acdb8e15aa2e9672f25 100644 --- a/netbox/client/virtualization/virtualization_clusters_list_responses.go +++ b/netbox/client/virtualization/virtualization_clusters_list_responses.go @@ -22,12 +22,16 @@ package virtualization import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClustersListReader is a Reader for the VirtualizationClustersList structure. @@ -61,7 +65,7 @@ func NewVirtualizationClustersListOK() *VirtualizationClustersListOK { VirtualizationClustersListOK virtualization clusters list o k */ type VirtualizationClustersListOK struct { - Payload *models.VirtualizationClustersListOKBody + Payload *VirtualizationClustersListOKBody } func (o *VirtualizationClustersListOK) Error() string { @@ -70,7 +74,7 @@ func (o *VirtualizationClustersListOK) Error() string { func (o *VirtualizationClustersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.VirtualizationClustersListOKBody) + o.Payload = new(VirtualizationClustersListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *VirtualizationClustersListOK) readResponse(response runtime.ClientRespo return nil } + +/*VirtualizationClustersListOKBody virtualization clusters list o k body +swagger:model VirtualizationClustersListOKBody +*/ +type VirtualizationClustersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.Cluster `json:"results"` +} + +// Validate validates this virtualization clusters list o k body +func (o *VirtualizationClustersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *VirtualizationClustersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationClustersListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClustersListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationClustersListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClustersListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationClustersListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationClustersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationClustersListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualizationClustersListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *VirtualizationClustersListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *VirtualizationClustersListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClustersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go b/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go index 1d9a3a822aba6890de3c7f8c1914dd7cd9f9ffcc..43cabb3137cc7b2e2333473df7dff88212484789 100644 --- a/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go +++ b/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClustersPartialUpdateParams creates a new VirtualizationClustersPartialUpdateParams object diff --git a/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go b/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go index 8539f287f15bd9a0c454395cb057a2007ccb113b..1c0fa24b5d86de62c529a4a10f31fd9df4770d64 100644 --- a/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go +++ b/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClustersPartialUpdateReader is a Reader for the VirtualizationClustersPartialUpdate structure. @@ -61,7 +61,7 @@ func NewVirtualizationClustersPartialUpdateOK() *VirtualizationClustersPartialUp VirtualizationClustersPartialUpdateOK virtualization clusters partial update o k */ type VirtualizationClustersPartialUpdateOK struct { - Payload *models.WritableCluster + Payload *models.Cluster } func (o *VirtualizationClustersPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationClustersPartialUpdateOK) Error() string { func (o *VirtualizationClustersPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCluster) + o.Payload = new(models.Cluster) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_clusters_read_parameters.go b/netbox/client/virtualization/virtualization_clusters_read_parameters.go index 65f3a01ce35f0e49df1121cd1bdd9cfd8a75da03..013856cac85c6003128940eb44497796924f0652 100644 --- a/netbox/client/virtualization/virtualization_clusters_read_parameters.go +++ b/netbox/client/virtualization/virtualization_clusters_read_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_clusters_read_responses.go b/netbox/client/virtualization/virtualization_clusters_read_responses.go index b309b873aefe8c791ae30d92038c75fd1820a75e..42002d34a058eef65e879cd2d83ba154e4ebaabd 100644 --- a/netbox/client/virtualization/virtualization_clusters_read_responses.go +++ b/netbox/client/virtualization/virtualization_clusters_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClustersReadReader is a Reader for the VirtualizationClustersRead structure. diff --git a/netbox/client/virtualization/virtualization_clusters_update_parameters.go b/netbox/client/virtualization/virtualization_clusters_update_parameters.go index 484c4bdbf6d5c599526e2eb9b8acf8ea61512a0d..5029c38d5c1d2ef8143e901853fea0865e3cfc57 100644 --- a/netbox/client/virtualization/virtualization_clusters_update_parameters.go +++ b/netbox/client/virtualization/virtualization_clusters_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationClustersUpdateParams creates a new VirtualizationClustersUpdateParams object diff --git a/netbox/client/virtualization/virtualization_clusters_update_responses.go b/netbox/client/virtualization/virtualization_clusters_update_responses.go index 3e969dbc419402256e19a0d511f92cb917c281d5..502414b835149c56f144ed8e645676ae068caf3b 100644 --- a/netbox/client/virtualization/virtualization_clusters_update_responses.go +++ b/netbox/client/virtualization/virtualization_clusters_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationClustersUpdateReader is a Reader for the VirtualizationClustersUpdate structure. @@ -61,7 +61,7 @@ func NewVirtualizationClustersUpdateOK() *VirtualizationClustersUpdateOK { VirtualizationClustersUpdateOK virtualization clusters update o k */ type VirtualizationClustersUpdateOK struct { - Payload *models.WritableCluster + Payload *models.Cluster } func (o *VirtualizationClustersUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationClustersUpdateOK) Error() string { func (o *VirtualizationClustersUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableCluster) + o.Payload = new(models.Cluster) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_interfaces_create_parameters.go b/netbox/client/virtualization/virtualization_interfaces_create_parameters.go index 1d3cb0cc91b64afed97b8d35bbba7ebe80246a5a..5b146e66076b7ba239a326f704fd7ed4ebfed7b3 100644 --- a/netbox/client/virtualization/virtualization_interfaces_create_parameters.go +++ b/netbox/client/virtualization/virtualization_interfaces_create_parameters.go @@ -20,18 +20,17 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationInterfacesCreateParams creates a new VirtualizationInterfacesCreateParams object @@ -79,7 +78,7 @@ for the virtualization interfaces create operation typically these are written t type VirtualizationInterfacesCreateParams struct { /*Data*/ - Data *models.WritableInterface + Data *models.WritableVirtualMachineInterface timeout time.Duration Context context.Context @@ -120,13 +119,13 @@ func (o *VirtualizationInterfacesCreateParams) SetHTTPClient(client *http.Client } // WithData adds the data to the virtualization interfaces create params -func (o *VirtualizationInterfacesCreateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesCreateParams { +func (o *VirtualizationInterfacesCreateParams) WithData(data *models.WritableVirtualMachineInterface) *VirtualizationInterfacesCreateParams { o.SetData(data) return o } // SetData adds the data to the virtualization interfaces create params -func (o *VirtualizationInterfacesCreateParams) SetData(data *models.WritableInterface) { +func (o *VirtualizationInterfacesCreateParams) SetData(data *models.WritableVirtualMachineInterface) { o.Data = data } diff --git a/netbox/client/virtualization/virtualization_interfaces_create_responses.go b/netbox/client/virtualization/virtualization_interfaces_create_responses.go index 4aed325ebf7cfdf12268410f55f2f5305eecf7b4..57f32fd9b9ae3dc5137899f8cd0105cbbf3065b4 100644 --- a/netbox/client/virtualization/virtualization_interfaces_create_responses.go +++ b/netbox/client/virtualization/virtualization_interfaces_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationInterfacesCreateReader is a Reader for the VirtualizationInterfacesCreate structure. @@ -61,7 +61,7 @@ func NewVirtualizationInterfacesCreateCreated() *VirtualizationInterfacesCreateC VirtualizationInterfacesCreateCreated virtualization interfaces create created */ type VirtualizationInterfacesCreateCreated struct { - Payload *models.WritableInterface + Payload *models.VirtualMachineInterface } func (o *VirtualizationInterfacesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationInterfacesCreateCreated) Error() string { func (o *VirtualizationInterfacesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterface) + o.Payload = new(models.VirtualMachineInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go b/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go index b8b98616ae41a06f4ee1d6cedd669609b25cd50d..713d9090069578d97df9122c5132d2b1cacefa7f 100644 --- a/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go +++ b/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_interfaces_list_parameters.go b/netbox/client/virtualization/virtualization_interfaces_list_parameters.go index 3f0b7169f94b99f4b4c5cd1d0e5d858b209c23ce..fe6259483e8d9a34e23db07bf07cd7644cf003f4 100644 --- a/netbox/client/virtualization/virtualization_interfaces_list_parameters.go +++ b/netbox/client/virtualization/virtualization_interfaces_list_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -79,6 +78,8 @@ type VirtualizationInterfacesListParams struct { /*Enabled*/ Enabled *string + /*ID*/ + ID *string /*Limit Number of results to return per page. @@ -87,7 +88,7 @@ type VirtualizationInterfacesListParams struct { /*MacAddress*/ MacAddress *string /*Mtu*/ - Mtu *float64 + Mtu *string /*Name*/ Name *string /*Offset @@ -95,6 +96,8 @@ type VirtualizationInterfacesListParams struct { */ Offset *int64 + /*Q*/ + Q *string /*VirtualMachine*/ VirtualMachine *string /*VirtualMachineID*/ @@ -149,6 +152,17 @@ func (o *VirtualizationInterfacesListParams) SetEnabled(enabled *string) { o.Enabled = enabled } +// WithID adds the id to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithID(id *string) *VirtualizationInterfacesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetID(id *string) { + o.ID = id +} + // WithLimit adds the limit to the virtualization interfaces list params func (o *VirtualizationInterfacesListParams) WithLimit(limit *int64) *VirtualizationInterfacesListParams { o.SetLimit(limit) @@ -172,13 +186,13 @@ func (o *VirtualizationInterfacesListParams) SetMacAddress(macAddress *string) { } // WithMtu adds the mtu to the virtualization interfaces list params -func (o *VirtualizationInterfacesListParams) WithMtu(mtu *float64) *VirtualizationInterfacesListParams { +func (o *VirtualizationInterfacesListParams) WithMtu(mtu *string) *VirtualizationInterfacesListParams { o.SetMtu(mtu) return o } // SetMtu adds the mtu to the virtualization interfaces list params -func (o *VirtualizationInterfacesListParams) SetMtu(mtu *float64) { +func (o *VirtualizationInterfacesListParams) SetMtu(mtu *string) { o.Mtu = mtu } @@ -204,6 +218,17 @@ func (o *VirtualizationInterfacesListParams) SetOffset(offset *int64) { o.Offset = offset } +// WithQ adds the q to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithQ(q *string) *VirtualizationInterfacesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetQ(q *string) { + o.Q = q +} + // WithVirtualMachine adds the virtualMachine to the virtualization interfaces list params func (o *VirtualizationInterfacesListParams) WithVirtualMachine(virtualMachine *string) *VirtualizationInterfacesListParams { o.SetVirtualMachine(virtualMachine) @@ -250,6 +275,22 @@ func (o *VirtualizationInterfacesListParams) WriteToRequest(r runtime.ClientRequ } + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.Limit != nil { // query param limit @@ -285,11 +326,11 @@ func (o *VirtualizationInterfacesListParams) WriteToRequest(r runtime.ClientRequ if o.Mtu != nil { // query param mtu - var qrMtu float64 + var qrMtu string if o.Mtu != nil { qrMtu = *o.Mtu } - qMtu := swag.FormatFloat64(qrMtu) + qMtu := qrMtu if qMtu != "" { if err := r.SetQueryParam("mtu", qMtu); err != nil { return err @@ -330,6 +371,22 @@ func (o *VirtualizationInterfacesListParams) WriteToRequest(r runtime.ClientRequ } + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + if o.VirtualMachine != nil { // query param virtual_machine diff --git a/netbox/client/virtualization/virtualization_interfaces_list_responses.go b/netbox/client/virtualization/virtualization_interfaces_list_responses.go index 5746fc3107bb372c07b7fd618d10b44554a6e929..873534e253060120946f686abd6869a0341e4175 100644 --- a/netbox/client/virtualization/virtualization_interfaces_list_responses.go +++ b/netbox/client/virtualization/virtualization_interfaces_list_responses.go @@ -22,12 +22,16 @@ package virtualization import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationInterfacesListReader is a Reader for the VirtualizationInterfacesList structure. @@ -61,7 +65,7 @@ func NewVirtualizationInterfacesListOK() *VirtualizationInterfacesListOK { VirtualizationInterfacesListOK virtualization interfaces list o k */ type VirtualizationInterfacesListOK struct { - Payload *models.VirtualizationInterfacesListOKBody + Payload *VirtualizationInterfacesListOKBody } func (o *VirtualizationInterfacesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *VirtualizationInterfacesListOK) Error() string { func (o *VirtualizationInterfacesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.VirtualizationInterfacesListOKBody) + o.Payload = new(VirtualizationInterfacesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *VirtualizationInterfacesListOK) readResponse(response runtime.ClientRes return nil } + +/*VirtualizationInterfacesListOKBody virtualization interfaces list o k body +swagger:model VirtualizationInterfacesListOKBody +*/ +type VirtualizationInterfacesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.VirtualMachineInterface `json:"results"` +} + +// Validate validates this virtualization interfaces list o k body +func (o *VirtualizationInterfacesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *VirtualizationInterfacesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationInterfacesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationInterfacesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationInterfacesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationInterfacesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationInterfacesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationInterfacesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationInterfacesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualizationInterfacesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *VirtualizationInterfacesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *VirtualizationInterfacesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationInterfacesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go b/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go index 20ca38e40bdf618c4edd2a6633414e30356230c8..8bf02bff7a250fc64751e15e6fd1284f922ca434 100644 --- a/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go +++ b/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationInterfacesPartialUpdateParams creates a new VirtualizationInterfacesPartialUpdateParams object @@ -80,7 +79,7 @@ for the virtualization interfaces partial update operation typically these are w type VirtualizationInterfacesPartialUpdateParams struct { /*Data*/ - Data *models.WritableInterface + Data *models.WritableVirtualMachineInterface /*ID A unique integer value identifying this interface. @@ -126,13 +125,13 @@ func (o *VirtualizationInterfacesPartialUpdateParams) SetHTTPClient(client *http } // WithData adds the data to the virtualization interfaces partial update params -func (o *VirtualizationInterfacesPartialUpdateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesPartialUpdateParams { +func (o *VirtualizationInterfacesPartialUpdateParams) WithData(data *models.WritableVirtualMachineInterface) *VirtualizationInterfacesPartialUpdateParams { o.SetData(data) return o } // SetData adds the data to the virtualization interfaces partial update params -func (o *VirtualizationInterfacesPartialUpdateParams) SetData(data *models.WritableInterface) { +func (o *VirtualizationInterfacesPartialUpdateParams) SetData(data *models.WritableVirtualMachineInterface) { o.Data = data } diff --git a/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go b/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go index 4d3c73e557590804ed37a79108fd271aba300594..492b592e795f85c8964ad24502a7e982b58a4a02 100644 --- a/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go +++ b/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationInterfacesPartialUpdateReader is a Reader for the VirtualizationInterfacesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewVirtualizationInterfacesPartialUpdateOK() *VirtualizationInterfacesParti VirtualizationInterfacesPartialUpdateOK virtualization interfaces partial update o k */ type VirtualizationInterfacesPartialUpdateOK struct { - Payload *models.WritableInterface + Payload *models.VirtualMachineInterface } func (o *VirtualizationInterfacesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationInterfacesPartialUpdateOK) Error() string { func (o *VirtualizationInterfacesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterface) + o.Payload = new(models.VirtualMachineInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_interfaces_read_parameters.go b/netbox/client/virtualization/virtualization_interfaces_read_parameters.go index 40dc3d73613f1c077a798985670e17ad781da246..affef126a116e02cc8309eb327058dba0c11b31b 100644 --- a/netbox/client/virtualization/virtualization_interfaces_read_parameters.go +++ b/netbox/client/virtualization/virtualization_interfaces_read_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_interfaces_read_responses.go b/netbox/client/virtualization/virtualization_interfaces_read_responses.go index 3201e073873957439cee755a99073e8e35567a69..aabb213c4e5039b43f1261c8f61ce234acefa413 100644 --- a/netbox/client/virtualization/virtualization_interfaces_read_responses.go +++ b/netbox/client/virtualization/virtualization_interfaces_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationInterfacesReadReader is a Reader for the VirtualizationInterfacesRead structure. @@ -61,7 +61,7 @@ func NewVirtualizationInterfacesReadOK() *VirtualizationInterfacesReadOK { VirtualizationInterfacesReadOK virtualization interfaces read o k */ type VirtualizationInterfacesReadOK struct { - Payload *models.Interface + Payload *models.VirtualMachineInterface } func (o *VirtualizationInterfacesReadOK) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationInterfacesReadOK) Error() string { func (o *VirtualizationInterfacesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Interface) + o.Payload = new(models.VirtualMachineInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_interfaces_update_parameters.go b/netbox/client/virtualization/virtualization_interfaces_update_parameters.go index f9010f1f3d70d2b189e17a675fa7bcd187778df3..25df0988ee2ae011f12d33e72286487c83a71405 100644 --- a/netbox/client/virtualization/virtualization_interfaces_update_parameters.go +++ b/netbox/client/virtualization/virtualization_interfaces_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationInterfacesUpdateParams creates a new VirtualizationInterfacesUpdateParams object @@ -80,7 +79,7 @@ for the virtualization interfaces update operation typically these are written t type VirtualizationInterfacesUpdateParams struct { /*Data*/ - Data *models.WritableInterface + Data *models.WritableVirtualMachineInterface /*ID A unique integer value identifying this interface. @@ -126,13 +125,13 @@ func (o *VirtualizationInterfacesUpdateParams) SetHTTPClient(client *http.Client } // WithData adds the data to the virtualization interfaces update params -func (o *VirtualizationInterfacesUpdateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesUpdateParams { +func (o *VirtualizationInterfacesUpdateParams) WithData(data *models.WritableVirtualMachineInterface) *VirtualizationInterfacesUpdateParams { o.SetData(data) return o } // SetData adds the data to the virtualization interfaces update params -func (o *VirtualizationInterfacesUpdateParams) SetData(data *models.WritableInterface) { +func (o *VirtualizationInterfacesUpdateParams) SetData(data *models.WritableVirtualMachineInterface) { o.Data = data } diff --git a/netbox/client/virtualization/virtualization_interfaces_update_responses.go b/netbox/client/virtualization/virtualization_interfaces_update_responses.go index 09f56f4ddbbb09061d4002a9c4307e7fc328ad9d..c224f4a93b68faf18a2bdee4c728839b2b65daa0 100644 --- a/netbox/client/virtualization/virtualization_interfaces_update_responses.go +++ b/netbox/client/virtualization/virtualization_interfaces_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationInterfacesUpdateReader is a Reader for the VirtualizationInterfacesUpdate structure. @@ -61,7 +61,7 @@ func NewVirtualizationInterfacesUpdateOK() *VirtualizationInterfacesUpdateOK { VirtualizationInterfacesUpdateOK virtualization interfaces update o k */ type VirtualizationInterfacesUpdateOK struct { - Payload *models.WritableInterface + Payload *models.VirtualMachineInterface } func (o *VirtualizationInterfacesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationInterfacesUpdateOK) Error() string { func (o *VirtualizationInterfacesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableInterface) + o.Payload = new(models.VirtualMachineInterface) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go index 18ca35da73b21688ef2df1c369ce9a2fafdeaa6f..ae85f49c1884dcb415dbeef25e3b92923b5b1f8e 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go @@ -20,18 +20,17 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationVirtualMachinesCreateParams creates a new VirtualizationVirtualMachinesCreateParams object @@ -79,7 +78,7 @@ for the virtualization virtual machines create operation typically these are wri type VirtualizationVirtualMachinesCreateParams struct { /*Data*/ - Data *models.WritableVirtualMachine + Data *models.WritableVirtualMachineWithConfigContext timeout time.Duration Context context.Context @@ -120,13 +119,13 @@ func (o *VirtualizationVirtualMachinesCreateParams) SetHTTPClient(client *http.C } // WithData adds the data to the virtualization virtual machines create params -func (o *VirtualizationVirtualMachinesCreateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesCreateParams { +func (o *VirtualizationVirtualMachinesCreateParams) WithData(data *models.WritableVirtualMachineWithConfigContext) *VirtualizationVirtualMachinesCreateParams { o.SetData(data) return o } // SetData adds the data to the virtualization virtual machines create params -func (o *VirtualizationVirtualMachinesCreateParams) SetData(data *models.WritableVirtualMachine) { +func (o *VirtualizationVirtualMachinesCreateParams) SetData(data *models.WritableVirtualMachineWithConfigContext) { o.Data = data } diff --git a/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go index 2098b992e83a765c53c38aafde02c35c2ddf5f10..d104796a09ffa0a776825be47e60cad482446aca 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationVirtualMachinesCreateReader is a Reader for the VirtualizationVirtualMachinesCreate structure. @@ -61,7 +61,7 @@ func NewVirtualizationVirtualMachinesCreateCreated() *VirtualizationVirtualMachi VirtualizationVirtualMachinesCreateCreated virtualization virtual machines create created */ type VirtualizationVirtualMachinesCreateCreated struct { - Payload *models.WritableVirtualMachine + Payload *models.VirtualMachineWithConfigContext } func (o *VirtualizationVirtualMachinesCreateCreated) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationVirtualMachinesCreateCreated) Error() string { func (o *VirtualizationVirtualMachinesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVirtualMachine) + o.Payload = new(models.VirtualMachineWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go index b8bb7cadd7751a13dfe02d7e0c3c5ebd4109c577..f8ea607baed989f699c79b71a6b2878f8d884135 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go index 7330761bd70fb970f9ce238079ac7bbc4251c944..8b0235aa325ee24047887c1f77b77d9093c48e43 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -89,6 +88,10 @@ type VirtualizationVirtualMachinesListParams struct { ClusterType *string /*ClusterTypeID*/ ClusterTypeID *string + /*Disk*/ + Disk *string + /*ID*/ + ID *string /*IDIn Multiple values may be separated by commas. @@ -99,6 +102,8 @@ type VirtualizationVirtualMachinesListParams struct { */ Limit *int64 + /*Memory*/ + Memory *string /*Name*/ Name *string /*Offset @@ -112,6 +117,10 @@ type VirtualizationVirtualMachinesListParams struct { PlatformID *string /*Q*/ Q *string + /*Region*/ + Region *string + /*RegionID*/ + RegionID *string /*Role*/ Role *string /*RoleID*/ @@ -122,10 +131,18 @@ type VirtualizationVirtualMachinesListParams struct { SiteID *string /*Status*/ Status *string + /*Tag*/ + Tag *string /*Tenant*/ Tenant *string + /*TenantGroup*/ + TenantGroup *string + /*TenantGroupID*/ + TenantGroupID *string /*TenantID*/ TenantID *string + /*Vcpus*/ + Vcpus *string timeout time.Duration Context context.Context @@ -231,6 +248,28 @@ func (o *VirtualizationVirtualMachinesListParams) SetClusterTypeID(clusterTypeID o.ClusterTypeID = clusterTypeID } +// WithDisk adds the disk to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithDisk(disk *string) *VirtualizationVirtualMachinesListParams { + o.SetDisk(disk) + return o +} + +// SetDisk adds the disk to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetDisk(disk *string) { + o.Disk = disk +} + +// WithID adds the id to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithID(id *string) *VirtualizationVirtualMachinesListParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetID(id *string) { + o.ID = id +} + // WithIDIn adds the iDIn to the virtualization virtual machines list params func (o *VirtualizationVirtualMachinesListParams) WithIDIn(iDIn *string) *VirtualizationVirtualMachinesListParams { o.SetIDIn(iDIn) @@ -253,6 +292,17 @@ func (o *VirtualizationVirtualMachinesListParams) SetLimit(limit *int64) { o.Limit = limit } +// WithMemory adds the memory to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithMemory(memory *string) *VirtualizationVirtualMachinesListParams { + o.SetMemory(memory) + return o +} + +// SetMemory adds the memory to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetMemory(memory *string) { + o.Memory = memory +} + // WithName adds the name to the virtualization virtual machines list params func (o *VirtualizationVirtualMachinesListParams) WithName(name *string) *VirtualizationVirtualMachinesListParams { o.SetName(name) @@ -308,6 +358,28 @@ func (o *VirtualizationVirtualMachinesListParams) SetQ(q *string) { o.Q = q } +// WithRegion adds the region to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithRegion(region *string) *VirtualizationVirtualMachinesListParams { + o.SetRegion(region) + return o +} + +// SetRegion adds the region to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetRegion(region *string) { + o.Region = region +} + +// WithRegionID adds the regionID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithRegionID(regionID *string) *VirtualizationVirtualMachinesListParams { + o.SetRegionID(regionID) + return o +} + +// SetRegionID adds the regionId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetRegionID(regionID *string) { + o.RegionID = regionID +} + // WithRole adds the role to the virtualization virtual machines list params func (o *VirtualizationVirtualMachinesListParams) WithRole(role *string) *VirtualizationVirtualMachinesListParams { o.SetRole(role) @@ -363,6 +435,17 @@ func (o *VirtualizationVirtualMachinesListParams) SetStatus(status *string) { o.Status = status } +// WithTag adds the tag to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTag(tag *string) *VirtualizationVirtualMachinesListParams { + o.SetTag(tag) + return o +} + +// SetTag adds the tag to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTag(tag *string) { + o.Tag = tag +} + // WithTenant adds the tenant to the virtualization virtual machines list params func (o *VirtualizationVirtualMachinesListParams) WithTenant(tenant *string) *VirtualizationVirtualMachinesListParams { o.SetTenant(tenant) @@ -374,6 +457,28 @@ func (o *VirtualizationVirtualMachinesListParams) SetTenant(tenant *string) { o.Tenant = tenant } +// WithTenantGroup adds the tenantGroup to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTenantGroup(tenantGroup *string) *VirtualizationVirtualMachinesListParams { + o.SetTenantGroup(tenantGroup) + return o +} + +// SetTenantGroup adds the tenantGroup to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTenantGroup(tenantGroup *string) { + o.TenantGroup = tenantGroup +} + +// WithTenantGroupID adds the tenantGroupID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTenantGroupID(tenantGroupID *string) *VirtualizationVirtualMachinesListParams { + o.SetTenantGroupID(tenantGroupID) + return o +} + +// SetTenantGroupID adds the tenantGroupId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTenantGroupID(tenantGroupID *string) { + o.TenantGroupID = tenantGroupID +} + // WithTenantID adds the tenantID to the virtualization virtual machines list params func (o *VirtualizationVirtualMachinesListParams) WithTenantID(tenantID *string) *VirtualizationVirtualMachinesListParams { o.SetTenantID(tenantID) @@ -385,6 +490,17 @@ func (o *VirtualizationVirtualMachinesListParams) SetTenantID(tenantID *string) o.TenantID = tenantID } +// WithVcpus adds the vcpus to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithVcpus(vcpus *string) *VirtualizationVirtualMachinesListParams { + o.SetVcpus(vcpus) + return o +} + +// SetVcpus adds the vcpus to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetVcpus(vcpus *string) { + o.Vcpus = vcpus +} + // WriteToRequest writes these params to a swagger request func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -489,6 +605,38 @@ func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.Clien } + if o.Disk != nil { + + // query param disk + var qrDisk string + if o.Disk != nil { + qrDisk = *o.Disk + } + qDisk := qrDisk + if qDisk != "" { + if err := r.SetQueryParam("disk", qDisk); err != nil { + return err + } + } + + } + + if o.ID != nil { + + // query param id + var qrID string + if o.ID != nil { + qrID = *o.ID + } + qID := qrID + if qID != "" { + if err := r.SetQueryParam("id", qID); err != nil { + return err + } + } + + } + if o.IDIn != nil { // query param id__in @@ -521,6 +669,22 @@ func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.Clien } + if o.Memory != nil { + + // query param memory + var qrMemory string + if o.Memory != nil { + qrMemory = *o.Memory + } + qMemory := qrMemory + if qMemory != "" { + if err := r.SetQueryParam("memory", qMemory); err != nil { + return err + } + } + + } + if o.Name != nil { // query param name @@ -601,6 +765,38 @@ func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.Clien } + if o.Region != nil { + + // query param region + var qrRegion string + if o.Region != nil { + qrRegion = *o.Region + } + qRegion := qrRegion + if qRegion != "" { + if err := r.SetQueryParam("region", qRegion); err != nil { + return err + } + } + + } + + if o.RegionID != nil { + + // query param region_id + var qrRegionID string + if o.RegionID != nil { + qrRegionID = *o.RegionID + } + qRegionID := qrRegionID + if qRegionID != "" { + if err := r.SetQueryParam("region_id", qRegionID); err != nil { + return err + } + } + + } + if o.Role != nil { // query param role @@ -681,6 +877,22 @@ func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.Clien } + if o.Tag != nil { + + // query param tag + var qrTag string + if o.Tag != nil { + qrTag = *o.Tag + } + qTag := qrTag + if qTag != "" { + if err := r.SetQueryParam("tag", qTag); err != nil { + return err + } + } + + } + if o.Tenant != nil { // query param tenant @@ -697,6 +909,38 @@ func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.Clien } + if o.TenantGroup != nil { + + // query param tenant_group + var qrTenantGroup string + if o.TenantGroup != nil { + qrTenantGroup = *o.TenantGroup + } + qTenantGroup := qrTenantGroup + if qTenantGroup != "" { + if err := r.SetQueryParam("tenant_group", qTenantGroup); err != nil { + return err + } + } + + } + + if o.TenantGroupID != nil { + + // query param tenant_group_id + var qrTenantGroupID string + if o.TenantGroupID != nil { + qrTenantGroupID = *o.TenantGroupID + } + qTenantGroupID := qrTenantGroupID + if qTenantGroupID != "" { + if err := r.SetQueryParam("tenant_group_id", qTenantGroupID); err != nil { + return err + } + } + + } + if o.TenantID != nil { // query param tenant_id @@ -713,6 +957,22 @@ func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.Clien } + if o.Vcpus != nil { + + // query param vcpus + var qrVcpus string + if o.Vcpus != nil { + qrVcpus = *o.Vcpus + } + qVcpus := qrVcpus + if qVcpus != "" { + if err := r.SetQueryParam("vcpus", qVcpus); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go index c1793ec030259a8ba64a2cc7d3a69e2bac719f4a..6bcf346525f2bb4082f46e48c8df23977cd3793a 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go @@ -22,12 +22,16 @@ package virtualization import ( "fmt" "io" + "strconv" + "github.com/go-openapi/errors" "github.com/go-openapi/runtime" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationVirtualMachinesListReader is a Reader for the VirtualizationVirtualMachinesList structure. @@ -61,7 +65,7 @@ func NewVirtualizationVirtualMachinesListOK() *VirtualizationVirtualMachinesList VirtualizationVirtualMachinesListOK virtualization virtual machines list o k */ type VirtualizationVirtualMachinesListOK struct { - Payload *models.VirtualizationVirtualMachinesListOKBody + Payload *VirtualizationVirtualMachinesListOKBody } func (o *VirtualizationVirtualMachinesListOK) Error() string { @@ -70,7 +74,7 @@ func (o *VirtualizationVirtualMachinesListOK) Error() string { func (o *VirtualizationVirtualMachinesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.VirtualizationVirtualMachinesListOKBody) + o.Payload = new(VirtualizationVirtualMachinesListOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { @@ -79,3 +83,129 @@ func (o *VirtualizationVirtualMachinesListOK) readResponse(response runtime.Clie return nil } + +/*VirtualizationVirtualMachinesListOKBody virtualization virtual machines list o k body +swagger:model VirtualizationVirtualMachinesListOKBody +*/ +type VirtualizationVirtualMachinesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + // Format: uri + Next *strfmt.URI `json:"next,omitempty"` + + // previous + // Format: uri + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results []*models.VirtualMachineWithConfigContext `json:"results"` +} + +// Validate validates this virtualization virtual machines list o k body +func (o *VirtualizationVirtualMachinesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCount(formats); err != nil { + res = append(res, err) + } + + if err := o.validateNext(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePrevious(formats); err != nil { + res = append(res, err) + } + + if err := o.validateResults(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *VirtualizationVirtualMachinesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationVirtualMachinesListOK"+"."+"count", "body", o.Count); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationVirtualMachinesListOKBody) validateNext(formats strfmt.Registry) error { + + if swag.IsZero(o.Next) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationVirtualMachinesListOK"+"."+"next", "body", "uri", o.Next.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationVirtualMachinesListOKBody) validatePrevious(formats strfmt.Registry) error { + + if swag.IsZero(o.Previous) { // not required + return nil + } + + if err := validate.FormatOf("virtualizationVirtualMachinesListOK"+"."+"previous", "body", "uri", o.Previous.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *VirtualizationVirtualMachinesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("virtualizationVirtualMachinesListOK"+"."+"results", "body", o.Results); err != nil { + return err + } + + for i := 0; i < len(o.Results); i++ { + if swag.IsZero(o.Results[i]) { // not required + continue + } + + if o.Results[i] != nil { + if err := o.Results[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtualizationVirtualMachinesListOK" + "." + "results" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *VirtualizationVirtualMachinesListOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *VirtualizationVirtualMachinesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationVirtualMachinesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go index ff186f35c8dfb7d9ebed48db0220c84013f2af05..9a51cc32aca4a128a8a73c509b23d4476e32fd5c 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationVirtualMachinesPartialUpdateParams creates a new VirtualizationVirtualMachinesPartialUpdateParams object @@ -80,7 +79,7 @@ for the virtualization virtual machines partial update operation typically these type VirtualizationVirtualMachinesPartialUpdateParams struct { /*Data*/ - Data *models.WritableVirtualMachine + Data *models.WritableVirtualMachineWithConfigContext /*ID A unique integer value identifying this virtual machine. @@ -126,13 +125,13 @@ func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetHTTPClient(client } // WithData adds the data to the virtualization virtual machines partial update params -func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesPartialUpdateParams { +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithData(data *models.WritableVirtualMachineWithConfigContext) *VirtualizationVirtualMachinesPartialUpdateParams { o.SetData(data) return o } // SetData adds the data to the virtualization virtual machines partial update params -func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetData(data *models.WritableVirtualMachine) { +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetData(data *models.WritableVirtualMachineWithConfigContext) { o.Data = data } diff --git a/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go index f68ed8ed93f1daeed4d2c3dbe21455f5db0ed835..0fe0f3accf27d2de777269347bc892b30defac48 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationVirtualMachinesPartialUpdateReader is a Reader for the VirtualizationVirtualMachinesPartialUpdate structure. @@ -61,7 +61,7 @@ func NewVirtualizationVirtualMachinesPartialUpdateOK() *VirtualizationVirtualMac VirtualizationVirtualMachinesPartialUpdateOK virtualization virtual machines partial update o k */ type VirtualizationVirtualMachinesPartialUpdateOK struct { - Payload *models.WritableVirtualMachine + Payload *models.VirtualMachineWithConfigContext } func (o *VirtualizationVirtualMachinesPartialUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationVirtualMachinesPartialUpdateOK) Error() string { func (o *VirtualizationVirtualMachinesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVirtualMachine) + o.Payload = new(models.VirtualMachineWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go index 9d6888b33851931b693bd8eee1e109d320e39417..1a587a39a996642b77de16fe4c228e85b4d2fdc0 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" diff --git a/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go index 3e8b2eecc933cec21656f2c6ebac725e508dc278..1b835e7a2a3c7eb8f310e0c41aa1592bada17cb4 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationVirtualMachinesReadReader is a Reader for the VirtualizationVirtualMachinesRead structure. @@ -61,7 +61,7 @@ func NewVirtualizationVirtualMachinesReadOK() *VirtualizationVirtualMachinesRead VirtualizationVirtualMachinesReadOK virtualization virtual machines read o k */ type VirtualizationVirtualMachinesReadOK struct { - Payload *models.VirtualMachine + Payload *models.VirtualMachineWithConfigContext } func (o *VirtualizationVirtualMachinesReadOK) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationVirtualMachinesReadOK) Error() string { func (o *VirtualizationVirtualMachinesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.VirtualMachine) + o.Payload = new(models.VirtualMachineWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go index 1a0088be62e705028dadfbe9b6f0470431177b55..6cf8c73eb264e5f19d660dbf48b8632b07476c86 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go @@ -20,11 +20,10 @@ package virtualization // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "net/http" "time" - "golang.org/x/net/context" - "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" @@ -32,7 +31,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // NewVirtualizationVirtualMachinesUpdateParams creates a new VirtualizationVirtualMachinesUpdateParams object @@ -80,7 +79,7 @@ for the virtualization virtual machines update operation typically these are wri type VirtualizationVirtualMachinesUpdateParams struct { /*Data*/ - Data *models.WritableVirtualMachine + Data *models.WritableVirtualMachineWithConfigContext /*ID A unique integer value identifying this virtual machine. @@ -126,13 +125,13 @@ func (o *VirtualizationVirtualMachinesUpdateParams) SetHTTPClient(client *http.C } // WithData adds the data to the virtualization virtual machines update params -func (o *VirtualizationVirtualMachinesUpdateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesUpdateParams { +func (o *VirtualizationVirtualMachinesUpdateParams) WithData(data *models.WritableVirtualMachineWithConfigContext) *VirtualizationVirtualMachinesUpdateParams { o.SetData(data) return o } // SetData adds the data to the virtualization virtual machines update params -func (o *VirtualizationVirtualMachinesUpdateParams) SetData(data *models.WritableVirtualMachine) { +func (o *VirtualizationVirtualMachinesUpdateParams) SetData(data *models.WritableVirtualMachineWithConfigContext) { o.Data = data } diff --git a/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go index e5abe210ca75222e2d33a0a34adf6835e458c3f3..ec967883600400c0714842b24cebb90f016cbfd0 100644 --- a/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go +++ b/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go @@ -27,7 +27,7 @@ import ( strfmt "github.com/go-openapi/strfmt" - "github.com/digitalocean/go-netbox/netbox/models" + models "github.com/digitalocean/go-netbox/netbox/models" ) // VirtualizationVirtualMachinesUpdateReader is a Reader for the VirtualizationVirtualMachinesUpdate structure. @@ -61,7 +61,7 @@ func NewVirtualizationVirtualMachinesUpdateOK() *VirtualizationVirtualMachinesUp VirtualizationVirtualMachinesUpdateOK virtualization virtual machines update o k */ type VirtualizationVirtualMachinesUpdateOK struct { - Payload *models.WritableVirtualMachine + Payload *models.VirtualMachineWithConfigContext } func (o *VirtualizationVirtualMachinesUpdateOK) Error() string { @@ -70,7 +70,7 @@ func (o *VirtualizationVirtualMachinesUpdateOK) Error() string { func (o *VirtualizationVirtualMachinesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.WritableVirtualMachine) + o.Payload = new(models.VirtualMachineWithConfigContext) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/models/aggregate.go b/netbox/models/aggregate.go index d0c730b129cf48434d70872dba28b08f39564d0a..3ae5148755a6c24c4074079e7157f43aff335399 100644 --- a/netbox/models/aggregate.go +++ b/netbox/models/aggregate.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -35,21 +36,24 @@ type Aggregate struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` // Date added - DateAdded strfmt.Date `json:"date_added,omitempty"` + // Format: date + DateAdded *strfmt.Date `json:"date_added,omitempty"` // Description // Max Length: 100 Description string `json:"description,omitempty"` // Family - // Required: true - Family *int64 `json:"family"` + // Read Only: true + // Enum: [4 6] + Family int64 `json:"family,omitempty"` // ID // Read Only: true @@ -57,6 +61,7 @@ type Aggregate struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Prefix @@ -66,29 +71,44 @@ type Aggregate struct { // rir // Required: true Rir *NestedRIR `json:"rir"` + + // tags + Tags []string `json:"tags"` } // Validate validates this aggregate func (m *Aggregate) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateAdded(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateFamily(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validatePrefix(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRir(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -98,6 +118,32 @@ func (m *Aggregate) Validate(formats strfmt.Registry) error { return nil } +func (m *Aggregate) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Aggregate) validateDateAdded(formats strfmt.Registry) error { + + if swag.IsZero(m.DateAdded) { // not required + return nil + } + + if err := validate.FormatOf("date_added", "body", "date", m.DateAdded.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Aggregate) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -133,12 +179,25 @@ func (m *Aggregate) validateFamilyEnum(path, location string, value int64) error func (m *Aggregate) validateFamily(formats strfmt.Registry) error { - if err := validate.Required("family", "body", m.Family); err != nil { - return err + if swag.IsZero(m.Family) { // not required + return nil } // value enum - if err := m.validateFamilyEnum("family", "body", *m.Family); err != nil { + if err := m.validateFamilyEnum("family", "body", m.Family); err != nil { + return err + } + + return nil +} + +func (m *Aggregate) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { return err } @@ -161,7 +220,6 @@ func (m *Aggregate) validateRir(formats strfmt.Registry) error { } if m.Rir != nil { - if err := m.Rir.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rir") @@ -173,6 +231,23 @@ func (m *Aggregate) validateRir(formats strfmt.Registry) error { return nil } +func (m *Aggregate) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Aggregate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/cable.go b/netbox/models/cable.go new file mode 100644 index 0000000000000000000000000000000000000000..42e37f396dd51ea7816d3166c938923a303c6c15 --- /dev/null +++ b/netbox/models/cable.go @@ -0,0 +1,462 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Cable cable +// swagger:model Cable +type Cable struct { + + // Color + // Max Length: 6 + // Pattern: ^[0-9a-f]{6}$ + Color string `json:"color,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Label + // Max Length: 100 + Label string `json:"label,omitempty"` + + // Length + // Maximum: 32767 + // Minimum: 0 + Length *int64 `json:"length,omitempty"` + + // length unit + LengthUnit *CableLengthUnit `json:"length_unit,omitempty"` + + // status + Status *CableStatus `json:"status,omitempty"` + + // Termination a + // Read Only: true + TerminationA map[string]string `json:"termination_a,omitempty"` + + // Termination a id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + TerminationAID *int64 `json:"termination_a_id"` + + // Termination a type + // Required: true + TerminationAType *string `json:"termination_a_type"` + + // Termination b + // Read Only: true + TerminationB map[string]string `json:"termination_b,omitempty"` + + // Termination b id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + TerminationBID *int64 `json:"termination_b_id"` + + // Termination b type + // Required: true + TerminationBType *string `json:"termination_b_type"` + + // Type + // Enum: [1300 1500 1510 1600 1610 1700 1800 1810 3000 3010 3020 3030 3040 3500 3510 3520 3800 5000] + Type *int64 `json:"type,omitempty"` +} + +// Validate validates this cable +func (m *Cable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLength(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLengthUnit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTerminationAID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTerminationAType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTerminationBID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTerminationBType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Cable) validateColor(formats strfmt.Registry) error { + + if swag.IsZero(m.Color) { // not required + return nil + } + + if err := validate.MaxLength("color", "body", string(m.Color), 6); err != nil { + return err + } + + if err := validate.Pattern("color", "body", string(m.Color), `^[0-9a-f]{6}$`); err != nil { + return err + } + + return nil +} + +func (m *Cable) validateLabel(formats strfmt.Registry) error { + + if swag.IsZero(m.Label) { // not required + return nil + } + + if err := validate.MaxLength("label", "body", string(m.Label), 100); err != nil { + return err + } + + return nil +} + +func (m *Cable) validateLength(formats strfmt.Registry) error { + + if swag.IsZero(m.Length) { // not required + return nil + } + + if err := validate.MinimumInt("length", "body", int64(*m.Length), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("length", "body", int64(*m.Length), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *Cable) validateLengthUnit(formats strfmt.Registry) error { + + if swag.IsZero(m.LengthUnit) { // not required + return nil + } + + if m.LengthUnit != nil { + if err := m.LengthUnit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("length_unit") + } + return err + } + } + + return nil +} + +func (m *Cable) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *Cable) validateTerminationAID(formats strfmt.Registry) error { + + if err := validate.Required("termination_a_id", "body", m.TerminationAID); err != nil { + return err + } + + if err := validate.MinimumInt("termination_a_id", "body", int64(*m.TerminationAID), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("termination_a_id", "body", int64(*m.TerminationAID), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Cable) validateTerminationAType(formats strfmt.Registry) error { + + if err := validate.Required("termination_a_type", "body", m.TerminationAType); err != nil { + return err + } + + return nil +} + +func (m *Cable) validateTerminationBID(formats strfmt.Registry) error { + + if err := validate.Required("termination_b_id", "body", m.TerminationBID); err != nil { + return err + } + + if err := validate.MinimumInt("termination_b_id", "body", int64(*m.TerminationBID), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("termination_b_id", "body", int64(*m.TerminationBID), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Cable) validateTerminationBType(formats strfmt.Registry) error { + + if err := validate.Required("termination_b_type", "body", m.TerminationBType); err != nil { + return err + } + + return nil +} + +var cableTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1300,1500,1510,1600,1610,1700,1800,1810,3000,3010,3020,3030,3040,3500,3510,3520,3800,5000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + cableTypeTypePropEnum = append(cableTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *Cable) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, cableTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *Cable) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Cable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Cable) UnmarshalBinary(b []byte) error { + var res Cable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CableLengthUnit Length unit +// swagger:model CableLengthUnit +type CableLengthUnit struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this cable length unit +func (m *CableLengthUnit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CableLengthUnit) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("length_unit"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *CableLengthUnit) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("length_unit"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CableLengthUnit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CableLengthUnit) UnmarshalBinary(b []byte) error { + var res CableLengthUnit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// CableStatus Status +// swagger:model CableStatus +type CableStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this cable status +func (m *CableStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CableStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *CableStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CableStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CableStatus) UnmarshalBinary(b []byte) error { + var res CableStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuit.go b/netbox/models/circuit.go index c3c5953c1f1c8f36324760823825408b492f48c8..e03be2a6d58d1344903ea7b5d47c5330b6f1fcdb 100644 --- a/netbox/models/circuit.go +++ b/netbox/models/circuit.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -34,6 +36,7 @@ type Circuit struct { // Circuit ID // Required: true // Max Length: 50 + // Min Length: 1 Cid *string `json:"cid"` // Comments @@ -46,6 +49,7 @@ type Circuit struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -60,10 +64,12 @@ type Circuit struct { ID int64 `json:"id,omitempty"` // Date installed - InstallDate strfmt.Date `json:"install_date,omitempty"` + // Format: date + InstallDate *strfmt.Date `json:"install_date,omitempty"` // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // provider @@ -71,12 +77,13 @@ type Circuit struct { Provider *NestedProvider `json:"provider"` // status - // Required: true - Status *CircuitStatus `json:"status"` + Status *CircuitStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // type // Required: true @@ -88,37 +95,46 @@ func (m *Circuit) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCid(formats); err != nil { - // prop res = append(res, err) } if err := m.validateCommitRate(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateInstallDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateProvider(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } @@ -134,6 +150,10 @@ func (m *Circuit) validateCid(formats strfmt.Registry) error { return err } + if err := validate.MinLength("cid", "body", string(*m.Cid), 1); err != nil { + return err + } + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { return err } @@ -158,6 +178,19 @@ func (m *Circuit) validateCommitRate(formats strfmt.Registry) error { return nil } +func (m *Circuit) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Circuit) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -171,6 +204,32 @@ func (m *Circuit) validateDescription(formats strfmt.Registry) error { return nil } +func (m *Circuit) validateInstallDate(formats strfmt.Registry) error { + + if swag.IsZero(m.InstallDate) { // not required + return nil + } + + if err := validate.FormatOf("install_date", "body", "date", m.InstallDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Circuit) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Circuit) validateProvider(formats strfmt.Registry) error { if err := validate.Required("provider", "body", m.Provider); err != nil { @@ -178,7 +237,6 @@ func (m *Circuit) validateProvider(formats strfmt.Registry) error { } if m.Provider != nil { - if err := m.Provider.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("provider") @@ -192,12 +250,11 @@ func (m *Circuit) validateProvider(formats strfmt.Registry) error { func (m *Circuit) validateStatus(formats strfmt.Registry) error { - if err := validate.Required("status", "body", m.Status); err != nil { - return err + if swag.IsZero(m.Status) { // not required + return nil } if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") @@ -209,14 +266,30 @@ func (m *Circuit) validateStatus(formats strfmt.Registry) error { return nil } +func (m *Circuit) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *Circuit) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -235,7 +308,6 @@ func (m *Circuit) validateType(formats strfmt.Registry) error { } if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("type") @@ -264,3 +336,70 @@ func (m *Circuit) UnmarshalBinary(b []byte) error { *m = res return nil } + +// CircuitStatus Status +// swagger:model CircuitStatus +type CircuitStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this circuit status +func (m *CircuitStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *CircuitStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitStatus) UnmarshalBinary(b []byte) error { + var res CircuitStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuit_status.go b/netbox/models/circuit_status.go deleted file mode 100644 index e309e96745b8a0161555c6d67535e19a868c9c7b..0000000000000000000000000000000000000000 --- a/netbox/models/circuit_status.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CircuitStatus Status -// swagger:model circuitStatus -type CircuitStatus struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this circuit status -func (m *CircuitStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CircuitStatus) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *CircuitStatus) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CircuitStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CircuitStatus) UnmarshalBinary(b []byte) error { - var res CircuitStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/circuit_termination.go b/netbox/models/circuit_termination.go index 264aec01c8b8a8db9262119d18d1e001d2666a81..f512492c1a67e7c77ade943cf526538d2286b817 100644 --- a/netbox/models/circuit_termination.go +++ b/netbox/models/circuit_termination.go @@ -33,18 +33,36 @@ import ( // swagger:model CircuitTermination type CircuitTermination struct { + // cable + Cable *NestedCable `json:"cable,omitempty"` + // circuit // Required: true Circuit *NestedCircuit `json:"circuit"` + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // connection status + ConnectionStatus *CircuitTerminationConnectionStatus `json:"connection_status,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` - // interface - // Required: true - Interface *Interface `json:"interface"` - // Port speed (Kbps) // Required: true // Maximum: 2.147483647e+09 @@ -61,6 +79,7 @@ type CircuitTermination struct { // Termination // Required: true + // Enum: [A Z] TermSide *string `json:"term_side"` // Upstream speed (Kbps) @@ -79,43 +98,43 @@ type CircuitTermination struct { func (m *CircuitTermination) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + if err := m.validateCircuit(formats); err != nil { - // prop res = append(res, err) } - if err := m.validateInterface(formats); err != nil { - // prop + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { res = append(res, err) } if err := m.validatePortSpeed(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePpInfo(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateTermSide(formats); err != nil { - // prop res = append(res, err) } if err := m.validateUpstreamSpeed(formats); err != nil { - // prop res = append(res, err) } if err := m.validateXconnectID(formats); err != nil { - // prop res = append(res, err) } @@ -125,6 +144,24 @@ func (m *CircuitTermination) Validate(formats strfmt.Registry) error { return nil } +func (m *CircuitTermination) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + func (m *CircuitTermination) validateCircuit(formats strfmt.Registry) error { if err := validate.Required("circuit", "body", m.Circuit); err != nil { @@ -132,7 +169,6 @@ func (m *CircuitTermination) validateCircuit(formats strfmt.Registry) error { } if m.Circuit != nil { - if err := m.Circuit.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("circuit") @@ -144,17 +180,16 @@ func (m *CircuitTermination) validateCircuit(formats strfmt.Registry) error { return nil } -func (m *CircuitTermination) validateInterface(formats strfmt.Registry) error { +func (m *CircuitTermination) validateConnectionStatus(formats strfmt.Registry) error { - if err := validate.Required("interface", "body", m.Interface); err != nil { - return err + if swag.IsZero(m.ConnectionStatus) { // not required + return nil } - if m.Interface != nil { - - if err := m.Interface.Validate(formats); err != nil { + if m.ConnectionStatus != nil { + if err := m.ConnectionStatus.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("interface") + return ve.ValidateName("connection_status") } return err } @@ -163,6 +198,19 @@ func (m *CircuitTermination) validateInterface(formats strfmt.Registry) error { return nil } +func (m *CircuitTermination) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *CircuitTermination) validatePortSpeed(formats strfmt.Registry) error { if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { @@ -200,7 +248,6 @@ func (m *CircuitTermination) validateSite(formats strfmt.Registry) error { } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -225,8 +272,10 @@ func init() { } const ( + // CircuitTerminationTermSideA captures enum value "A" CircuitTerminationTermSideA string = "A" + // CircuitTerminationTermSideZ captures enum value "Z" CircuitTerminationTermSideZ string = "Z" ) @@ -300,3 +349,70 @@ func (m *CircuitTermination) UnmarshalBinary(b []byte) error { *m = res return nil } + +// CircuitTerminationConnectionStatus Connection status +// swagger:model CircuitTerminationConnectionStatus +type CircuitTerminationConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this circuit termination connection status +func (m *CircuitTerminationConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitTerminationConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *CircuitTerminationConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitTerminationConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitTerminationConnectionStatus) UnmarshalBinary(b []byte) error { + var res CircuitTerminationConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuit_type.go b/netbox/models/circuit_type.go index cb820abfd690638be6aa236cabf773c26805de95..ccc933bfad7e835b5aaae809c200f51b15ca91f8 100644 --- a/netbox/models/circuit_type.go +++ b/netbox/models/circuit_type.go @@ -31,6 +31,10 @@ import ( // swagger:model CircuitType type CircuitType struct { + // Circuit count + // Read Only: true + CircuitCount int64 `json:"circuit_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,11 +42,13 @@ type CircuitType struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -52,12 +58,10 @@ func (m *CircuitType) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -73,6 +77,10 @@ func (m *CircuitType) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -86,6 +94,10 @@ func (m *CircuitType) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/circuits_circuit_terminations_list_okbody.go b/netbox/models/circuits_circuit_terminations_list_okbody.go deleted file mode 100644 index a10eb0ce5b5ba5e857e506cf2557578746ab034d..0000000000000000000000000000000000000000 --- a/netbox/models/circuits_circuit_terminations_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CircuitsCircuitTerminationsListOKBody circuits circuit terminations list o k body -// swagger:model circuitsCircuitTerminationsListOKBody -type CircuitsCircuitTerminationsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results CircuitsCircuitTerminationsListOKBodyResults `json:"results"` -} - -// Validate validates this circuits circuit terminations list o k body -func (m *CircuitsCircuitTerminationsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CircuitsCircuitTerminationsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *CircuitsCircuitTerminationsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CircuitsCircuitTerminationsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CircuitsCircuitTerminationsListOKBody) UnmarshalBinary(b []byte) error { - var res CircuitsCircuitTerminationsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/circuits_circuit_terminations_list_okbody_results.go b/netbox/models/circuits_circuit_terminations_list_okbody_results.go deleted file mode 100644 index 0c876bad848e3b96c327f4f5898d7d0fb81d16af..0000000000000000000000000000000000000000 --- a/netbox/models/circuits_circuit_terminations_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// CircuitsCircuitTerminationsListOKBodyResults circuits circuit terminations list o k body results -// swagger:model circuitsCircuitTerminationsListOKBodyResults -type CircuitsCircuitTerminationsListOKBodyResults []*CircuitTermination - -// Validate validates this circuits circuit terminations list o k body results -func (m CircuitsCircuitTerminationsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/circuits_circuit_types_list_okbody.go b/netbox/models/circuits_circuit_types_list_okbody.go deleted file mode 100644 index e0fd7d17e403dfcf88d2ce3683530d1b0bb77108..0000000000000000000000000000000000000000 --- a/netbox/models/circuits_circuit_types_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CircuitsCircuitTypesListOKBody circuits circuit types list o k body -// swagger:model circuitsCircuitTypesListOKBody -type CircuitsCircuitTypesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results CircuitsCircuitTypesListOKBodyResults `json:"results"` -} - -// Validate validates this circuits circuit types list o k body -func (m *CircuitsCircuitTypesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CircuitsCircuitTypesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *CircuitsCircuitTypesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CircuitsCircuitTypesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CircuitsCircuitTypesListOKBody) UnmarshalBinary(b []byte) error { - var res CircuitsCircuitTypesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/circuits_circuit_types_list_okbody_results.go b/netbox/models/circuits_circuit_types_list_okbody_results.go deleted file mode 100644 index 857830ad7bfef9361965fd38e8cae2c5258e8ea3..0000000000000000000000000000000000000000 --- a/netbox/models/circuits_circuit_types_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// CircuitsCircuitTypesListOKBodyResults circuits circuit types list o k body results -// swagger:model circuitsCircuitTypesListOKBodyResults -type CircuitsCircuitTypesListOKBodyResults []*CircuitType - -// Validate validates this circuits circuit types list o k body results -func (m CircuitsCircuitTypesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/circuits_circuits_list_okbody.go b/netbox/models/circuits_circuits_list_okbody.go deleted file mode 100644 index 7e3d10c5095a78f170cfe34cbbed8722b231f0ef..0000000000000000000000000000000000000000 --- a/netbox/models/circuits_circuits_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CircuitsCircuitsListOKBody circuits circuits list o k body -// swagger:model circuitsCircuitsListOKBody -type CircuitsCircuitsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results CircuitsCircuitsListOKBodyResults `json:"results"` -} - -// Validate validates this circuits circuits list o k body -func (m *CircuitsCircuitsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CircuitsCircuitsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *CircuitsCircuitsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CircuitsCircuitsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CircuitsCircuitsListOKBody) UnmarshalBinary(b []byte) error { - var res CircuitsCircuitsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/circuits_circuits_list_okbody_results.go b/netbox/models/circuits_circuits_list_okbody_results.go deleted file mode 100644 index 6033acebe9af808911811097c4a6eff18909446b..0000000000000000000000000000000000000000 --- a/netbox/models/circuits_circuits_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// CircuitsCircuitsListOKBodyResults circuits circuits list o k body results -// swagger:model circuitsCircuitsListOKBodyResults -type CircuitsCircuitsListOKBodyResults []*Circuit - -// Validate validates this circuits circuits list o k body results -func (m CircuitsCircuitsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/circuits_providers_list_okbody.go b/netbox/models/circuits_providers_list_okbody.go deleted file mode 100644 index d1fa3ccc221cfa553a3afc609bdf44e1f2f8eafe..0000000000000000000000000000000000000000 --- a/netbox/models/circuits_providers_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CircuitsProvidersListOKBody circuits providers list o k body -// swagger:model circuitsProvidersListOKBody -type CircuitsProvidersListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results CircuitsProvidersListOKBodyResults `json:"results"` -} - -// Validate validates this circuits providers list o k body -func (m *CircuitsProvidersListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CircuitsProvidersListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *CircuitsProvidersListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CircuitsProvidersListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CircuitsProvidersListOKBody) UnmarshalBinary(b []byte) error { - var res CircuitsProvidersListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/circuits_providers_list_okbody_results.go b/netbox/models/circuits_providers_list_okbody_results.go deleted file mode 100644 index 22d02c9358772219857bdc2701f59152ccfa0665..0000000000000000000000000000000000000000 --- a/netbox/models/circuits_providers_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// CircuitsProvidersListOKBodyResults circuits providers list o k body results -// swagger:model circuitsProvidersListOKBodyResults -type CircuitsProvidersListOKBodyResults []*Provider - -// Validate validates this circuits providers list o k body results -func (m CircuitsProvidersListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/cluster.go b/netbox/models/cluster.go index d3d4ad66f9bc7eed926109a6411a3b351ba792e0..c2d8aaa285ab5d241ef8b31ac75ac17eb5c0a947 100644 --- a/netbox/models/cluster.go +++ b/netbox/models/cluster.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -36,14 +38,18 @@ type Cluster struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // group - // Required: true - Group *NestedClusterGroup `json:"group"` + Group *NestedClusterGroup `json:"group,omitempty"` // ID // Read Only: true @@ -51,43 +57,59 @@ type Cluster struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 100 + // Min Length: 1 Name *string `json:"name"` // site - // Required: true - Site *NestedSite `json:"site"` + Site *NestedSite `json:"site,omitempty"` + + // tags + Tags []string `json:"tags"` // type // Required: true Type *NestedClusterType `json:"type"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` } // Validate validates this cluster func (m *Cluster) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateGroup(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } @@ -97,14 +119,26 @@ func (m *Cluster) Validate(formats strfmt.Registry) error { return nil } -func (m *Cluster) validateGroup(formats strfmt.Registry) error { +func (m *Cluster) validateCreated(formats strfmt.Registry) error { - if err := validate.Required("group", "body", m.Group); err != nil { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { return err } - if m.Group != nil { + return nil +} + +func (m *Cluster) validateGroup(formats strfmt.Registry) error { + if swag.IsZero(m.Group) { // not required + return nil + } + + if m.Group != nil { if err := m.Group.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("group") @@ -116,12 +150,29 @@ func (m *Cluster) validateGroup(formats strfmt.Registry) error { return nil } +func (m *Cluster) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Cluster) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { return err } @@ -131,12 +182,11 @@ func (m *Cluster) validateName(formats strfmt.Registry) error { func (m *Cluster) validateSite(formats strfmt.Registry) error { - if err := validate.Required("site", "body", m.Site); err != nil { - return err + if swag.IsZero(m.Site) { // not required + return nil } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -148,6 +198,23 @@ func (m *Cluster) validateSite(formats strfmt.Registry) error { return nil } +func (m *Cluster) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *Cluster) validateType(formats strfmt.Registry) error { if err := validate.Required("type", "body", m.Type); err != nil { @@ -155,7 +222,6 @@ func (m *Cluster) validateType(formats strfmt.Registry) error { } if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("type") diff --git a/netbox/models/cluster_group.go b/netbox/models/cluster_group.go index 917d539cf24a402ebd1979bc7e9352ac46f3dbd9..dcfe851b8aeb4d84ebab894d8ba5b53da47fa77f 100644 --- a/netbox/models/cluster_group.go +++ b/netbox/models/cluster_group.go @@ -31,6 +31,10 @@ import ( // swagger:model ClusterGroup type ClusterGroup struct { + // Cluster count + // Read Only: true + ClusterCount int64 `json:"cluster_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,11 +42,13 @@ type ClusterGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -52,12 +58,10 @@ func (m *ClusterGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -73,6 +77,10 @@ func (m *ClusterGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -86,6 +94,10 @@ func (m *ClusterGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/cluster_type.go b/netbox/models/cluster_type.go index 7cf330b0bde7f5257ca43d950353e15586405f91..72d91133e0450840f122dbb0b833a08b3fff9826 100644 --- a/netbox/models/cluster_type.go +++ b/netbox/models/cluster_type.go @@ -31,6 +31,10 @@ import ( // swagger:model ClusterType type ClusterType struct { + // Cluster count + // Read Only: true + ClusterCount int64 `json:"cluster_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,11 +42,13 @@ type ClusterType struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -52,12 +58,10 @@ func (m *ClusterType) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -73,6 +77,10 @@ func (m *ClusterType) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -86,6 +94,10 @@ func (m *ClusterType) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/config_context.go b/netbox/models/config_context.go new file mode 100644 index 0000000000000000000000000000000000000000..2498ebee7f262d5ce205f4e8806914613d8cedac --- /dev/null +++ b/netbox/models/config_context.go @@ -0,0 +1,383 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ConfigContext config context +// swagger:model ConfigContext +type ConfigContext struct { + + // Data + // Required: true + Data *string `json:"data"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Is active + IsActive bool `json:"is_active,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // platforms + // Unique: true + Platforms []*NestedPlatform `json:"platforms"` + + // regions + // Unique: true + Regions []*NestedRegion `json:"regions"` + + // roles + // Unique: true + Roles []*NestedDeviceRole `json:"roles"` + + // sites + // Unique: true + Sites []*NestedSite `json:"sites"` + + // tenant groups + // Unique: true + TenantGroups []*NestedTenantGroup `json:"tenant_groups"` + + // tenants + // Unique: true + Tenants []*NestedTenant `json:"tenants"` + + // Weight + // Maximum: 32767 + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this config context +func (m *ConfigContext) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePlatforms(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSites(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenantGroups(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenants(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConfigContext) validateData(formats strfmt.Registry) error { + + if err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + return nil +} + +func (m *ConfigContext) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *ConfigContext) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *ConfigContext) validatePlatforms(formats strfmt.Registry) error { + + if swag.IsZero(m.Platforms) { // not required + return nil + } + + if err := validate.UniqueItems("platforms", "body", m.Platforms); err != nil { + return err + } + + for i := 0; i < len(m.Platforms); i++ { + if swag.IsZero(m.Platforms[i]) { // not required + continue + } + + if m.Platforms[i] != nil { + if err := m.Platforms[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("platforms" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ConfigContext) validateRegions(formats strfmt.Registry) error { + + if swag.IsZero(m.Regions) { // not required + return nil + } + + if err := validate.UniqueItems("regions", "body", m.Regions); err != nil { + return err + } + + for i := 0; i < len(m.Regions); i++ { + if swag.IsZero(m.Regions[i]) { // not required + continue + } + + if m.Regions[i] != nil { + if err := m.Regions[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("regions" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ConfigContext) validateRoles(formats strfmt.Registry) error { + + if swag.IsZero(m.Roles) { // not required + return nil + } + + if err := validate.UniqueItems("roles", "body", m.Roles); err != nil { + return err + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ConfigContext) validateSites(formats strfmt.Registry) error { + + if swag.IsZero(m.Sites) { // not required + return nil + } + + if err := validate.UniqueItems("sites", "body", m.Sites); err != nil { + return err + } + + for i := 0; i < len(m.Sites); i++ { + if swag.IsZero(m.Sites[i]) { // not required + continue + } + + if m.Sites[i] != nil { + if err := m.Sites[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sites" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ConfigContext) validateTenantGroups(formats strfmt.Registry) error { + + if swag.IsZero(m.TenantGroups) { // not required + return nil + } + + if err := validate.UniqueItems("tenant_groups", "body", m.TenantGroups); err != nil { + return err + } + + for i := 0; i < len(m.TenantGroups); i++ { + if swag.IsZero(m.TenantGroups[i]) { // not required + continue + } + + if m.TenantGroups[i] != nil { + if err := m.TenantGroups[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant_groups" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ConfigContext) validateTenants(formats strfmt.Registry) error { + + if swag.IsZero(m.Tenants) { // not required + return nil + } + + if err := validate.UniqueItems("tenants", "body", m.Tenants); err != nil { + return err + } + + for i := 0; i < len(m.Tenants); i++ { + if swag.IsZero(m.Tenants[i]) { // not required + continue + } + + if m.Tenants[i] != nil { + if err := m.Tenants[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenants" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ConfigContext) validateWeight(formats strfmt.Registry) error { + + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", int64(*m.Weight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("weight", "body", int64(*m.Weight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConfigContext) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConfigContext) UnmarshalBinary(b []byte) error { + var res ConfigContext + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/console_port.go b/netbox/models/console_port.go index 0646b44f355d05b433e3f702e44371ab622633ff..69a706d2fc0b1e343c922e2c902a575211e1bafd 100644 --- a/netbox/models/console_port.go +++ b/netbox/models/console_port.go @@ -20,7 +20,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -33,12 +33,27 @@ import ( // swagger:model ConsolePort type ConsolePort struct { - // Connection status - ConnectionStatus bool `json:"connection_status,omitempty"` + // cable + Cable *NestedCable `json:"cable,omitempty"` - // cs port - // Required: true - CsPort *ConsoleServerPort `json:"cs_port"` + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // connection status + ConnectionStatus *ConsolePortConnectionStatus `json:"connection_status,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` // device // Required: true @@ -51,30 +66,38 @@ type ConsolePort struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // tags + Tags []string `json:"tags"` } // Validate validates this console port func (m *ConsolePort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + if err := m.validateConnectionStatus(formats); err != nil { - // prop res = append(res, err) } - if err := m.validateCsPort(formats); err != nil { - // prop + if err := m.validateDescription(formats); err != nil { res = append(res, err) } if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -84,23 +107,21 @@ func (m *ConsolePort) Validate(formats strfmt.Registry) error { return nil } -var consolePortTypeConnectionStatusPropEnum []interface{} +func (m *ConsolePort) validateCable(formats strfmt.Registry) error { -func init() { - var res []bool - if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { - panic(err) - } - for _, v := range res { - consolePortTypeConnectionStatusPropEnum = append(consolePortTypeConnectionStatusPropEnum, v) + if swag.IsZero(m.Cable) { // not required + return nil } -} -// prop value enum -func (m *ConsolePort) validateConnectionStatusEnum(path, location string, value bool) error { - if err := validate.Enum(path, location, value, consolePortTypeConnectionStatusPropEnum); err != nil { - return err + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } } + return nil } @@ -110,28 +131,26 @@ func (m *ConsolePort) validateConnectionStatus(formats strfmt.Registry) error { return nil } - // value enum - if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { - return err + if m.ConnectionStatus != nil { + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } } return nil } -func (m *ConsolePort) validateCsPort(formats strfmt.Registry) error { +func (m *ConsolePort) validateDescription(formats strfmt.Registry) error { - if err := validate.Required("cs_port", "body", m.CsPort); err != nil { - return err + if swag.IsZero(m.Description) { // not required + return nil } - if m.CsPort != nil { - - if err := m.CsPort.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("cs_port") - } - return err - } + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err } return nil @@ -144,7 +163,6 @@ func (m *ConsolePort) validateDevice(formats strfmt.Registry) error { } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -162,6 +180,10 @@ func (m *ConsolePort) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -169,6 +191,23 @@ func (m *ConsolePort) validateName(formats strfmt.Registry) error { return nil } +func (m *ConsolePort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ConsolePort) MarshalBinary() ([]byte, error) { if m == nil { @@ -186,3 +225,70 @@ func (m *ConsolePort) UnmarshalBinary(b []byte) error { *m = res return nil } + +// ConsolePortConnectionStatus Connection status +// swagger:model ConsolePortConnectionStatus +type ConsolePortConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this console port connection status +func (m *ConsolePortConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsolePortConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *ConsolePortConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConsolePortConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsolePortConnectionStatus) UnmarshalBinary(b []byte) error { + var res ConsolePortConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/console_port_template.go b/netbox/models/console_port_template.go index 3c623ac28d2e96e751cd9441aca1348d86a1913f..ae1c99792aa96ca9d7e3449e02727bcb526e7de8 100644 --- a/netbox/models/console_port_template.go +++ b/netbox/models/console_port_template.go @@ -42,6 +42,7 @@ type ConsolePortTemplate struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` } @@ -50,12 +51,10 @@ func (m *ConsolePortTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } @@ -72,7 +71,6 @@ func (m *ConsolePortTemplate) validateDeviceType(formats strfmt.Registry) error } if m.DeviceType != nil { - if err := m.DeviceType.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device_type") @@ -90,6 +88,10 @@ func (m *ConsolePortTemplate) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } diff --git a/netbox/models/console_server_port.go b/netbox/models/console_server_port.go index 8ce6dc18761123d48483f64fa464a396ac7174e9..12d9a37a33b0e6843d4a3af82badb3c6bf446f24 100644 --- a/netbox/models/console_server_port.go +++ b/netbox/models/console_server_port.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -27,13 +29,31 @@ import ( "github.com/go-openapi/validate" ) -// ConsoleServerPort Cs port +// ConsoleServerPort console server port // swagger:model ConsoleServerPort type ConsoleServerPort struct { - // Connected console + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type // Read Only: true - ConnectedConsole string `json:"connected_console,omitempty"` + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // connection status + ConnectionStatus *ConsoleServerPortConnectionStatus `json:"connection_status,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` // device // Required: true @@ -46,20 +66,38 @@ type ConsoleServerPort struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // tags + Tags []string `json:"tags"` } // Validate validates this console server port func (m *ConsoleServerPort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -69,6 +107,55 @@ func (m *ConsoleServerPort) Validate(formats strfmt.Registry) error { return nil } +func (m *ConsoleServerPort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +func (m *ConsoleServerPort) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + if m.ConnectionStatus != nil { + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + } + + return nil +} + +func (m *ConsoleServerPort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *ConsoleServerPort) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -76,7 +163,6 @@ func (m *ConsoleServerPort) validateDevice(formats strfmt.Registry) error { } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -94,6 +180,10 @@ func (m *ConsoleServerPort) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -101,6 +191,23 @@ func (m *ConsoleServerPort) validateName(formats strfmt.Registry) error { return nil } +func (m *ConsoleServerPort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *ConsoleServerPort) MarshalBinary() ([]byte, error) { if m == nil { @@ -118,3 +225,70 @@ func (m *ConsoleServerPort) UnmarshalBinary(b []byte) error { *m = res return nil } + +// ConsoleServerPortConnectionStatus Connection status +// swagger:model ConsoleServerPortConnectionStatus +type ConsoleServerPortConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this console server port connection status +func (m *ConsoleServerPortConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsoleServerPortConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *ConsoleServerPortConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ConsoleServerPortConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsoleServerPortConnectionStatus) UnmarshalBinary(b []byte) error { + var res ConsoleServerPortConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/console_server_port_template.go b/netbox/models/console_server_port_template.go index f10cb09dbfd8c90758db39e678e3ab0acea1daeb..3652f4248540d010ba2739c662fa3145f0c838e8 100644 --- a/netbox/models/console_server_port_template.go +++ b/netbox/models/console_server_port_template.go @@ -42,6 +42,7 @@ type ConsoleServerPortTemplate struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` } @@ -50,12 +51,10 @@ func (m *ConsoleServerPortTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } @@ -72,7 +71,6 @@ func (m *ConsoleServerPortTemplate) validateDeviceType(formats strfmt.Registry) } if m.DeviceType != nil { - if err := m.DeviceType.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device_type") @@ -90,6 +88,10 @@ func (m *ConsoleServerPortTemplate) validateName(formats strfmt.Registry) error return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } diff --git a/netbox/models/dcim_console_connections_list_okbody.go b/netbox/models/dcim_console_connections_list_okbody.go deleted file mode 100644 index cf16ad845a1a622afaaa572a5d83f5a411b19c0d..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_connections_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimConsoleConnectionsListOKBody dcim console connections list o k body -// swagger:model dcimConsoleConnectionsListOKBody -type DcimConsoleConnectionsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimConsoleConnectionsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim console connections list o k body -func (m *DcimConsoleConnectionsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimConsoleConnectionsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimConsoleConnectionsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimConsoleConnectionsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimConsoleConnectionsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimConsoleConnectionsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_console_connections_list_okbody_results.go b/netbox/models/dcim_console_connections_list_okbody_results.go deleted file mode 100644 index fb6e026914fb33fd3aaeae778802173c47c88ab5..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_connections_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimConsoleConnectionsListOKBodyResults dcim console connections list o k body results -// swagger:model dcimConsoleConnectionsListOKBodyResults -type DcimConsoleConnectionsListOKBodyResults []*ConsolePort - -// Validate validates this dcim console connections list o k body results -func (m DcimConsoleConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_console_port_templates_list_okbody.go b/netbox/models/dcim_console_port_templates_list_okbody.go deleted file mode 100644 index 4e01c1251a01c14cd7dcd1049d084ecf7fe9f187..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_port_templates_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimConsolePortTemplatesListOKBody dcim console port templates list o k body -// swagger:model dcimConsolePortTemplatesListOKBody -type DcimConsolePortTemplatesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimConsolePortTemplatesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim console port templates list o k body -func (m *DcimConsolePortTemplatesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimConsolePortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimConsolePortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimConsolePortTemplatesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimConsolePortTemplatesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimConsolePortTemplatesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_console_port_templates_list_okbody_results.go b/netbox/models/dcim_console_port_templates_list_okbody_results.go deleted file mode 100644 index cdee33b0288ba57893f6762f05c60f821f87e5f1..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_port_templates_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimConsolePortTemplatesListOKBodyResults dcim console port templates list o k body results -// swagger:model dcimConsolePortTemplatesListOKBodyResults -type DcimConsolePortTemplatesListOKBodyResults []*ConsolePortTemplate - -// Validate validates this dcim console port templates list o k body results -func (m DcimConsolePortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_console_ports_list_okbody.go b/netbox/models/dcim_console_ports_list_okbody.go deleted file mode 100644 index 1a9065d4484dd5f506a8bf341ff5d4689267eb23..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_ports_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimConsolePortsListOKBody dcim console ports list o k body -// swagger:model dcimConsolePortsListOKBody -type DcimConsolePortsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimConsolePortsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim console ports list o k body -func (m *DcimConsolePortsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimConsolePortsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimConsolePortsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimConsolePortsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimConsolePortsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimConsolePortsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_console_ports_list_okbody_results.go b/netbox/models/dcim_console_ports_list_okbody_results.go deleted file mode 100644 index d7fcd4a1cf22509143cc9369f27d451ccac2e922..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_ports_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimConsolePortsListOKBodyResults dcim console ports list o k body results -// swagger:model dcimConsolePortsListOKBodyResults -type DcimConsolePortsListOKBodyResults []*ConsolePort - -// Validate validates this dcim console ports list o k body results -func (m DcimConsolePortsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_console_server_port_templates_list_okbody.go b/netbox/models/dcim_console_server_port_templates_list_okbody.go deleted file mode 100644 index 1b0b57168c288fad37e15bcf18e05057332fa13b..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_server_port_templates_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimConsoleServerPortTemplatesListOKBody dcim console server port templates list o k body -// swagger:model dcimConsoleServerPortTemplatesListOKBody -type DcimConsoleServerPortTemplatesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimConsoleServerPortTemplatesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim console server port templates list o k body -func (m *DcimConsoleServerPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimConsoleServerPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimConsoleServerPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimConsoleServerPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimConsoleServerPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimConsoleServerPortTemplatesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_console_server_port_templates_list_okbody_results.go b/netbox/models/dcim_console_server_port_templates_list_okbody_results.go deleted file mode 100644 index 406849db7e616089cdc15df7deb5badee4621a4e..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_server_port_templates_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimConsoleServerPortTemplatesListOKBodyResults dcim console server port templates list o k body results -// swagger:model dcimConsoleServerPortTemplatesListOKBodyResults -type DcimConsoleServerPortTemplatesListOKBodyResults []*ConsoleServerPortTemplate - -// Validate validates this dcim console server port templates list o k body results -func (m DcimConsoleServerPortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_console_server_ports_list_okbody.go b/netbox/models/dcim_console_server_ports_list_okbody.go deleted file mode 100644 index 2071f3547159a613e481579f4cb424989da39cc1..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_server_ports_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimConsoleServerPortsListOKBody dcim console server ports list o k body -// swagger:model dcimConsoleServerPortsListOKBody -type DcimConsoleServerPortsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimConsoleServerPortsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim console server ports list o k body -func (m *DcimConsoleServerPortsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimConsoleServerPortsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimConsoleServerPortsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimConsoleServerPortsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimConsoleServerPortsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimConsoleServerPortsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_console_server_ports_list_okbody_results.go b/netbox/models/dcim_console_server_ports_list_okbody_results.go deleted file mode 100644 index ab2dd1c862c561e3cbb330b4f841222d625c178d..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_console_server_ports_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimConsoleServerPortsListOKBodyResults dcim console server ports list o k body results -// swagger:model dcimConsoleServerPortsListOKBodyResults -type DcimConsoleServerPortsListOKBodyResults []*ConsoleServerPort - -// Validate validates this dcim console server ports list o k body results -func (m DcimConsoleServerPortsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_device_bay_templates_list_okbody.go b/netbox/models/dcim_device_bay_templates_list_okbody.go deleted file mode 100644 index 8a33f6c18099d354e656a69a6f20f7ab9233f53c..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_device_bay_templates_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimDeviceBayTemplatesListOKBody dcim device bay templates list o k body -// swagger:model dcimDeviceBayTemplatesListOKBody -type DcimDeviceBayTemplatesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimDeviceBayTemplatesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim device bay templates list o k body -func (m *DcimDeviceBayTemplatesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimDeviceBayTemplatesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimDeviceBayTemplatesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimDeviceBayTemplatesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimDeviceBayTemplatesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimDeviceBayTemplatesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_device_bay_templates_list_okbody_results.go b/netbox/models/dcim_device_bay_templates_list_okbody_results.go deleted file mode 100644 index ed0287ba8068e323a7262e31c5e1ae163c13f73e..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_device_bay_templates_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimDeviceBayTemplatesListOKBodyResults dcim device bay templates list o k body results -// swagger:model dcimDeviceBayTemplatesListOKBodyResults -type DcimDeviceBayTemplatesListOKBodyResults []*DeviceBayTemplate - -// Validate validates this dcim device bay templates list o k body results -func (m DcimDeviceBayTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_device_bays_list_okbody.go b/netbox/models/dcim_device_bays_list_okbody.go deleted file mode 100644 index 8227102173690fe8be7276b31490b36b3e14771a..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_device_bays_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimDeviceBaysListOKBody dcim device bays list o k body -// swagger:model dcimDeviceBaysListOKBody -type DcimDeviceBaysListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimDeviceBaysListOKBodyResults `json:"results"` -} - -// Validate validates this dcim device bays list o k body -func (m *DcimDeviceBaysListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimDeviceBaysListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimDeviceBaysListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimDeviceBaysListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimDeviceBaysListOKBody) UnmarshalBinary(b []byte) error { - var res DcimDeviceBaysListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_device_bays_list_okbody_results.go b/netbox/models/dcim_device_bays_list_okbody_results.go deleted file mode 100644 index 15655a11dd8e3a885b2f4a12a5262b88097f8c99..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_device_bays_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimDeviceBaysListOKBodyResults dcim device bays list o k body results -// swagger:model dcimDeviceBaysListOKBodyResults -type DcimDeviceBaysListOKBodyResults []*DeviceBay - -// Validate validates this dcim device bays list o k body results -func (m DcimDeviceBaysListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_device_roles_list_okbody.go b/netbox/models/dcim_device_roles_list_okbody.go deleted file mode 100644 index 1ebd30dc2505f22fd7264539023d7b2fbdab0ef6..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_device_roles_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimDeviceRolesListOKBody dcim device roles list o k body -// swagger:model dcimDeviceRolesListOKBody -type DcimDeviceRolesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimDeviceRolesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim device roles list o k body -func (m *DcimDeviceRolesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimDeviceRolesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimDeviceRolesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimDeviceRolesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimDeviceRolesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimDeviceRolesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_device_roles_list_okbody_results.go b/netbox/models/dcim_device_roles_list_okbody_results.go deleted file mode 100644 index a5f50a5803031dffbbc7703d89532075a679c0c2..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_device_roles_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimDeviceRolesListOKBodyResults dcim device roles list o k body results -// swagger:model dcimDeviceRolesListOKBodyResults -type DcimDeviceRolesListOKBodyResults []*DeviceRole - -// Validate validates this dcim device roles list o k body results -func (m DcimDeviceRolesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_device_types_list_okbody.go b/netbox/models/dcim_device_types_list_okbody.go deleted file mode 100644 index 24e86ccdcdf09bbc686a9b6a877d442150313e9b..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_device_types_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimDeviceTypesListOKBody dcim device types list o k body -// swagger:model dcimDeviceTypesListOKBody -type DcimDeviceTypesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimDeviceTypesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim device types list o k body -func (m *DcimDeviceTypesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimDeviceTypesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimDeviceTypesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimDeviceTypesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimDeviceTypesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimDeviceTypesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_device_types_list_okbody_results.go b/netbox/models/dcim_device_types_list_okbody_results.go deleted file mode 100644 index 08343bd7aee1fe9971738621f0ead2bd8f72d7df..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_device_types_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimDeviceTypesListOKBodyResults dcim device types list o k body results -// swagger:model dcimDeviceTypesListOKBodyResults -type DcimDeviceTypesListOKBodyResults []*DeviceType - -// Validate validates this dcim device types list o k body results -func (m DcimDeviceTypesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_devices_list_okbody.go b/netbox/models/dcim_devices_list_okbody.go deleted file mode 100644 index 068262b340f3ab6fd5d10e04d82427c5ff5e48f2..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_devices_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimDevicesListOKBody dcim devices list o k body -// swagger:model dcimDevicesListOKBody -type DcimDevicesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimDevicesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim devices list o k body -func (m *DcimDevicesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimDevicesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimDevicesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimDevicesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimDevicesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimDevicesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_devices_list_okbody_results.go b/netbox/models/dcim_devices_list_okbody_results.go deleted file mode 100644 index eddebb2a26c4c9d05c0db6b0e6e85d5fbae313e4..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_devices_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimDevicesListOKBodyResults dcim devices list o k body results -// swagger:model dcimDevicesListOKBodyResults -type DcimDevicesListOKBodyResults []*Device - -// Validate validates this dcim devices list o k body results -func (m DcimDevicesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_interface_connections_list_okbody.go b/netbox/models/dcim_interface_connections_list_okbody.go deleted file mode 100644 index 34437c3991e87b07f3733ebc3805414419268c4c..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_interface_connections_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimInterfaceConnectionsListOKBody dcim interface connections list o k body -// swagger:model dcimInterfaceConnectionsListOKBody -type DcimInterfaceConnectionsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimInterfaceConnectionsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim interface connections list o k body -func (m *DcimInterfaceConnectionsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimInterfaceConnectionsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimInterfaceConnectionsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimInterfaceConnectionsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimInterfaceConnectionsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimInterfaceConnectionsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_interface_connections_list_okbody_results.go b/netbox/models/dcim_interface_connections_list_okbody_results.go deleted file mode 100644 index afba2efada7bfec22a3e0d45f50f9a0c006d0e79..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_interface_connections_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimInterfaceConnectionsListOKBodyResults dcim interface connections list o k body results -// swagger:model dcimInterfaceConnectionsListOKBodyResults -type DcimInterfaceConnectionsListOKBodyResults []*InterfaceConnection - -// Validate validates this dcim interface connections list o k body results -func (m DcimInterfaceConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_interface_templates_list_okbody.go b/netbox/models/dcim_interface_templates_list_okbody.go deleted file mode 100644 index 32f05eef1e139d684652008fa5039b72dac6b831..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_interface_templates_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimInterfaceTemplatesListOKBody dcim interface templates list o k body -// swagger:model dcimInterfaceTemplatesListOKBody -type DcimInterfaceTemplatesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimInterfaceTemplatesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim interface templates list o k body -func (m *DcimInterfaceTemplatesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimInterfaceTemplatesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimInterfaceTemplatesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimInterfaceTemplatesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimInterfaceTemplatesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimInterfaceTemplatesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_interface_templates_list_okbody_results.go b/netbox/models/dcim_interface_templates_list_okbody_results.go deleted file mode 100644 index 7964a72eda18d8c8b8083efadca506ffec689aad..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_interface_templates_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimInterfaceTemplatesListOKBodyResults dcim interface templates list o k body results -// swagger:model dcimInterfaceTemplatesListOKBodyResults -type DcimInterfaceTemplatesListOKBodyResults []*InterfaceTemplate - -// Validate validates this dcim interface templates list o k body results -func (m DcimInterfaceTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_interfaces_list_okbody.go b/netbox/models/dcim_interfaces_list_okbody.go deleted file mode 100644 index fea51461d40360f8038726ee734d0aaa9938a099..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_interfaces_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimInterfacesListOKBody dcim interfaces list o k body -// swagger:model dcimInterfacesListOKBody -type DcimInterfacesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimInterfacesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim interfaces list o k body -func (m *DcimInterfacesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimInterfacesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimInterfacesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimInterfacesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimInterfacesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimInterfacesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_interfaces_list_okbody_results.go b/netbox/models/dcim_interfaces_list_okbody_results.go deleted file mode 100644 index de0818f5a4730fd8bb5fc7017e902faed5c29778..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_interfaces_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimInterfacesListOKBodyResults dcim interfaces list o k body results -// swagger:model dcimInterfacesListOKBodyResults -type DcimInterfacesListOKBodyResults []*Interface - -// Validate validates this dcim interfaces list o k body results -func (m DcimInterfacesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_inventory_items_list_okbody.go b/netbox/models/dcim_inventory_items_list_okbody.go deleted file mode 100644 index fbb70373ed290d66ba713431b4c49f19f4b0e479..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_inventory_items_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimInventoryItemsListOKBody dcim inventory items list o k body -// swagger:model dcimInventoryItemsListOKBody -type DcimInventoryItemsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimInventoryItemsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim inventory items list o k body -func (m *DcimInventoryItemsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimInventoryItemsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimInventoryItemsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimInventoryItemsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimInventoryItemsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimInventoryItemsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_inventory_items_list_okbody_results.go b/netbox/models/dcim_inventory_items_list_okbody_results.go deleted file mode 100644 index 606ff82f55ae886e42324041939e5538876ffa8c..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_inventory_items_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimInventoryItemsListOKBodyResults dcim inventory items list o k body results -// swagger:model dcimInventoryItemsListOKBodyResults -type DcimInventoryItemsListOKBodyResults []*InventoryItem - -// Validate validates this dcim inventory items list o k body results -func (m DcimInventoryItemsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_manufacturers_list_okbody.go b/netbox/models/dcim_manufacturers_list_okbody.go deleted file mode 100644 index 887f493207d50c7fc2f924c62868d630521cdff0..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_manufacturers_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimManufacturersListOKBody dcim manufacturers list o k body -// swagger:model dcimManufacturersListOKBody -type DcimManufacturersListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimManufacturersListOKBodyResults `json:"results"` -} - -// Validate validates this dcim manufacturers list o k body -func (m *DcimManufacturersListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimManufacturersListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimManufacturersListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimManufacturersListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimManufacturersListOKBody) UnmarshalBinary(b []byte) error { - var res DcimManufacturersListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_manufacturers_list_okbody_results.go b/netbox/models/dcim_manufacturers_list_okbody_results.go deleted file mode 100644 index e780b036c05b7a91bfd87fa282526c2c5ec1eb98..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_manufacturers_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimManufacturersListOKBodyResults dcim manufacturers list o k body results -// swagger:model dcimManufacturersListOKBodyResults -type DcimManufacturersListOKBodyResults []*Manufacturer - -// Validate validates this dcim manufacturers list o k body results -func (m DcimManufacturersListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_platforms_list_okbody.go b/netbox/models/dcim_platforms_list_okbody.go deleted file mode 100644 index b36ae49a68114090f1135f886e841dd0bab6d1ad..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_platforms_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimPlatformsListOKBody dcim platforms list o k body -// swagger:model dcimPlatformsListOKBody -type DcimPlatformsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimPlatformsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim platforms list o k body -func (m *DcimPlatformsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimPlatformsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimPlatformsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimPlatformsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimPlatformsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimPlatformsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_platforms_list_okbody_results.go b/netbox/models/dcim_platforms_list_okbody_results.go deleted file mode 100644 index 4ae6d12d4cbe043d001f74139d32b704144fbf62..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_platforms_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimPlatformsListOKBodyResults dcim platforms list o k body results -// swagger:model dcimPlatformsListOKBodyResults -type DcimPlatformsListOKBodyResults []*Platform - -// Validate validates this dcim platforms list o k body results -func (m DcimPlatformsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_power_connections_list_okbody.go b/netbox/models/dcim_power_connections_list_okbody.go deleted file mode 100644 index b6b0dd615302d379dc8595016987cc218774785e..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_connections_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimPowerConnectionsListOKBody dcim power connections list o k body -// swagger:model dcimPowerConnectionsListOKBody -type DcimPowerConnectionsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimPowerConnectionsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim power connections list o k body -func (m *DcimPowerConnectionsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimPowerConnectionsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimPowerConnectionsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimPowerConnectionsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimPowerConnectionsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimPowerConnectionsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_power_connections_list_okbody_results.go b/netbox/models/dcim_power_connections_list_okbody_results.go deleted file mode 100644 index 6fb485cd6ee36dde531e65e2f691ad73d696b433..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_connections_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimPowerConnectionsListOKBodyResults dcim power connections list o k body results -// swagger:model dcimPowerConnectionsListOKBodyResults -type DcimPowerConnectionsListOKBodyResults []*PowerPort - -// Validate validates this dcim power connections list o k body results -func (m DcimPowerConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_power_outlet_templates_list_okbody.go b/netbox/models/dcim_power_outlet_templates_list_okbody.go deleted file mode 100644 index 5401da89ce22e1a6724833b9d6844c5120ec8be4..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_outlet_templates_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimPowerOutletTemplatesListOKBody dcim power outlet templates list o k body -// swagger:model dcimPowerOutletTemplatesListOKBody -type DcimPowerOutletTemplatesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimPowerOutletTemplatesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim power outlet templates list o k body -func (m *DcimPowerOutletTemplatesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimPowerOutletTemplatesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimPowerOutletTemplatesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimPowerOutletTemplatesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimPowerOutletTemplatesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimPowerOutletTemplatesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_power_outlet_templates_list_okbody_results.go b/netbox/models/dcim_power_outlet_templates_list_okbody_results.go deleted file mode 100644 index 79074c19d747b064280e99382def4bbd26365bb3..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_outlet_templates_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimPowerOutletTemplatesListOKBodyResults dcim power outlet templates list o k body results -// swagger:model dcimPowerOutletTemplatesListOKBodyResults -type DcimPowerOutletTemplatesListOKBodyResults []*PowerOutletTemplate - -// Validate validates this dcim power outlet templates list o k body results -func (m DcimPowerOutletTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_power_outlets_list_okbody.go b/netbox/models/dcim_power_outlets_list_okbody.go deleted file mode 100644 index 9cc35d1b0e761d91d7f89793678fe073fcc7fce9..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_outlets_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimPowerOutletsListOKBody dcim power outlets list o k body -// swagger:model dcimPowerOutletsListOKBody -type DcimPowerOutletsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimPowerOutletsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim power outlets list o k body -func (m *DcimPowerOutletsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimPowerOutletsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimPowerOutletsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimPowerOutletsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimPowerOutletsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimPowerOutletsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_power_outlets_list_okbody_results.go b/netbox/models/dcim_power_outlets_list_okbody_results.go deleted file mode 100644 index 5e7299e51b063be015da73999697119dff84bb24..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_outlets_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimPowerOutletsListOKBodyResults dcim power outlets list o k body results -// swagger:model dcimPowerOutletsListOKBodyResults -type DcimPowerOutletsListOKBodyResults []*PowerOutlet - -// Validate validates this dcim power outlets list o k body results -func (m DcimPowerOutletsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_power_port_templates_list_okbody.go b/netbox/models/dcim_power_port_templates_list_okbody.go deleted file mode 100644 index 9681270d8d29f7710d73156da9a59e7e7318f9cb..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_port_templates_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimPowerPortTemplatesListOKBody dcim power port templates list o k body -// swagger:model dcimPowerPortTemplatesListOKBody -type DcimPowerPortTemplatesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimPowerPortTemplatesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim power port templates list o k body -func (m *DcimPowerPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimPowerPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimPowerPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimPowerPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimPowerPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimPowerPortTemplatesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_power_port_templates_list_okbody_results.go b/netbox/models/dcim_power_port_templates_list_okbody_results.go deleted file mode 100644 index 9363353e21e9c6711d7c7bb2366c82a70adacc32..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_port_templates_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimPowerPortTemplatesListOKBodyResults dcim power port templates list o k body results -// swagger:model dcimPowerPortTemplatesListOKBodyResults -type DcimPowerPortTemplatesListOKBodyResults []*PowerPortTemplate - -// Validate validates this dcim power port templates list o k body results -func (m DcimPowerPortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_power_ports_list_okbody.go b/netbox/models/dcim_power_ports_list_okbody.go deleted file mode 100644 index e435e12d5195f65452eb0782810d17850ec7e10f..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_ports_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimPowerPortsListOKBody dcim power ports list o k body -// swagger:model dcimPowerPortsListOKBody -type DcimPowerPortsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimPowerPortsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim power ports list o k body -func (m *DcimPowerPortsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimPowerPortsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimPowerPortsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimPowerPortsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimPowerPortsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimPowerPortsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_power_ports_list_okbody_results.go b/netbox/models/dcim_power_ports_list_okbody_results.go deleted file mode 100644 index 116213489d0d688ef3f25991129103c5b814cda9..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_power_ports_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimPowerPortsListOKBodyResults dcim power ports list o k body results -// swagger:model dcimPowerPortsListOKBodyResults -type DcimPowerPortsListOKBodyResults []*PowerPort - -// Validate validates this dcim power ports list o k body results -func (m DcimPowerPortsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_rack_groups_list_okbody.go b/netbox/models/dcim_rack_groups_list_okbody.go deleted file mode 100644 index 9ef16d6989898096e68b43130503fafb3f0b3142..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_rack_groups_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimRackGroupsListOKBody dcim rack groups list o k body -// swagger:model dcimRackGroupsListOKBody -type DcimRackGroupsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimRackGroupsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim rack groups list o k body -func (m *DcimRackGroupsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimRackGroupsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimRackGroupsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimRackGroupsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimRackGroupsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimRackGroupsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_rack_groups_list_okbody_results.go b/netbox/models/dcim_rack_groups_list_okbody_results.go deleted file mode 100644 index 50967e1a8fdd9d537e936a1f296a4abd767db9c8..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_rack_groups_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimRackGroupsListOKBodyResults dcim rack groups list o k body results -// swagger:model dcimRackGroupsListOKBodyResults -type DcimRackGroupsListOKBodyResults []*RackGroup - -// Validate validates this dcim rack groups list o k body results -func (m DcimRackGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_rack_reservations_list_okbody.go b/netbox/models/dcim_rack_reservations_list_okbody.go deleted file mode 100644 index 4b5d7d7a331a23f2e676276e357ef21ed149d2f1..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_rack_reservations_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimRackReservationsListOKBody dcim rack reservations list o k body -// swagger:model dcimRackReservationsListOKBody -type DcimRackReservationsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimRackReservationsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim rack reservations list o k body -func (m *DcimRackReservationsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimRackReservationsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimRackReservationsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimRackReservationsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimRackReservationsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimRackReservationsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_rack_reservations_list_okbody_results.go b/netbox/models/dcim_rack_reservations_list_okbody_results.go deleted file mode 100644 index 8e8a4d1ffa1a1b10a48d1c10de8801186a7082f5..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_rack_reservations_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimRackReservationsListOKBodyResults dcim rack reservations list o k body results -// swagger:model dcimRackReservationsListOKBodyResults -type DcimRackReservationsListOKBodyResults []*RackReservation - -// Validate validates this dcim rack reservations list o k body results -func (m DcimRackReservationsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_rack_roles_list_okbody.go b/netbox/models/dcim_rack_roles_list_okbody.go deleted file mode 100644 index c3572336b1611ffcea6b9426764159291ccab018..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_rack_roles_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimRackRolesListOKBody dcim rack roles list o k body -// swagger:model dcimRackRolesListOKBody -type DcimRackRolesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimRackRolesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim rack roles list o k body -func (m *DcimRackRolesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimRackRolesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimRackRolesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimRackRolesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimRackRolesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimRackRolesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_rack_roles_list_okbody_results.go b/netbox/models/dcim_rack_roles_list_okbody_results.go deleted file mode 100644 index f594fe69372166d2637720895d70133300afa10d..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_rack_roles_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimRackRolesListOKBodyResults dcim rack roles list o k body results -// swagger:model dcimRackRolesListOKBodyResults -type DcimRackRolesListOKBodyResults []*RackRole - -// Validate validates this dcim rack roles list o k body results -func (m DcimRackRolesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_racks_list_okbody.go b/netbox/models/dcim_racks_list_okbody.go deleted file mode 100644 index 96cd252aeb1635fa8761866548ebbffe8e515d9b..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_racks_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimRacksListOKBody dcim racks list o k body -// swagger:model dcimRacksListOKBody -type DcimRacksListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimRacksListOKBodyResults `json:"results"` -} - -// Validate validates this dcim racks list o k body -func (m *DcimRacksListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimRacksListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimRacksListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimRacksListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimRacksListOKBody) UnmarshalBinary(b []byte) error { - var res DcimRacksListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_racks_list_okbody_results.go b/netbox/models/dcim_racks_list_okbody_results.go deleted file mode 100644 index cc7d7b8591ddc8f2eba5e409ef3449dbda71aaed..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_racks_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimRacksListOKBodyResults dcim racks list o k body results -// swagger:model dcimRacksListOKBodyResults -type DcimRacksListOKBodyResults []*Rack - -// Validate validates this dcim racks list o k body results -func (m DcimRacksListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_regions_list_okbody.go b/netbox/models/dcim_regions_list_okbody.go deleted file mode 100644 index 31ee20b028c8bb50d73b9bfcf6b6dd7d3fb32c22..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_regions_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimRegionsListOKBody dcim regions list o k body -// swagger:model dcimRegionsListOKBody -type DcimRegionsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimRegionsListOKBodyResults `json:"results"` -} - -// Validate validates this dcim regions list o k body -func (m *DcimRegionsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimRegionsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimRegionsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimRegionsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimRegionsListOKBody) UnmarshalBinary(b []byte) error { - var res DcimRegionsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_regions_list_okbody_results.go b/netbox/models/dcim_regions_list_okbody_results.go deleted file mode 100644 index 15140140860b5d66229aee92eae22c2dbbab21a2..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_regions_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimRegionsListOKBodyResults dcim regions list o k body results -// swagger:model dcimRegionsListOKBodyResults -type DcimRegionsListOKBodyResults []*Region - -// Validate validates this dcim regions list o k body results -func (m DcimRegionsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_sites_list_okbody.go b/netbox/models/dcim_sites_list_okbody.go deleted file mode 100644 index 4747a37a3dce4e7099135d1ec6d5b595b798f988..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_sites_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimSitesListOKBody dcim sites list o k body -// swagger:model dcimSitesListOKBody -type DcimSitesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimSitesListOKBodyResults `json:"results"` -} - -// Validate validates this dcim sites list o k body -func (m *DcimSitesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimSitesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimSitesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimSitesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimSitesListOKBody) UnmarshalBinary(b []byte) error { - var res DcimSitesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_sites_list_okbody_results.go b/netbox/models/dcim_sites_list_okbody_results.go deleted file mode 100644 index 837a6582aa60c02a85d505e5ddcf429cae62520e..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_sites_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimSitesListOKBodyResults dcim sites list o k body results -// swagger:model dcimSitesListOKBodyResults -type DcimSitesListOKBodyResults []*Site - -// Validate validates this dcim sites list o k body results -func (m DcimSitesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/dcim_virtual_chassis_list_okbody.go b/netbox/models/dcim_virtual_chassis_list_okbody.go deleted file mode 100644 index 15c3dcf9b549f26fab0d7f5e66c8e409f1399d17..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_virtual_chassis_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DcimVirtualChassisListOKBody dcim virtual chassis list o k body -// swagger:model dcimVirtualChassisListOKBody -type DcimVirtualChassisListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results DcimVirtualChassisListOKBodyResults `json:"results"` -} - -// Validate validates this dcim virtual chassis list o k body -func (m *DcimVirtualChassisListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DcimVirtualChassisListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *DcimVirtualChassisListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DcimVirtualChassisListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DcimVirtualChassisListOKBody) UnmarshalBinary(b []byte) error { - var res DcimVirtualChassisListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/dcim_virtual_chassis_list_okbody_results.go b/netbox/models/dcim_virtual_chassis_list_okbody_results.go deleted file mode 100644 index c93a342c962f15fd5c9ae50bb027b698b67d0a26..0000000000000000000000000000000000000000 --- a/netbox/models/dcim_virtual_chassis_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// DcimVirtualChassisListOKBodyResults dcim virtual chassis list o k body results -// swagger:model dcimVirtualChassisListOKBodyResults -type DcimVirtualChassisListOKBodyResults []*VirtualChassis - -// Validate validates this dcim virtual chassis list o k body results -func (m DcimVirtualChassisListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/device.go b/netbox/models/device.go index 5b4486aad6a4a8196e320c67f2bd45e5ee2f7c41..7d465026b1ce1be2dd82882492bd7b67d523dd04 100644 --- a/netbox/models/device.go +++ b/netbox/models/device.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -35,17 +37,17 @@ type Device struct { // // A unique tag used to identify this device // Max Length: 50 - AssetTag string `json:"asset_tag,omitempty"` + AssetTag *string `json:"asset_tag,omitempty"` // cluster - // Required: true - Cluster *NestedCluster `json:"cluster"` + Cluster *NestedCluster `json:"cluster,omitempty"` // Comments Comments string `json:"comments,omitempty"` // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -64,8 +66,7 @@ type Device struct { DisplayName string `json:"display_name,omitempty"` // face - // Required: true - Face *DeviceFace `json:"face"` + Face *DeviceFace `json:"face,omitempty"` // ID // Read Only: true @@ -73,43 +74,40 @@ type Device struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Local context data + LocalContextData *string `json:"local_context_data,omitempty"` + // Name // Max Length: 64 - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` - // Parent device - // Read Only: true - ParentDevice string `json:"parent_device,omitempty"` + // parent device + ParentDevice *NestedDevice `json:"parent_device,omitempty"` // platform - // Required: true - Platform *NestedPlatform `json:"platform"` + Platform *NestedPlatform `json:"platform,omitempty"` // Position (U) // // The lowest-numbered unit occupied by the device - // Required: true // Maximum: 32767 // Minimum: 1 - Position *int64 `json:"position"` + Position *int64 `json:"position,omitempty"` // primary ip - // Required: true - PrimaryIP *DeviceIPAddress `json:"primary_ip"` + PrimaryIP *NestedIPAddress `json:"primary_ip,omitempty"` // primary ip4 - // Required: true - PrimaryIp4 *DeviceIPAddress `json:"primary_ip4"` + PrimaryIp4 *NestedIPAddress `json:"primary_ip4,omitempty"` // primary ip6 - // Required: true - PrimaryIp6 *DeviceIPAddress `json:"primary_ip6"` + PrimaryIp6 *NestedIPAddress `json:"primary_ip6,omitempty"` // rack - // Required: true - Rack *NestedRack `json:"rack"` + Rack *NestedRack `json:"rack,omitempty"` // Serial number // Max Length: 50 @@ -120,18 +118,18 @@ type Device struct { Site *NestedSite `json:"site"` // status - // Required: true - Status *DeviceStatus `json:"status"` + Status *DeviceStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // Vc position - // Required: true // Maximum: 255 // Minimum: 0 - VcPosition *int64 `json:"vc_position"` + VcPosition *int64 `json:"vc_position,omitempty"` // Vc priority // Maximum: 255 @@ -139,8 +137,7 @@ type Device struct { VcPriority *int64 `json:"vc_priority,omitempty"` // virtual chassis - // Required: true - VirtualChassis *DeviceVirtualChassis `json:"virtual_chassis"` + VirtualChassis *NestedVirtualChassis `json:"virtual_chassis,omitempty"` } // Validate validates this device @@ -148,97 +145,94 @@ func (m *Device) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAssetTag(formats); err != nil { - // prop res = append(res, err) } if err := m.validateCluster(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDeviceRole(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateFace(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateParentDevice(formats); err != nil { res = append(res, err) } if err := m.validatePlatform(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePosition(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePrimaryIP(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePrimaryIp4(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePrimaryIp6(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRack(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSerial(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVcPosition(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVcPriority(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVirtualChassis(formats); err != nil { - // prop res = append(res, err) } @@ -254,7 +248,7 @@ func (m *Device) validateAssetTag(formats strfmt.Registry) error { return nil } - if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + if err := validate.MaxLength("asset_tag", "body", string(*m.AssetTag), 50); err != nil { return err } @@ -263,12 +257,11 @@ func (m *Device) validateAssetTag(formats strfmt.Registry) error { func (m *Device) validateCluster(formats strfmt.Registry) error { - if err := validate.Required("cluster", "body", m.Cluster); err != nil { - return err + if swag.IsZero(m.Cluster) { // not required + return nil } if m.Cluster != nil { - if err := m.Cluster.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cluster") @@ -280,6 +273,19 @@ func (m *Device) validateCluster(formats strfmt.Registry) error { return nil } +func (m *Device) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Device) validateDeviceRole(formats strfmt.Registry) error { if err := validate.Required("device_role", "body", m.DeviceRole); err != nil { @@ -287,7 +293,6 @@ func (m *Device) validateDeviceRole(formats strfmt.Registry) error { } if m.DeviceRole != nil { - if err := m.DeviceRole.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device_role") @@ -306,7 +311,6 @@ func (m *Device) validateDeviceType(formats strfmt.Registry) error { } if m.DeviceType != nil { - if err := m.DeviceType.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device_type") @@ -320,12 +324,11 @@ func (m *Device) validateDeviceType(formats strfmt.Registry) error { func (m *Device) validateFace(formats strfmt.Registry) error { - if err := validate.Required("face", "body", m.Face); err != nil { - return err + if swag.IsZero(m.Face) { // not required + return nil } if m.Face != nil { - if err := m.Face.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("face") @@ -337,27 +340,57 @@ func (m *Device) validateFace(formats strfmt.Registry) error { return nil } +func (m *Device) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Device) validateName(formats strfmt.Registry) error { if swag.IsZero(m.Name) { // not required return nil } - if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } return nil } +func (m *Device) validateParentDevice(formats strfmt.Registry) error { + + if swag.IsZero(m.ParentDevice) { // not required + return nil + } + + if m.ParentDevice != nil { + if err := m.ParentDevice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent_device") + } + return err + } + } + + return nil +} + func (m *Device) validatePlatform(formats strfmt.Registry) error { - if err := validate.Required("platform", "body", m.Platform); err != nil { - return err + if swag.IsZero(m.Platform) { // not required + return nil } if m.Platform != nil { - if err := m.Platform.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("platform") @@ -371,8 +404,8 @@ func (m *Device) validatePlatform(formats strfmt.Registry) error { func (m *Device) validatePosition(formats strfmt.Registry) error { - if err := validate.Required("position", "body", m.Position); err != nil { - return err + if swag.IsZero(m.Position) { // not required + return nil } if err := validate.MinimumInt("position", "body", int64(*m.Position), 1, false); err != nil { @@ -388,12 +421,11 @@ func (m *Device) validatePosition(formats strfmt.Registry) error { func (m *Device) validatePrimaryIP(formats strfmt.Registry) error { - if err := validate.Required("primary_ip", "body", m.PrimaryIP); err != nil { - return err + if swag.IsZero(m.PrimaryIP) { // not required + return nil } if m.PrimaryIP != nil { - if err := m.PrimaryIP.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary_ip") @@ -407,12 +439,11 @@ func (m *Device) validatePrimaryIP(formats strfmt.Registry) error { func (m *Device) validatePrimaryIp4(formats strfmt.Registry) error { - if err := validate.Required("primary_ip4", "body", m.PrimaryIp4); err != nil { - return err + if swag.IsZero(m.PrimaryIp4) { // not required + return nil } if m.PrimaryIp4 != nil { - if err := m.PrimaryIp4.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary_ip4") @@ -426,12 +457,11 @@ func (m *Device) validatePrimaryIp4(formats strfmt.Registry) error { func (m *Device) validatePrimaryIp6(formats strfmt.Registry) error { - if err := validate.Required("primary_ip6", "body", m.PrimaryIp6); err != nil { - return err + if swag.IsZero(m.PrimaryIp6) { // not required + return nil } if m.PrimaryIp6 != nil { - if err := m.PrimaryIp6.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary_ip6") @@ -445,12 +475,11 @@ func (m *Device) validatePrimaryIp6(formats strfmt.Registry) error { func (m *Device) validateRack(formats strfmt.Registry) error { - if err := validate.Required("rack", "body", m.Rack); err != nil { - return err + if swag.IsZero(m.Rack) { // not required + return nil } if m.Rack != nil { - if err := m.Rack.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rack") @@ -482,7 +511,6 @@ func (m *Device) validateSite(formats strfmt.Registry) error { } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -496,12 +524,11 @@ func (m *Device) validateSite(formats strfmt.Registry) error { func (m *Device) validateStatus(formats strfmt.Registry) error { - if err := validate.Required("status", "body", m.Status); err != nil { - return err + if swag.IsZero(m.Status) { // not required + return nil } if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") @@ -513,14 +540,30 @@ func (m *Device) validateStatus(formats strfmt.Registry) error { return nil } +func (m *Device) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *Device) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -534,8 +577,8 @@ func (m *Device) validateTenant(formats strfmt.Registry) error { func (m *Device) validateVcPosition(formats strfmt.Registry) error { - if err := validate.Required("vc_position", "body", m.VcPosition); err != nil { - return err + if swag.IsZero(m.VcPosition) { // not required + return nil } if err := validate.MinimumInt("vc_position", "body", int64(*m.VcPosition), 0, false); err != nil { @@ -568,12 +611,11 @@ func (m *Device) validateVcPriority(formats strfmt.Registry) error { func (m *Device) validateVirtualChassis(formats strfmt.Registry) error { - if err := validate.Required("virtual_chassis", "body", m.VirtualChassis); err != nil { - return err + if swag.IsZero(m.VirtualChassis) { // not required + return nil } if m.VirtualChassis != nil { - if err := m.VirtualChassis.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("virtual_chassis") @@ -602,3 +644,137 @@ func (m *Device) UnmarshalBinary(b []byte) error { *m = res return nil } + +// DeviceFace Face +// swagger:model DeviceFace +type DeviceFace struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device face +func (m *DeviceFace) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceFace) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("face"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceFace) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("face"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceFace) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceFace) UnmarshalBinary(b []byte) error { + var res DeviceFace + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DeviceStatus Status +// swagger:model DeviceStatus +type DeviceStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device status +func (m *DeviceStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceStatus) UnmarshalBinary(b []byte) error { + var res DeviceStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_bay.go b/netbox/models/device_bay.go index 9843586a4916f7959ce4ae3a68f81cfcae0fb180..0eff1399590e44a90a98fe4d4b60551ed9e8784d 100644 --- a/netbox/models/device_bay.go +++ b/netbox/models/device_bay.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -31,6 +33,10 @@ import ( // swagger:model DeviceBay type DeviceBay struct { + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // device // Required: true Device *NestedDevice `json:"device"` @@ -40,31 +46,39 @@ type DeviceBay struct { ID int64 `json:"id,omitempty"` // installed device - // Required: true - InstalledDevice *NestedDevice `json:"installed_device"` + InstalledDevice *NestedDevice `json:"installed_device,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // tags + Tags []string `json:"tags"` } // Validate validates this device bay func (m *DeviceBay) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateInstalledDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -74,6 +88,19 @@ func (m *DeviceBay) Validate(formats strfmt.Registry) error { return nil } +func (m *DeviceBay) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *DeviceBay) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -81,7 +108,6 @@ func (m *DeviceBay) validateDevice(formats strfmt.Registry) error { } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -95,12 +121,11 @@ func (m *DeviceBay) validateDevice(formats strfmt.Registry) error { func (m *DeviceBay) validateInstalledDevice(formats strfmt.Registry) error { - if err := validate.Required("installed_device", "body", m.InstalledDevice); err != nil { - return err + if swag.IsZero(m.InstalledDevice) { // not required + return nil } if m.InstalledDevice != nil { - if err := m.InstalledDevice.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("installed_device") @@ -118,6 +143,10 @@ func (m *DeviceBay) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -125,6 +154,23 @@ func (m *DeviceBay) validateName(formats strfmt.Registry) error { return nil } +func (m *DeviceBay) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *DeviceBay) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/device_bay_template.go b/netbox/models/device_bay_template.go index a88e332ab83ed10682e21a9715c4d0ffa46a4463..24db6932b56b358d3416079c265866ac29dbbeba 100644 --- a/netbox/models/device_bay_template.go +++ b/netbox/models/device_bay_template.go @@ -42,6 +42,7 @@ type DeviceBayTemplate struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` } @@ -50,12 +51,10 @@ func (m *DeviceBayTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } @@ -72,7 +71,6 @@ func (m *DeviceBayTemplate) validateDeviceType(formats strfmt.Registry) error { } if m.DeviceType != nil { - if err := m.DeviceType.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device_type") @@ -90,6 +88,10 @@ func (m *DeviceBayTemplate) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } diff --git a/netbox/models/device_face.go b/netbox/models/device_face.go deleted file mode 100644 index 5b87c7726cfa2d12276b2f5eb51e77c7878a15eb..0000000000000000000000000000000000000000 --- a/netbox/models/device_face.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeviceFace Face -// swagger:model deviceFace -type DeviceFace struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this device face -func (m *DeviceFace) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeviceFace) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *DeviceFace) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeviceFace) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeviceFace) UnmarshalBinary(b []byte) error { - var res DeviceFace - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/device_interface.go b/netbox/models/device_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..46d19bb93220dda157c8c35068ce769391841c63 --- /dev/null +++ b/netbox/models/device_interface.go @@ -0,0 +1,698 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceInterface device interface +// swagger:model DeviceInterface +type DeviceInterface struct { + + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // connection status + ConnectionStatus *DeviceInterfaceConnectionStatus `json:"connection_status,omitempty"` + + // Count ipaddresses + // Read Only: true + CountIpaddresses string `json:"count_ipaddresses,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // form factor + FormFactor *DeviceInterfaceFormFactor `json:"form_factor,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // lag + Lag *NestedInterface `json:"lag,omitempty"` + + // MAC Address + MacAddress *string `json:"mac_address,omitempty"` + + // OOB Management + // + // This interface is used only for out-of-band management + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // mode + Mode *DeviceInterfaceMode `json:"mode,omitempty"` + + // MTU + // Maximum: 65536 + // Minimum: 1 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // tagged vlans + // Unique: true + TaggedVlans []*NestedVLAN `json:"tagged_vlans"` + + // tags + Tags []string `json:"tags"` + + // type + Type *DeviceInterfaceType `json:"type,omitempty"` + + // untagged vlan + UntaggedVlan *NestedVLAN `json:"untagged_vlan,omitempty"` +} + +// Validate validates this device interface +func (m *DeviceInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaggedVlans(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUntaggedVlan(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceInterface) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +func (m *DeviceInterface) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + if m.ConnectionStatus != nil { + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + } + + return nil +} + +func (m *DeviceInterface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *DeviceInterface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *DeviceInterface) validateFormFactor(formats strfmt.Registry) error { + + if swag.IsZero(m.FormFactor) { // not required + return nil + } + + if m.FormFactor != nil { + if err := m.FormFactor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("form_factor") + } + return err + } + } + + return nil +} + +func (m *DeviceInterface) validateLag(formats strfmt.Registry) error { + + if swag.IsZero(m.Lag) { // not required + return nil + } + + if m.Lag != nil { + if err := m.Lag.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lag") + } + return err + } + } + + return nil +} + +func (m *DeviceInterface) validateMode(formats strfmt.Registry) error { + + if swag.IsZero(m.Mode) { // not required + return nil + } + + if m.Mode != nil { + if err := m.Mode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mode") + } + return err + } + } + + return nil +} + +func (m *DeviceInterface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 65536, false); err != nil { + return err + } + + return nil +} + +func (m *DeviceInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *DeviceInterface) validateTaggedVlans(formats strfmt.Registry) error { + + if swag.IsZero(m.TaggedVlans) { // not required + return nil + } + + if err := validate.UniqueItems("tagged_vlans", "body", m.TaggedVlans); err != nil { + return err + } + + for i := 0; i < len(m.TaggedVlans); i++ { + if swag.IsZero(m.TaggedVlans[i]) { // not required + continue + } + + if m.TaggedVlans[i] != nil { + if err := m.TaggedVlans[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagged_vlans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *DeviceInterface) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +func (m *DeviceInterface) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *DeviceInterface) validateUntaggedVlan(formats strfmt.Registry) error { + + if swag.IsZero(m.UntaggedVlan) { // not required + return nil + } + + if m.UntaggedVlan != nil { + if err := m.UntaggedVlan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("untagged_vlan") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceInterface) UnmarshalBinary(b []byte) error { + var res DeviceInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DeviceInterfaceConnectionStatus Connection status +// swagger:model DeviceInterfaceConnectionStatus +type DeviceInterfaceConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this device interface connection status +func (m *DeviceInterfaceConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceInterfaceConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceInterfaceConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceInterfaceConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceInterfaceConnectionStatus) UnmarshalBinary(b []byte) error { + var res DeviceInterfaceConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DeviceInterfaceFormFactor Form factor +// swagger:model DeviceInterfaceFormFactor +type DeviceInterfaceFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device interface form factor +func (m *DeviceInterfaceFormFactor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceInterfaceFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("form_factor"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceInterfaceFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("form_factor"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceInterfaceFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceInterfaceFormFactor) UnmarshalBinary(b []byte) error { + var res DeviceInterfaceFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DeviceInterfaceMode Mode +// swagger:model DeviceInterfaceMode +type DeviceInterfaceMode struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device interface mode +func (m *DeviceInterfaceMode) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceInterfaceMode) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("mode"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceInterfaceMode) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("mode"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceInterfaceMode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceInterfaceMode) UnmarshalBinary(b []byte) error { + var res DeviceInterfaceMode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DeviceInterfaceType Type +// swagger:model DeviceInterfaceType +type DeviceInterfaceType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device interface type +func (m *DeviceInterfaceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceInterfaceType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceInterfaceType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceInterfaceType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceInterfaceType) UnmarshalBinary(b []byte) error { + var res DeviceInterfaceType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_ip_address.go b/netbox/models/device_ip_address.go deleted file mode 100644 index 6d265fd2794d864b1a1acaad7fd3836a7ce61055..0000000000000000000000000000000000000000 --- a/netbox/models/device_ip_address.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeviceIPAddress Primary ip -// swagger:model DeviceIPAddress -type DeviceIPAddress struct { - - // Address - // - // IPv4 or IPv6 address (with mask) - // Required: true - Address *string `json:"address"` - - // Family - // Read Only: true - Family int64 `json:"family,omitempty"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Url - // Read Only: true - URL strfmt.URI `json:"url,omitempty"` -} - -// Validate validates this device IP address -func (m *DeviceIPAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeviceIPAddress) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeviceIPAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeviceIPAddress) UnmarshalBinary(b []byte) error { - var res DeviceIPAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/device_role.go b/netbox/models/device_role.go index 4413d05a669c9ca3fd8c7b5a6e4c9c79dc8d4b57..4ef96fb3a92897d7f7eaf3409aafd45a7e435411 100644 --- a/netbox/models/device_role.go +++ b/netbox/models/device_role.go @@ -34,9 +34,14 @@ type DeviceRole struct { // Color // Required: true // Max Length: 6 + // Min Length: 1 // Pattern: ^[0-9a-f]{6}$ Color *string `json:"color"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -44,14 +49,20 @@ type DeviceRole struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` + // VM Role // // Virtual machines may be assigned to this role @@ -63,17 +74,14 @@ func (m *DeviceRole) Validate(formats strfmt.Registry) error { var res []error if err := m.validateColor(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -89,6 +97,10 @@ func (m *DeviceRole) validateColor(formats strfmt.Registry) error { return err } + if err := validate.MinLength("color", "body", string(*m.Color), 1); err != nil { + return err + } + if err := validate.MaxLength("color", "body", string(*m.Color), 6); err != nil { return err } @@ -106,6 +118,10 @@ func (m *DeviceRole) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -119,6 +135,10 @@ func (m *DeviceRole) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/device_status.go b/netbox/models/device_status.go deleted file mode 100644 index cf2f5aad0b93ee88b89da2fa1dced0bab8352f64..0000000000000000000000000000000000000000 --- a/netbox/models/device_status.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeviceStatus Status -// swagger:model deviceStatus -type DeviceStatus struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this device status -func (m *DeviceStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeviceStatus) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *DeviceStatus) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeviceStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeviceStatus) UnmarshalBinary(b []byte) error { - var res DeviceStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/device_type.go b/netbox/models/device_type.go index e6c167a8e1b94eb39876cab63548d216313b9e48..10cf72be9d1897c58d8a1edd1601675b966db913 100644 --- a/netbox/models/device_type.go +++ b/netbox/models/device_type.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -34,40 +36,35 @@ type DeviceType struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` - // ID + // Device count // Read Only: true - ID int64 `json:"id,omitempty"` + DeviceCount int64 `json:"device_count,omitempty"` - // Instance count + // Display name // Read Only: true - InstanceCount int64 `json:"instance_count,omitempty"` - - // interface ordering - // Required: true - InterfaceOrdering *DeviceTypeInterfaceOrdering `json:"interface_ordering"` + DisplayName string `json:"display_name,omitempty"` - // Is a console server - // - // This type of device has console server ports - IsConsoleServer bool `json:"is_console_server,omitempty"` + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` // Is full depth // // Device consumes both front and rear rack faces IsFullDepth bool `json:"is_full_depth,omitempty"` - // Is a network device - // - // This type of device has network interfaces - IsNetworkDevice bool `json:"is_network_device,omitempty"` - - // Is a PDU - // - // This type of device has power outlets - IsPdu bool `json:"is_pdu,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // manufacturer // Required: true @@ -76,6 +73,7 @@ type DeviceType struct { // Model // Required: true // Max Length: 50 + // Min Length: 1 Model *string `json:"model"` // Part number @@ -87,12 +85,15 @@ type DeviceType struct { // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // subdevice role - // Required: true - SubdeviceRole *DeviceTypeSubdeviceRole `json:"subdevice_role"` + SubdeviceRole *DeviceTypeSubdeviceRole `json:"subdevice_role,omitempty"` + + // tags + Tags []string `json:"tags"` // Height (U) // Maximum: 32767 @@ -104,38 +105,39 @@ type DeviceType struct { func (m *DeviceType) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateInterfaceOrdering(formats); err != nil { - // prop + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateManufacturer(formats); err != nil { - // prop res = append(res, err) } if err := m.validateModel(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePartNumber(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSubdeviceRole(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateUHeight(formats); err != nil { - // prop res = append(res, err) } @@ -145,20 +147,27 @@ func (m *DeviceType) Validate(formats strfmt.Registry) error { return nil } -func (m *DeviceType) validateInterfaceOrdering(formats strfmt.Registry) error { +func (m *DeviceType) validateCreated(formats strfmt.Registry) error { - if err := validate.Required("interface_ordering", "body", m.InterfaceOrdering); err != nil { + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { return err } - if m.InterfaceOrdering != nil { + return nil +} - if err := m.InterfaceOrdering.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("interface_ordering") - } - return err - } +func (m *DeviceType) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err } return nil @@ -171,7 +180,6 @@ func (m *DeviceType) validateManufacturer(formats strfmt.Registry) error { } if m.Manufacturer != nil { - if err := m.Manufacturer.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("manufacturer") @@ -189,6 +197,10 @@ func (m *DeviceType) validateModel(formats strfmt.Registry) error { return err } + if err := validate.MinLength("model", "body", string(*m.Model), 1); err != nil { + return err + } + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { return err } @@ -215,6 +227,10 @@ func (m *DeviceType) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -228,12 +244,11 @@ func (m *DeviceType) validateSlug(formats strfmt.Registry) error { func (m *DeviceType) validateSubdeviceRole(formats strfmt.Registry) error { - if err := validate.Required("subdevice_role", "body", m.SubdeviceRole); err != nil { - return err + if swag.IsZero(m.SubdeviceRole) { // not required + return nil } if m.SubdeviceRole != nil { - if err := m.SubdeviceRole.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("subdevice_role") @@ -245,6 +260,23 @@ func (m *DeviceType) validateSubdeviceRole(formats strfmt.Registry) error { return nil } +func (m *DeviceType) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *DeviceType) validateUHeight(formats strfmt.Registry) error { if swag.IsZero(m.UHeight) { // not required @@ -279,3 +311,70 @@ func (m *DeviceType) UnmarshalBinary(b []byte) error { *m = res return nil } + +// DeviceTypeSubdeviceRole Subdevice role +// swagger:model DeviceTypeSubdeviceRole +type DeviceTypeSubdeviceRole struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this device type subdevice role +func (m *DeviceTypeSubdeviceRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceTypeSubdeviceRole) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("subdevice_role"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceTypeSubdeviceRole) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("subdevice_role"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceTypeSubdeviceRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceTypeSubdeviceRole) UnmarshalBinary(b []byte) error { + var res DeviceTypeSubdeviceRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_type_interface_ordering.go b/netbox/models/device_type_interface_ordering.go deleted file mode 100644 index cc49a40efb5a385f667ed0ad72131f77c122eec2..0000000000000000000000000000000000000000 --- a/netbox/models/device_type_interface_ordering.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeviceTypeInterfaceOrdering Interface ordering -// swagger:model deviceTypeInterfaceOrdering -type DeviceTypeInterfaceOrdering struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this device type interface ordering -func (m *DeviceTypeInterfaceOrdering) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeviceTypeInterfaceOrdering) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *DeviceTypeInterfaceOrdering) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeviceTypeInterfaceOrdering) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeviceTypeInterfaceOrdering) UnmarshalBinary(b []byte) error { - var res DeviceTypeInterfaceOrdering - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/device_type_subdevice_role.go b/netbox/models/device_type_subdevice_role.go deleted file mode 100644 index 10566f9a6c027c7106dfe40605dc4a0564c14f37..0000000000000000000000000000000000000000 --- a/netbox/models/device_type_subdevice_role.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeviceTypeSubdeviceRole Subdevice role -// swagger:model deviceTypeSubdeviceRole -type DeviceTypeSubdeviceRole struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *bool `json:"value"` -} - -// Validate validates this device type subdevice role -func (m *DeviceTypeSubdeviceRole) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DeviceTypeSubdeviceRole) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *DeviceTypeSubdeviceRole) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DeviceTypeSubdeviceRole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DeviceTypeSubdeviceRole) UnmarshalBinary(b []byte) error { - var res DeviceTypeSubdeviceRole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/device_with_config_context.go b/netbox/models/device_with_config_context.go new file mode 100644 index 0000000000000000000000000000000000000000..b397cc6a9dd55a76f991415e8d3c75405fd45b79 --- /dev/null +++ b/netbox/models/device_with_config_context.go @@ -0,0 +1,784 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeviceWithConfigContext device with config context +// swagger:model DeviceWithConfigContext +type DeviceWithConfigContext struct { + + // Asset tag + // + // A unique tag used to identify this device + // Max Length: 50 + AssetTag *string `json:"asset_tag,omitempty"` + + // cluster + Cluster *NestedCluster `json:"cluster,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Config context + // Read Only: true + ConfigContext map[string]string `json:"config_context,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // device role + // Required: true + DeviceRole *NestedDeviceRole `json:"device_role"` + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // face + Face *DeviceWithConfigContextFace `json:"face,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Local context data + LocalContextData *string `json:"local_context_data,omitempty"` + + // Name + // Max Length: 64 + Name *string `json:"name,omitempty"` + + // parent device + ParentDevice *NestedDevice `json:"parent_device,omitempty"` + + // platform + Platform *NestedPlatform `json:"platform,omitempty"` + + // Position (U) + // + // The lowest-numbered unit occupied by the device + // Maximum: 32767 + // Minimum: 1 + Position *int64 `json:"position,omitempty"` + + // primary ip + PrimaryIP *NestedIPAddress `json:"primary_ip,omitempty"` + + // primary ip4 + PrimaryIp4 *NestedIPAddress `json:"primary_ip4,omitempty"` + + // primary ip6 + PrimaryIp6 *NestedIPAddress `json:"primary_ip6,omitempty"` + + // rack + Rack *NestedRack `json:"rack,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // status + Status *DeviceWithConfigContextStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` + + // tenant + Tenant *NestedTenant `json:"tenant,omitempty"` + + // Vc position + // Maximum: 255 + // Minimum: 0 + VcPosition *int64 `json:"vc_position,omitempty"` + + // Vc priority + // Maximum: 255 + // Minimum: 0 + VcPriority *int64 `json:"vc_priority,omitempty"` + + // virtual chassis + VirtualChassis *NestedVirtualChassis `json:"virtual_chassis,omitempty"` +} + +// Validate validates this device with config context +func (m *DeviceWithConfigContext) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCluster(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeviceRole(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeviceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFace(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParentDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePlatform(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimaryIP(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimaryIp4(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimaryIp6(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRack(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVcPosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVcPriority(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVirtualChassis(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceWithConfigContext) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(*m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContext) validateCluster(formats strfmt.Registry) error { + + if swag.IsZero(m.Cluster) { // not required + return nil + } + + if m.Cluster != nil { + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContext) validateDeviceRole(formats strfmt.Registry) error { + + if err := validate.Required("device_role", "body", m.DeviceRole); err != nil { + return err + } + + if m.DeviceRole != nil { + if err := m.DeviceRole.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_role") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateFace(formats strfmt.Registry) error { + + if swag.IsZero(m.Face) { // not required + return nil + } + + if m.Face != nil { + if err := m.Face.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("face") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContext) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContext) validateParentDevice(formats strfmt.Registry) error { + + if swag.IsZero(m.ParentDevice) { // not required + return nil + } + + if m.ParentDevice != nil { + if err := m.ParentDevice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent_device") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validatePlatform(formats strfmt.Registry) error { + + if swag.IsZero(m.Platform) { // not required + return nil + } + + if m.Platform != nil { + if err := m.Platform.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("platform") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validatePosition(formats strfmt.Registry) error { + + if swag.IsZero(m.Position) { // not required + return nil + } + + if err := validate.MinimumInt("position", "body", int64(*m.Position), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("position", "body", int64(*m.Position), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContext) validatePrimaryIP(formats strfmt.Registry) error { + + if swag.IsZero(m.PrimaryIP) { // not required + return nil + } + + if m.PrimaryIP != nil { + if err := m.PrimaryIP.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validatePrimaryIp4(formats strfmt.Registry) error { + + if swag.IsZero(m.PrimaryIp4) { // not required + return nil + } + + if m.PrimaryIp4 != nil { + if err := m.PrimaryIp4.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip4") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validatePrimaryIp6(formats strfmt.Registry) error { + + if swag.IsZero(m.PrimaryIp6) { // not required + return nil + } + + if m.PrimaryIp6 != nil { + if err := m.PrimaryIp6.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip6") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateRack(formats strfmt.Registry) error { + + if swag.IsZero(m.Rack) { // not required + return nil + } + + if m.Rack != nil { + if err := m.Rack.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rack") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContext) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +func (m *DeviceWithConfigContext) validateTenant(formats strfmt.Registry) error { + + if swag.IsZero(m.Tenant) { // not required + return nil + } + + if m.Tenant != nil { + if err := m.Tenant.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tenant") + } + return err + } + } + + return nil +} + +func (m *DeviceWithConfigContext) validateVcPosition(formats strfmt.Registry) error { + + if swag.IsZero(m.VcPosition) { // not required + return nil + } + + if err := validate.MinimumInt("vc_position", "body", int64(*m.VcPosition), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vc_position", "body", int64(*m.VcPosition), 255, false); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContext) validateVcPriority(formats strfmt.Registry) error { + + if swag.IsZero(m.VcPriority) { // not required + return nil + } + + if err := validate.MinimumInt("vc_priority", "body", int64(*m.VcPriority), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vc_priority", "body", int64(*m.VcPriority), 255, false); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContext) validateVirtualChassis(formats strfmt.Registry) error { + + if swag.IsZero(m.VirtualChassis) { // not required + return nil + } + + if m.VirtualChassis != nil { + if err := m.VirtualChassis.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_chassis") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceWithConfigContext) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceWithConfigContext) UnmarshalBinary(b []byte) error { + var res DeviceWithConfigContext + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DeviceWithConfigContextFace Face +// swagger:model DeviceWithConfigContextFace +type DeviceWithConfigContextFace struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device with config context face +func (m *DeviceWithConfigContextFace) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceWithConfigContextFace) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("face"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContextFace) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("face"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceWithConfigContextFace) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceWithConfigContextFace) UnmarshalBinary(b []byte) error { + var res DeviceWithConfigContextFace + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// DeviceWithConfigContextStatus Status +// swagger:model DeviceWithConfigContextStatus +type DeviceWithConfigContextStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device with config context status +func (m *DeviceWithConfigContextStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceWithConfigContextStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceWithConfigContextStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceWithConfigContextStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceWithConfigContextStatus) UnmarshalBinary(b []byte) error { + var res DeviceWithConfigContextStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/export_template.go b/netbox/models/export_template.go index 740c074860e4a00df16c39b4310c036779dcdbec..a035cbd724d023fac9b2b7664a33e3407070bcdb 100644 --- a/netbox/models/export_template.go +++ b/netbox/models/export_template.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -48,17 +50,22 @@ type ExportTemplate struct { ID int64 `json:"id,omitempty"` // Mime type - // Max Length: 15 + // Max Length: 50 MimeType string `json:"mime_type,omitempty"` // Name // Required: true // Max Length: 100 + // Min Length: 1 Name *string `json:"name"` // Template code // Required: true + // Min Length: 1 TemplateCode *string `json:"template_code"` + + // template language + TemplateLanguage *ExportTemplateTemplateLanguage `json:"template_language,omitempty"` } // Validate validates this export template @@ -66,32 +73,30 @@ func (m *ExportTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateContentType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateFileExtension(formats); err != nil { - // prop res = append(res, err) } if err := m.validateMimeType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateTemplateCode(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTemplateLanguage(formats); err != nil { res = append(res, err) } @@ -142,7 +147,7 @@ func (m *ExportTemplate) validateMimeType(formats strfmt.Registry) error { return nil } - if err := validate.MaxLength("mime_type", "body", string(m.MimeType), 15); err != nil { + if err := validate.MaxLength("mime_type", "body", string(m.MimeType), 50); err != nil { return err } @@ -155,6 +160,10 @@ func (m *ExportTemplate) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { return err } @@ -168,6 +177,28 @@ func (m *ExportTemplate) validateTemplateCode(formats strfmt.Registry) error { return err } + if err := validate.MinLength("template_code", "body", string(*m.TemplateCode), 1); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateTemplateLanguage(formats strfmt.Registry) error { + + if swag.IsZero(m.TemplateLanguage) { // not required + return nil + } + + if m.TemplateLanguage != nil { + if err := m.TemplateLanguage.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("template_language") + } + return err + } + } + return nil } @@ -188,3 +219,83 @@ func (m *ExportTemplate) UnmarshalBinary(b []byte) error { *m = res return nil } + +// ExportTemplateTemplateLanguage Template language +// swagger:model ExportTemplateTemplateLanguage +type ExportTemplateTemplateLanguage struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +func (m *ExportTemplateTemplateLanguage) UnmarshalJSON(b []byte) error { + type ExportTemplateTemplateLanguageAlias ExportTemplateTemplateLanguage + var t ExportTemplateTemplateLanguageAlias + if err := json.Unmarshal([]byte("{\"label\":\"Jinja2\",\"value\":20}"), &t); err != nil { + return err + } + if err := json.Unmarshal(b, &t); err != nil { + return err + } + *m = ExportTemplateTemplateLanguage(t) + return nil +} + +// Validate validates this export template template language +func (m *ExportTemplateTemplateLanguage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExportTemplateTemplateLanguage) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("template_language"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplateTemplateLanguage) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("template_language"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExportTemplateTemplateLanguage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExportTemplateTemplateLanguage) UnmarshalBinary(b []byte) error { + var res ExportTemplateTemplateLanguage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/extras_export_templates_list_okbody.go b/netbox/models/extras_export_templates_list_okbody.go deleted file mode 100644 index f5ba7a1bb7b30ca64388561d15a1ee29344904cc..0000000000000000000000000000000000000000 --- a/netbox/models/extras_export_templates_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExtrasExportTemplatesListOKBody extras export templates list o k body -// swagger:model extrasExportTemplatesListOKBody -type ExtrasExportTemplatesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results ExtrasExportTemplatesListOKBodyResults `json:"results"` -} - -// Validate validates this extras export templates list o k body -func (m *ExtrasExportTemplatesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExtrasExportTemplatesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *ExtrasExportTemplatesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExtrasExportTemplatesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExtrasExportTemplatesListOKBody) UnmarshalBinary(b []byte) error { - var res ExtrasExportTemplatesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/extras_export_templates_list_okbody_results.go b/netbox/models/extras_export_templates_list_okbody_results.go deleted file mode 100644 index db9fad67ea0bf3e701b48a76dbef03bff1ab87c5..0000000000000000000000000000000000000000 --- a/netbox/models/extras_export_templates_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ExtrasExportTemplatesListOKBodyResults extras export templates list o k body results -// swagger:model extrasExportTemplatesListOKBodyResults -type ExtrasExportTemplatesListOKBodyResults []*ExportTemplate - -// Validate validates this extras export templates list o k body results -func (m ExtrasExportTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/extras_graphs_list_okbody.go b/netbox/models/extras_graphs_list_okbody.go deleted file mode 100644 index 7bca5ea1f7e168ffa7a6148a9db9323dc868c25a..0000000000000000000000000000000000000000 --- a/netbox/models/extras_graphs_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExtrasGraphsListOKBody extras graphs list o k body -// swagger:model extrasGraphsListOKBody -type ExtrasGraphsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results ExtrasGraphsListOKBodyResults `json:"results"` -} - -// Validate validates this extras graphs list o k body -func (m *ExtrasGraphsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExtrasGraphsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *ExtrasGraphsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExtrasGraphsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExtrasGraphsListOKBody) UnmarshalBinary(b []byte) error { - var res ExtrasGraphsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/extras_graphs_list_okbody_results.go b/netbox/models/extras_graphs_list_okbody_results.go deleted file mode 100644 index 909d4a0609719d0d52235860f34b06cf5af243db..0000000000000000000000000000000000000000 --- a/netbox/models/extras_graphs_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ExtrasGraphsListOKBodyResults extras graphs list o k body results -// swagger:model extrasGraphsListOKBodyResults -type ExtrasGraphsListOKBodyResults []*Graph - -// Validate validates this extras graphs list o k body results -func (m ExtrasGraphsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/extras_image_attachments_list_okbody.go b/netbox/models/extras_image_attachments_list_okbody.go deleted file mode 100644 index 6e0c2789cc1794a2bdc9e9bcb7440d2e940c5321..0000000000000000000000000000000000000000 --- a/netbox/models/extras_image_attachments_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExtrasImageAttachmentsListOKBody extras image attachments list o k body -// swagger:model extrasImageAttachmentsListOKBody -type ExtrasImageAttachmentsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results ExtrasImageAttachmentsListOKBodyResults `json:"results"` -} - -// Validate validates this extras image attachments list o k body -func (m *ExtrasImageAttachmentsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExtrasImageAttachmentsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *ExtrasImageAttachmentsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExtrasImageAttachmentsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExtrasImageAttachmentsListOKBody) UnmarshalBinary(b []byte) error { - var res ExtrasImageAttachmentsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/extras_image_attachments_list_okbody_results.go b/netbox/models/extras_image_attachments_list_okbody_results.go deleted file mode 100644 index b40eb8309f2c07f3a0960c9b0a46b32415edce9f..0000000000000000000000000000000000000000 --- a/netbox/models/extras_image_attachments_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ExtrasImageAttachmentsListOKBodyResults extras image attachments list o k body results -// swagger:model extrasImageAttachmentsListOKBodyResults -type ExtrasImageAttachmentsListOKBodyResults []*ImageAttachment - -// Validate validates this extras image attachments list o k body results -func (m ExtrasImageAttachmentsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/extras_recent_activity_list_okbody.go b/netbox/models/extras_recent_activity_list_okbody.go deleted file mode 100644 index 96eeabbdb4a4ce47f99628b8bdb27ddbea742984..0000000000000000000000000000000000000000 --- a/netbox/models/extras_recent_activity_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExtrasRecentActivityListOKBody extras recent activity list o k body -// swagger:model extrasRecentActivityListOKBody -type ExtrasRecentActivityListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results ExtrasRecentActivityListOKBodyResults `json:"results"` -} - -// Validate validates this extras recent activity list o k body -func (m *ExtrasRecentActivityListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExtrasRecentActivityListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *ExtrasRecentActivityListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExtrasRecentActivityListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExtrasRecentActivityListOKBody) UnmarshalBinary(b []byte) error { - var res ExtrasRecentActivityListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/extras_recent_activity_list_okbody_results.go b/netbox/models/extras_recent_activity_list_okbody_results.go deleted file mode 100644 index 2b6623fcf06f780a3f0349aab13d9172be3f2703..0000000000000000000000000000000000000000 --- a/netbox/models/extras_recent_activity_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ExtrasRecentActivityListOKBodyResults extras recent activity list o k body results -// swagger:model extrasRecentActivityListOKBodyResults -type ExtrasRecentActivityListOKBodyResults []*UserAction - -// Validate validates this extras recent activity list o k body results -func (m ExtrasRecentActivityListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/extras_topology_maps_list_okbody.go b/netbox/models/extras_topology_maps_list_okbody.go deleted file mode 100644 index 005d8d84bd3ab3172f324ca4fb30dc65d41a99c4..0000000000000000000000000000000000000000 --- a/netbox/models/extras_topology_maps_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExtrasTopologyMapsListOKBody extras topology maps list o k body -// swagger:model extrasTopologyMapsListOKBody -type ExtrasTopologyMapsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results ExtrasTopologyMapsListOKBodyResults `json:"results"` -} - -// Validate validates this extras topology maps list o k body -func (m *ExtrasTopologyMapsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExtrasTopologyMapsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *ExtrasTopologyMapsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExtrasTopologyMapsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExtrasTopologyMapsListOKBody) UnmarshalBinary(b []byte) error { - var res ExtrasTopologyMapsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/extras_topology_maps_list_okbody_results.go b/netbox/models/extras_topology_maps_list_okbody_results.go deleted file mode 100644 index 731cc66665d0bcdbf7986f67f7b3e01329eea877..0000000000000000000000000000000000000000 --- a/netbox/models/extras_topology_maps_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ExtrasTopologyMapsListOKBodyResults extras topology maps list o k body results -// swagger:model extrasTopologyMapsListOKBodyResults -type ExtrasTopologyMapsListOKBodyResults []*TopologyMap - -// Validate validates this extras topology maps list o k body results -func (m ExtrasTopologyMapsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/front_port.go b/netbox/models/front_port.go new file mode 100644 index 0000000000000000000000000000000000000000..f357e7b6add9d05c2ec80ee050a083dfb03ed0bf --- /dev/null +++ b/netbox/models/front_port.go @@ -0,0 +1,335 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FrontPort front port +// swagger:model FrontPort +type FrontPort struct { + + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // rear port + // Required: true + RearPort *FrontPortRearPort `json:"rear_port"` + + // Rear port position + // Maximum: 64 + // Minimum: 1 + RearPortPosition int64 `json:"rear_port_position,omitempty"` + + // tags + Tags []string `json:"tags"` + + // type + // Required: true + Type *FrontPortType `json:"type"` +} + +// Validate validates this front port +func (m *FrontPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRearPort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRearPortPosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FrontPort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +func (m *FrontPort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *FrontPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *FrontPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *FrontPort) validateRearPort(formats strfmt.Registry) error { + + if err := validate.Required("rear_port", "body", m.RearPort); err != nil { + return err + } + + if m.RearPort != nil { + if err := m.RearPort.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rear_port") + } + return err + } + } + + return nil +} + +func (m *FrontPort) validateRearPortPosition(formats strfmt.Registry) error { + + if swag.IsZero(m.RearPortPosition) { // not required + return nil + } + + if err := validate.MinimumInt("rear_port_position", "body", int64(m.RearPortPosition), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("rear_port_position", "body", int64(m.RearPortPosition), 64, false); err != nil { + return err + } + + return nil +} + +func (m *FrontPort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +func (m *FrontPort) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FrontPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FrontPort) UnmarshalBinary(b []byte) error { + var res FrontPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// FrontPortType Type +// swagger:model FrontPortType +type FrontPortType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this front port type +func (m *FrontPortType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FrontPortType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *FrontPortType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FrontPortType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FrontPortType) UnmarshalBinary(b []byte) error { + var res FrontPortType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_vlan.go b/netbox/models/front_port_rear_port.go similarity index 65% rename from netbox/models/interface_vlan.go rename to netbox/models/front_port_rear_port.go index 99d41544381a1d631687761810e9b083a14fbe35..6379d7d3da89f687a24799f12e0922947f276af2 100644 --- a/netbox/models/interface_vlan.go +++ b/netbox/models/front_port_rear_port.go @@ -27,13 +27,9 @@ import ( "github.com/go-openapi/validate" ) -// InterfaceVLAN Untagged vlan -// swagger:model InterfaceVLAN -type InterfaceVLAN struct { - - // Display name - // Read Only: true - DisplayName string `json:"display_name,omitempty"` +// FrontPortRearPort Rear port +// swagger:model FrontPortRearPort +type FrontPortRearPort struct { // ID // Read Only: true @@ -42,30 +38,24 @@ type InterfaceVLAN struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` - - // ID - // Required: true - // Maximum: 4094 - // Minimum: 1 - Vid *int64 `json:"vid"` } -// Validate validates this interface v l a n -func (m *InterfaceVLAN) Validate(formats strfmt.Registry) error { +// Validate validates this front port rear port +func (m *FrontPortRearPort) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } - if err := m.validateVid(formats); err != nil { - // prop + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -75,12 +65,16 @@ func (m *InterfaceVLAN) Validate(formats strfmt.Registry) error { return nil } -func (m *InterfaceVLAN) validateName(formats strfmt.Registry) error { +func (m *FrontPortRearPort) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -88,17 +82,13 @@ func (m *InterfaceVLAN) validateName(formats strfmt.Registry) error { return nil } -func (m *InterfaceVLAN) validateVid(formats strfmt.Registry) error { - - if err := validate.Required("vid", "body", m.Vid); err != nil { - return err - } +func (m *FrontPortRearPort) validateURL(formats strfmt.Registry) error { - if err := validate.MinimumInt("vid", "body", int64(*m.Vid), 1, false); err != nil { - return err + if swag.IsZero(m.URL) { // not required + return nil } - if err := validate.MaximumInt("vid", "body", int64(*m.Vid), 4094, false); err != nil { + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { return err } @@ -106,7 +96,7 @@ func (m *InterfaceVLAN) validateVid(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (m *InterfaceVLAN) MarshalBinary() ([]byte, error) { +func (m *FrontPortRearPort) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -114,8 +104,8 @@ func (m *InterfaceVLAN) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *InterfaceVLAN) UnmarshalBinary(b []byte) error { - var res InterfaceVLAN +func (m *FrontPortRearPort) UnmarshalBinary(b []byte) error { + var res FrontPortRearPort if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/netbox/models/front_port_template.go b/netbox/models/front_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..80273ca07098f46a29423dd6794214f9b46596bc --- /dev/null +++ b/netbox/models/front_port_template.go @@ -0,0 +1,263 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FrontPortTemplate front port template +// swagger:model FrontPortTemplate +type FrontPortTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // rear port + // Required: true + RearPort *NestedRearPortTemplate `json:"rear_port"` + + // Rear port position + // Maximum: 64 + // Minimum: 1 + RearPortPosition int64 `json:"rear_port_position,omitempty"` + + // type + // Required: true + Type *FrontPortTemplateType `json:"type"` +} + +// Validate validates this front port template +func (m *FrontPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRearPort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRearPortPosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FrontPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *FrontPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *FrontPortTemplate) validateRearPort(formats strfmt.Registry) error { + + if err := validate.Required("rear_port", "body", m.RearPort); err != nil { + return err + } + + if m.RearPort != nil { + if err := m.RearPort.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rear_port") + } + return err + } + } + + return nil +} + +func (m *FrontPortTemplate) validateRearPortPosition(formats strfmt.Registry) error { + + if swag.IsZero(m.RearPortPosition) { // not required + return nil + } + + if err := validate.MinimumInt("rear_port_position", "body", int64(m.RearPortPosition), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("rear_port_position", "body", int64(m.RearPortPosition), 64, false); err != nil { + return err + } + + return nil +} + +func (m *FrontPortTemplate) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FrontPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FrontPortTemplate) UnmarshalBinary(b []byte) error { + var res FrontPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// FrontPortTemplateType Type +// swagger:model FrontPortTemplateType +type FrontPortTemplateType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this front port template type +func (m *FrontPortTemplateType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FrontPortTemplateType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *FrontPortTemplateType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FrontPortTemplateType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FrontPortTemplateType) UnmarshalBinary(b []byte) error { + var res FrontPortTemplateType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/graph.go b/netbox/models/graph.go index 43ca2da2bddc0e5f78c931a011928422154ba519..a65ef4e43a55361f8367ac86ae7ae48e27d5757a 100644 --- a/netbox/models/graph.go +++ b/netbox/models/graph.go @@ -37,16 +37,19 @@ type Graph struct { // Link URL // Max Length: 200 + // Format: uri Link strfmt.URI `json:"link,omitempty"` // Name // Required: true // Max Length: 100 + // Min Length: 1 Name *string `json:"name"` // Source URL // Required: true // Max Length: 500 + // Min Length: 1 Source *string `json:"source"` // type @@ -64,27 +67,22 @@ func (m *Graph) Validate(formats strfmt.Registry) error { var res []error if err := m.validateLink(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSource(formats); err != nil { - // prop res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateWeight(formats); err != nil { - // prop res = append(res, err) } @@ -117,6 +115,10 @@ func (m *Graph) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { return err } @@ -130,6 +132,10 @@ func (m *Graph) validateSource(formats strfmt.Registry) error { return err } + if err := validate.MinLength("source", "body", string(*m.Source), 1); err != nil { + return err + } + if err := validate.MaxLength("source", "body", string(*m.Source), 500); err != nil { return err } @@ -144,7 +150,6 @@ func (m *Graph) validateType(formats strfmt.Registry) error { } if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("type") @@ -190,3 +195,70 @@ func (m *Graph) UnmarshalBinary(b []byte) error { *m = res return nil } + +// GraphType Type +// swagger:model GraphType +type GraphType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this graph type +func (m *GraphType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GraphType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *GraphType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GraphType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GraphType) UnmarshalBinary(b []byte) error { + var res GraphType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/graph_type.go b/netbox/models/graph_type.go deleted file mode 100644 index 62187fc6c8547f7d24aa01d4ceb02bb11a4b622f..0000000000000000000000000000000000000000 --- a/netbox/models/graph_type.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GraphType Type -// swagger:model graphType -type GraphType struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this graph type -func (m *GraphType) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GraphType) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *GraphType) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GraphType) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GraphType) UnmarshalBinary(b []byte) error { - var res GraphType - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/image_attachment.go b/netbox/models/image_attachment.go index 0149233d492c3cc6df6c2c94d3c623313e06da79..8f2c5398f07028ce1bff6847ae5a38fbd002cbda 100644 --- a/netbox/models/image_attachment.go +++ b/netbox/models/image_attachment.go @@ -31,8 +31,13 @@ import ( // swagger:model ImageAttachment type ImageAttachment struct { + // Content type + // Required: true + ContentType *string `json:"content_type"` + // Created // Read Only: true + // Format: date-time Created strfmt.DateTime `json:"created,omitempty"` // ID @@ -40,9 +45,9 @@ type ImageAttachment struct { ID int64 `json:"id,omitempty"` // Image - // Required: true // Read Only: true - Image strfmt.URI `json:"image"` + // Format: uri + Image strfmt.URI `json:"image,omitempty"` // Image height // Required: true @@ -60,32 +65,46 @@ type ImageAttachment struct { // Max Length: 50 Name string `json:"name,omitempty"` + // Object id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + ObjectID *int64 `json:"object_id"` + // Parent // Read Only: true - Parent string `json:"parent,omitempty"` + Parent map[string]string `json:"parent,omitempty"` } // Validate validates this image attachment func (m *ImageAttachment) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateImage(formats); err != nil { - // prop res = append(res, err) } if err := m.validateImageHeight(formats); err != nil { - // prop res = append(res, err) } if err := m.validateImageWidth(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateObjectID(formats); err != nil { res = append(res, err) } @@ -95,12 +114,34 @@ func (m *ImageAttachment) Validate(formats strfmt.Registry) error { return nil } -func (m *ImageAttachment) validateImage(formats strfmt.Registry) error { +func (m *ImageAttachment) validateContentType(formats strfmt.Registry) error { - if err := validate.Required("image", "body", strfmt.URI(m.Image)); err != nil { + if err := validate.Required("content_type", "body", m.ContentType); err != nil { return err } + return nil +} + +func (m *ImageAttachment) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date-time", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ImageAttachment) validateImage(formats strfmt.Registry) error { + + if swag.IsZero(m.Image) { // not required + return nil + } + if err := validate.FormatOf("image", "body", "uri", m.Image.String(), formats); err != nil { return err } @@ -155,6 +196,23 @@ func (m *ImageAttachment) validateName(formats strfmt.Registry) error { return nil } +func (m *ImageAttachment) validateObjectID(formats strfmt.Registry) error { + + if err := validate.Required("object_id", "body", m.ObjectID); err != nil { + return err + } + + if err := validate.MinimumInt("object_id", "body", int64(*m.ObjectID), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("object_id", "body", int64(*m.ObjectID), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *ImageAttachment) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/interface.go b/netbox/models/interface.go deleted file mode 100644 index e36fbb49f65b3cbe6d708bb9be87fe8d91900ba7..0000000000000000000000000000000000000000 --- a/netbox/models/interface.go +++ /dev/null @@ -1,349 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Interface Interface -// swagger:model Interface -type Interface struct { - - // circuit termination - // Required: true - CircuitTermination *InterfaceCircuitTermination `json:"circuit_termination"` - - // Description - // Max Length: 100 - Description string `json:"description,omitempty"` - - // device - // Required: true - Device *NestedDevice `json:"device"` - - // Enabled - Enabled bool `json:"enabled,omitempty"` - - // form factor - // Required: true - FormFactor *InterfaceFormFactor `json:"form_factor"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Interface connection - // Read Only: true - InterfaceConnection string `json:"interface_connection,omitempty"` - - // Is connected - // Read Only: true - IsConnected string `json:"is_connected,omitempty"` - - // lag - // Required: true - Lag *NestedInterface `json:"lag"` - - // MAC Address - MacAddress string `json:"mac_address,omitempty"` - - // OOB Management - // - // This interface is used only for out-of-band management - MgmtOnly bool `json:"mgmt_only,omitempty"` - - // mode - // Required: true - Mode *InterfaceMode `json:"mode"` - - // MTU - // Maximum: 32767 - // Minimum: 0 - Mtu *int64 `json:"mtu,omitempty"` - - // Name - // Required: true - // Max Length: 64 - Name *string `json:"name"` - - // tagged vlans - // Required: true - TaggedVlans InterfaceTaggedVlans `json:"tagged_vlans"` - - // untagged vlan - // Required: true - UntaggedVlan *InterfaceVLAN `json:"untagged_vlan"` -} - -// Validate validates this interface -func (m *Interface) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCircuitTermination(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateDevice(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateFormFactor(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateLag(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateMode(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateMtu(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateTaggedVlans(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateUntaggedVlan(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Interface) validateCircuitTermination(formats strfmt.Registry) error { - - if err := validate.Required("circuit_termination", "body", m.CircuitTermination); err != nil { - return err - } - - if m.CircuitTermination != nil { - - if err := m.CircuitTermination.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("circuit_termination") - } - return err - } - } - - return nil -} - -func (m *Interface) validateDescription(formats strfmt.Registry) error { - - if swag.IsZero(m.Description) { // not required - return nil - } - - if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { - return err - } - - return nil -} - -func (m *Interface) validateDevice(formats strfmt.Registry) error { - - if err := validate.Required("device", "body", m.Device); err != nil { - return err - } - - if m.Device != nil { - - if err := m.Device.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("device") - } - return err - } - } - - return nil -} - -func (m *Interface) validateFormFactor(formats strfmt.Registry) error { - - if err := validate.Required("form_factor", "body", m.FormFactor); err != nil { - return err - } - - if m.FormFactor != nil { - - if err := m.FormFactor.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("form_factor") - } - return err - } - } - - return nil -} - -func (m *Interface) validateLag(formats strfmt.Registry) error { - - if err := validate.Required("lag", "body", m.Lag); err != nil { - return err - } - - if m.Lag != nil { - - if err := m.Lag.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lag") - } - return err - } - } - - return nil -} - -func (m *Interface) validateMode(formats strfmt.Registry) error { - - if err := validate.Required("mode", "body", m.Mode); err != nil { - return err - } - - if m.Mode != nil { - - if err := m.Mode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mode") - } - return err - } - } - - return nil -} - -func (m *Interface) validateMtu(formats strfmt.Registry) error { - - if swag.IsZero(m.Mtu) { // not required - return nil - } - - if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { - return err - } - - return nil -} - -func (m *Interface) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { - return err - } - - return nil -} - -func (m *Interface) validateTaggedVlans(formats strfmt.Registry) error { - - if err := validate.Required("tagged_vlans", "body", m.TaggedVlans); err != nil { - return err - } - - if err := m.TaggedVlans.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tagged_vlans") - } - return err - } - - return nil -} - -func (m *Interface) validateUntaggedVlan(formats strfmt.Registry) error { - - if err := validate.Required("untagged_vlan", "body", m.UntaggedVlan); err != nil { - return err - } - - if m.UntaggedVlan != nil { - - if err := m.UntaggedVlan.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("untagged_vlan") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Interface) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Interface) UnmarshalBinary(b []byte) error { - var res Interface - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/interface_circuit_termination.go b/netbox/models/interface_circuit_termination.go deleted file mode 100644 index 6aff3dd11e18a34db7f9ef94ca4e3cbe1992b7aa..0000000000000000000000000000000000000000 --- a/netbox/models/interface_circuit_termination.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InterfaceCircuitTermination Circuit termination -// swagger:model InterfaceCircuitTermination -type InterfaceCircuitTermination struct { - - // circuit - // Required: true - Circuit *InterfaceNestedCircuit `json:"circuit"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Port speed (Kbps) - // Required: true - // Maximum: 2.147483647e+09 - // Minimum: 0 - PortSpeed *int64 `json:"port_speed"` - - // Patch panel/port(s) - // Max Length: 100 - PpInfo string `json:"pp_info,omitempty"` - - // Termination - // Required: true - TermSide *string `json:"term_side"` - - // Upstream speed (Kbps) - // - // Upstream speed, if different from port speed - // Maximum: 2.147483647e+09 - // Minimum: 0 - UpstreamSpeed *int64 `json:"upstream_speed,omitempty"` - - // Cross-connect ID - // Max Length: 50 - XconnectID string `json:"xconnect_id,omitempty"` -} - -// Validate validates this interface circuit termination -func (m *InterfaceCircuitTermination) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCircuit(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validatePortSpeed(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validatePpInfo(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateTermSide(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateUpstreamSpeed(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateXconnectID(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InterfaceCircuitTermination) validateCircuit(formats strfmt.Registry) error { - - if err := validate.Required("circuit", "body", m.Circuit); err != nil { - return err - } - - if m.Circuit != nil { - - if err := m.Circuit.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("circuit") - } - return err - } - } - - return nil -} - -func (m *InterfaceCircuitTermination) validatePortSpeed(formats strfmt.Registry) error { - - if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { - return err - } - - if err := validate.MinimumInt("port_speed", "body", int64(*m.PortSpeed), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("port_speed", "body", int64(*m.PortSpeed), 2.147483647e+09, false); err != nil { - return err - } - - return nil -} - -func (m *InterfaceCircuitTermination) validatePpInfo(formats strfmt.Registry) error { - - if swag.IsZero(m.PpInfo) { // not required - return nil - } - - if err := validate.MaxLength("pp_info", "body", string(m.PpInfo), 100); err != nil { - return err - } - - return nil -} - -var interfaceCircuitTerminationTypeTermSidePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["A","Z"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - interfaceCircuitTerminationTypeTermSidePropEnum = append(interfaceCircuitTerminationTypeTermSidePropEnum, v) - } -} - -const ( - // InterfaceCircuitTerminationTermSideA captures enum value "A" - InterfaceCircuitTerminationTermSideA string = "A" - // InterfaceCircuitTerminationTermSideZ captures enum value "Z" - InterfaceCircuitTerminationTermSideZ string = "Z" -) - -// prop value enum -func (m *InterfaceCircuitTermination) validateTermSideEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, interfaceCircuitTerminationTypeTermSidePropEnum); err != nil { - return err - } - return nil -} - -func (m *InterfaceCircuitTermination) validateTermSide(formats strfmt.Registry) error { - - if err := validate.Required("term_side", "body", m.TermSide); err != nil { - return err - } - - // value enum - if err := m.validateTermSideEnum("term_side", "body", *m.TermSide); err != nil { - return err - } - - return nil -} - -func (m *InterfaceCircuitTermination) validateUpstreamSpeed(formats strfmt.Registry) error { - - if swag.IsZero(m.UpstreamSpeed) { // not required - return nil - } - - if err := validate.MinimumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 2.147483647e+09, false); err != nil { - return err - } - - return nil -} - -func (m *InterfaceCircuitTermination) validateXconnectID(formats strfmt.Registry) error { - - if swag.IsZero(m.XconnectID) { // not required - return nil - } - - if err := validate.MaxLength("xconnect_id", "body", string(m.XconnectID), 50); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InterfaceCircuitTermination) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InterfaceCircuitTermination) UnmarshalBinary(b []byte) error { - var res InterfaceCircuitTermination - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/interface_connection.go b/netbox/models/interface_connection.go index bfd036da0c6929ab6bbaf5a69ac4dfdf999f8cf9..4b0506fe71874b8a93a1282ce96f12a2756b5e34 100644 --- a/netbox/models/interface_connection.go +++ b/netbox/models/interface_connection.go @@ -32,20 +32,14 @@ import ( type InterfaceConnection struct { // connection status - // Required: true - ConnectionStatus *InterfaceConnectionConnectionStatus `json:"connection_status"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` + ConnectionStatus *InterfaceConnectionConnectionStatus `json:"connection_status,omitempty"` // interface a - // Required: true - InterfaceA *PeerInterface `json:"interface_a"` + InterfaceA *NestedInterface `json:"interface_a,omitempty"` // interface b // Required: true - InterfaceB *PeerInterface `json:"interface_b"` + InterfaceB *NestedInterface `json:"interface_b"` } // Validate validates this interface connection @@ -53,17 +47,14 @@ func (m *InterfaceConnection) Validate(formats strfmt.Registry) error { var res []error if err := m.validateConnectionStatus(formats); err != nil { - // prop res = append(res, err) } if err := m.validateInterfaceA(formats); err != nil { - // prop res = append(res, err) } if err := m.validateInterfaceB(formats); err != nil { - // prop res = append(res, err) } @@ -75,12 +66,11 @@ func (m *InterfaceConnection) Validate(formats strfmt.Registry) error { func (m *InterfaceConnection) validateConnectionStatus(formats strfmt.Registry) error { - if err := validate.Required("connection_status", "body", m.ConnectionStatus); err != nil { - return err + if swag.IsZero(m.ConnectionStatus) { // not required + return nil } if m.ConnectionStatus != nil { - if err := m.ConnectionStatus.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("connection_status") @@ -94,12 +84,11 @@ func (m *InterfaceConnection) validateConnectionStatus(formats strfmt.Registry) func (m *InterfaceConnection) validateInterfaceA(formats strfmt.Registry) error { - if err := validate.Required("interface_a", "body", m.InterfaceA); err != nil { - return err + if swag.IsZero(m.InterfaceA) { // not required + return nil } if m.InterfaceA != nil { - if err := m.InterfaceA.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("interface_a") @@ -118,7 +107,6 @@ func (m *InterfaceConnection) validateInterfaceB(formats strfmt.Registry) error } if m.InterfaceB != nil { - if err := m.InterfaceB.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("interface_b") @@ -147,3 +135,70 @@ func (m *InterfaceConnection) UnmarshalBinary(b []byte) error { *m = res return nil } + +// InterfaceConnectionConnectionStatus Connection status +// swagger:model InterfaceConnectionConnectionStatus +type InterfaceConnectionConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this interface connection connection status +func (m *InterfaceConnectionConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceConnectionConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceConnectionConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceConnectionConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceConnectionConnectionStatus) UnmarshalBinary(b []byte) error { + var res InterfaceConnectionConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_connection_connection_status.go b/netbox/models/interface_connection_connection_status.go deleted file mode 100644 index 37766d74d7dc7ebf4e48f23cccd4a3b2467720c6..0000000000000000000000000000000000000000 --- a/netbox/models/interface_connection_connection_status.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InterfaceConnectionConnectionStatus Connection status -// swagger:model interfaceConnectionConnectionStatus -type InterfaceConnectionConnectionStatus struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *bool `json:"value"` -} - -// Validate validates this interface connection connection status -func (m *InterfaceConnectionConnectionStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InterfaceConnectionConnectionStatus) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *InterfaceConnectionConnectionStatus) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InterfaceConnectionConnectionStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InterfaceConnectionConnectionStatus) UnmarshalBinary(b []byte) error { - var res InterfaceConnectionConnectionStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/interface_form_factor.go b/netbox/models/interface_form_factor.go deleted file mode 100644 index bfb96b792b6e40c807950ee599a7a2356a1c69c4..0000000000000000000000000000000000000000 --- a/netbox/models/interface_form_factor.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InterfaceFormFactor Form factor -// swagger:model interfaceFormFactor -type InterfaceFormFactor struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this interface form factor -func (m *InterfaceFormFactor) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InterfaceFormFactor) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *InterfaceFormFactor) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InterfaceFormFactor) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InterfaceFormFactor) UnmarshalBinary(b []byte) error { - var res InterfaceFormFactor - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/interface_mode.go b/netbox/models/interface_mode.go deleted file mode 100644 index 417aa81fb9ee516bd4411c70507bcaa4b8d5e08e..0000000000000000000000000000000000000000 --- a/netbox/models/interface_mode.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InterfaceMode Mode -// swagger:model interfaceMode -type InterfaceMode struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this interface mode -func (m *InterfaceMode) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InterfaceMode) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *InterfaceMode) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InterfaceMode) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InterfaceMode) UnmarshalBinary(b []byte) error { - var res InterfaceMode - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/interface_tagged_vlans.go b/netbox/models/interface_tagged_vlans.go deleted file mode 100644 index 8771a55e489caf57543f68262f2933c5a263db69..0000000000000000000000000000000000000000 --- a/netbox/models/interface_tagged_vlans.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// InterfaceTaggedVlans interface tagged vlans -// swagger:model interfaceTaggedVlans -type InterfaceTaggedVlans []*InterfaceVLAN - -// Validate validates this interface tagged vlans -func (m InterfaceTaggedVlans) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/interface_template.go b/netbox/models/interface_template.go index d3f7ed8a4bf90605721aa5047ee2ca2d93a65889..f6a5fd24e9a4f65ea5a34dd95b44e21c5308f2a9 100644 --- a/netbox/models/interface_template.go +++ b/netbox/models/interface_template.go @@ -36,8 +36,7 @@ type InterfaceTemplate struct { DeviceType *NestedDeviceType `json:"device_type"` // form factor - // Required: true - FormFactor *InterfaceTemplateFormFactor `json:"form_factor"` + FormFactor *InterfaceTemplateFormFactor `json:"form_factor,omitempty"` // ID // Read Only: true @@ -49,7 +48,11 @@ type InterfaceTemplate struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` + + // type + Type *InterfaceTemplateType `json:"type,omitempty"` } // Validate validates this interface template @@ -57,17 +60,18 @@ func (m *InterfaceTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateFormFactor(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { res = append(res, err) } @@ -84,7 +88,6 @@ func (m *InterfaceTemplate) validateDeviceType(formats strfmt.Registry) error { } if m.DeviceType != nil { - if err := m.DeviceType.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device_type") @@ -98,12 +101,11 @@ func (m *InterfaceTemplate) validateDeviceType(formats strfmt.Registry) error { func (m *InterfaceTemplate) validateFormFactor(formats strfmt.Registry) error { - if err := validate.Required("form_factor", "body", m.FormFactor); err != nil { - return err + if swag.IsZero(m.FormFactor) { // not required + return nil } if m.FormFactor != nil { - if err := m.FormFactor.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("form_factor") @@ -121,6 +123,10 @@ func (m *InterfaceTemplate) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -128,6 +134,24 @@ func (m *InterfaceTemplate) validateName(formats strfmt.Registry) error { return nil } +func (m *InterfaceTemplate) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *InterfaceTemplate) MarshalBinary() ([]byte, error) { if m == nil { @@ -145,3 +169,137 @@ func (m *InterfaceTemplate) UnmarshalBinary(b []byte) error { *m = res return nil } + +// InterfaceTemplateFormFactor Form factor +// swagger:model InterfaceTemplateFormFactor +type InterfaceTemplateFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this interface template form factor +func (m *InterfaceTemplateFormFactor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceTemplateFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("form_factor"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceTemplateFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("form_factor"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceTemplateFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceTemplateFormFactor) UnmarshalBinary(b []byte) error { + var res InterfaceTemplateFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// InterfaceTemplateType Type +// swagger:model InterfaceTemplateType +type InterfaceTemplateType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this interface template type +func (m *InterfaceTemplateType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceTemplateType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceTemplateType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceTemplateType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceTemplateType) UnmarshalBinary(b []byte) error { + var res InterfaceTemplateType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_template_form_factor.go b/netbox/models/interface_template_form_factor.go deleted file mode 100644 index 89e8a1f9be024b6cc4602b1bfed6d2615b7884d9..0000000000000000000000000000000000000000 --- a/netbox/models/interface_template_form_factor.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InterfaceTemplateFormFactor Form factor -// swagger:model interfaceTemplateFormFactor -type InterfaceTemplateFormFactor struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this interface template form factor -func (m *InterfaceTemplateFormFactor) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InterfaceTemplateFormFactor) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *InterfaceTemplateFormFactor) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InterfaceTemplateFormFactor) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InterfaceTemplateFormFactor) UnmarshalBinary(b []byte) error { - var res InterfaceTemplateFormFactor - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/inventory_item.go b/netbox/models/inventory_item.go index 3b7883bc45286bbcff914f964f5cde5ea3805758..0f84cae0af3311b0bc64c82eb229538d835b70d7 100644 --- a/netbox/models/inventory_item.go +++ b/netbox/models/inventory_item.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -35,7 +37,7 @@ type InventoryItem struct { // // A unique tag used to identify this item // Max Length: 50 - AssetTag string `json:"asset_tag,omitempty"` + AssetTag *string `json:"asset_tag,omitempty"` // Description // Max Length: 100 @@ -53,17 +55,16 @@ type InventoryItem struct { ID int64 `json:"id,omitempty"` // manufacturer - // Required: true - Manufacturer *NestedManufacturer `json:"manufacturer"` + Manufacturer *NestedManufacturer `json:"manufacturer,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Parent - // Required: true - Parent *int64 `json:"parent"` + Parent *int64 `json:"parent,omitempty"` // Part ID // Max Length: 50 @@ -72,6 +73,9 @@ type InventoryItem struct { // Serial number // Max Length: 50 Serial string `json:"serial,omitempty"` + + // tags + Tags []string `json:"tags"` } // Validate validates this inventory item @@ -79,42 +83,34 @@ func (m *InventoryItem) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAssetTag(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateManufacturer(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } - if err := m.validateParent(formats); err != nil { - // prop + if err := m.validatePartID(formats); err != nil { res = append(res, err) } - if err := m.validatePartID(formats); err != nil { - // prop + if err := m.validateSerial(formats); err != nil { res = append(res, err) } - if err := m.validateSerial(formats); err != nil { - // prop + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -130,7 +126,7 @@ func (m *InventoryItem) validateAssetTag(formats strfmt.Registry) error { return nil } - if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + if err := validate.MaxLength("asset_tag", "body", string(*m.AssetTag), 50); err != nil { return err } @@ -157,7 +153,6 @@ func (m *InventoryItem) validateDevice(formats strfmt.Registry) error { } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -171,12 +166,11 @@ func (m *InventoryItem) validateDevice(formats strfmt.Registry) error { func (m *InventoryItem) validateManufacturer(formats strfmt.Registry) error { - if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { - return err + if swag.IsZero(m.Manufacturer) { // not required + return nil } if m.Manufacturer != nil { - if err := m.Manufacturer.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("manufacturer") @@ -194,16 +188,11 @@ func (m *InventoryItem) validateName(formats strfmt.Registry) error { return err } - if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { return err } - return nil -} - -func (m *InventoryItem) validateParent(formats strfmt.Registry) error { - - if err := validate.Required("parent", "body", m.Parent); err != nil { + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -236,6 +225,23 @@ func (m *InventoryItem) validateSerial(formats strfmt.Registry) error { return nil } +func (m *InventoryItem) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *InventoryItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/ip_address.go b/netbox/models/ip_address.go index 32c582da087d19402c68d1d3b556da3d85616593..b04660552478e87cc70eea5c401914df9846498b 100644 --- a/netbox/models/ip_address.go +++ b/netbox/models/ip_address.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -39,6 +41,7 @@ type IPAddress struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -48,45 +51,48 @@ type IPAddress struct { // Max Length: 100 Description string `json:"description,omitempty"` - // Family - // Read Only: true - Family int64 `json:"family,omitempty"` + // DNS Name + // + // Hostname or FQDN (not case-sensitive) + // Max Length: 255 + // Pattern: ^[0-9A-Za-z.-]+$ + DNSName string `json:"dns_name,omitempty"` + + // family + Family *IPAddressFamily `json:"family,omitempty"` // ID // Read Only: true ID int64 `json:"id,omitempty"` // interface - // Required: true - Interface *IPAddressInterface `json:"interface"` + Interface *IPAddressInterface `json:"interface,omitempty"` // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // nat inside - // Required: true - NatInside *NestedIPAddress `json:"nat_inside"` + NatInside *NestedIPAddress `json:"nat_inside,omitempty"` // nat outside - // Required: true - NatOutside *NestedIPAddress `json:"nat_outside"` + NatOutside *NestedIPAddress `json:"nat_outside,omitempty"` // role - // Required: true - Role *IPAddressRole `json:"role"` + Role *IPAddressRole `json:"role,omitempty"` // status - // Required: true - Status *IPAddressStatus `json:"status"` + Status *IPAddressStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // vrf - // Required: true - Vrf *NestedVRF `json:"vrf"` + Vrf *NestedVRF `json:"vrf,omitempty"` } // Validate validates this IP address @@ -94,47 +100,58 @@ func (m *IPAddress) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAddress(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateDNSName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFamily(formats); err != nil { res = append(res, err) } if err := m.validateInterface(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateNatInside(formats); err != nil { - // prop res = append(res, err) } if err := m.validateNatOutside(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRole(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVrf(formats); err != nil { - // prop res = append(res, err) } @@ -153,6 +170,19 @@ func (m *IPAddress) validateAddress(formats strfmt.Registry) error { return nil } +func (m *IPAddress) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *IPAddress) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -166,14 +196,48 @@ func (m *IPAddress) validateDescription(formats strfmt.Registry) error { return nil } -func (m *IPAddress) validateInterface(formats strfmt.Registry) error { +func (m *IPAddress) validateDNSName(formats strfmt.Registry) error { + + if swag.IsZero(m.DNSName) { // not required + return nil + } - if err := validate.Required("interface", "body", m.Interface); err != nil { + if err := validate.MaxLength("dns_name", "body", string(m.DNSName), 255); err != nil { return err } - if m.Interface != nil { + if err := validate.Pattern("dns_name", "body", string(m.DNSName), `^[0-9A-Za-z.-]+$`); err != nil { + return err + } + + return nil +} + +func (m *IPAddress) validateFamily(formats strfmt.Registry) error { + if swag.IsZero(m.Family) { // not required + return nil + } + + if m.Family != nil { + if err := m.Family.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("family") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateInterface(formats strfmt.Registry) error { + + if swag.IsZero(m.Interface) { // not required + return nil + } + + if m.Interface != nil { if err := m.Interface.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("interface") @@ -185,14 +249,26 @@ func (m *IPAddress) validateInterface(formats strfmt.Registry) error { return nil } -func (m *IPAddress) validateNatInside(formats strfmt.Registry) error { +func (m *IPAddress) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } - if err := validate.Required("nat_inside", "body", m.NatInside); err != nil { + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { return err } - if m.NatInside != nil { + return nil +} + +func (m *IPAddress) validateNatInside(formats strfmt.Registry) error { + + if swag.IsZero(m.NatInside) { // not required + return nil + } + if m.NatInside != nil { if err := m.NatInside.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nat_inside") @@ -206,12 +282,11 @@ func (m *IPAddress) validateNatInside(formats strfmt.Registry) error { func (m *IPAddress) validateNatOutside(formats strfmt.Registry) error { - if err := validate.Required("nat_outside", "body", m.NatOutside); err != nil { - return err + if swag.IsZero(m.NatOutside) { // not required + return nil } if m.NatOutside != nil { - if err := m.NatOutside.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("nat_outside") @@ -225,12 +300,11 @@ func (m *IPAddress) validateNatOutside(formats strfmt.Registry) error { func (m *IPAddress) validateRole(formats strfmt.Registry) error { - if err := validate.Required("role", "body", m.Role); err != nil { - return err + if swag.IsZero(m.Role) { // not required + return nil } if m.Role != nil { - if err := m.Role.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("role") @@ -244,12 +318,11 @@ func (m *IPAddress) validateRole(formats strfmt.Registry) error { func (m *IPAddress) validateStatus(formats strfmt.Registry) error { - if err := validate.Required("status", "body", m.Status); err != nil { - return err + if swag.IsZero(m.Status) { // not required + return nil } if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") @@ -261,14 +334,30 @@ func (m *IPAddress) validateStatus(formats strfmt.Registry) error { return nil } +func (m *IPAddress) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *IPAddress) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -282,12 +371,11 @@ func (m *IPAddress) validateTenant(formats strfmt.Registry) error { func (m *IPAddress) validateVrf(formats strfmt.Registry) error { - if err := validate.Required("vrf", "body", m.Vrf); err != nil { - return err + if swag.IsZero(m.Vrf) { // not required + return nil } if m.Vrf != nil { - if err := m.Vrf.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vrf") @@ -316,3 +404,204 @@ func (m *IPAddress) UnmarshalBinary(b []byte) error { *m = res return nil } + +// IPAddressFamily Family +// swagger:model IPAddressFamily +type IPAddressFamily struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this IP address family +func (m *IPAddressFamily) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddressFamily) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("family"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *IPAddressFamily) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("family"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressFamily) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressFamily) UnmarshalBinary(b []byte) error { + var res IPAddressFamily + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// IPAddressRole Role +// swagger:model IPAddressRole +type IPAddressRole struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this IP address role +func (m *IPAddressRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddressRole) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("role"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *IPAddressRole) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("role"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressRole) UnmarshalBinary(b []byte) error { + var res IPAddressRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// IPAddressStatus Status +// swagger:model IPAddressStatus +type IPAddressStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this IP address status +func (m *IPAddressStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddressStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *IPAddressStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressStatus) UnmarshalBinary(b []byte) error { + var res IPAddressStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_address_interface.go b/netbox/models/ip_address_interface.go index 4138ae4b96446094c2d1e118e20d9a2fff8dfe59..44fe3fc6a8742b7581561d38e9cfecc3081cc845 100644 --- a/netbox/models/ip_address_interface.go +++ b/netbox/models/ip_address_interface.go @@ -32,8 +32,7 @@ import ( type IPAddressInterface struct { // device - // Required: true - Device *NestedDevice `json:"device"` + Device *NestedDevice `json:"device,omitempty"` // ID // Read Only: true @@ -42,6 +41,7 @@ type IPAddressInterface struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` // Url @@ -49,8 +49,7 @@ type IPAddressInterface struct { URL string `json:"url,omitempty"` // virtual machine - // Required: true - VirtualMachine *NestedVirtualMachine `json:"virtual_machine"` + VirtualMachine *NestedVirtualMachine `json:"virtual_machine,omitempty"` } // Validate validates this IP address interface @@ -58,17 +57,14 @@ func (m *IPAddressInterface) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVirtualMachine(formats); err != nil { - // prop res = append(res, err) } @@ -80,12 +76,11 @@ func (m *IPAddressInterface) Validate(formats strfmt.Registry) error { func (m *IPAddressInterface) validateDevice(formats strfmt.Registry) error { - if err := validate.Required("device", "body", m.Device); err != nil { - return err + if swag.IsZero(m.Device) { // not required + return nil } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -103,6 +98,10 @@ func (m *IPAddressInterface) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -112,12 +111,11 @@ func (m *IPAddressInterface) validateName(formats strfmt.Registry) error { func (m *IPAddressInterface) validateVirtualMachine(formats strfmt.Registry) error { - if err := validate.Required("virtual_machine", "body", m.VirtualMachine); err != nil { - return err + if swag.IsZero(m.VirtualMachine) { // not required + return nil } if m.VirtualMachine != nil { - if err := m.VirtualMachine.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("virtual_machine") diff --git a/netbox/models/ip_address_role.go b/netbox/models/ip_address_role.go deleted file mode 100644 index cd8441e5a87808accd386100165a5eaee290a45c..0000000000000000000000000000000000000000 --- a/netbox/models/ip_address_role.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAddressRole Role -// swagger:model ipAddressRole -type IPAddressRole struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this ip address role -func (m *IPAddressRole) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAddressRole) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *IPAddressRole) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAddressRole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAddressRole) UnmarshalBinary(b []byte) error { - var res IPAddressRole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_address_status.go b/netbox/models/ip_address_status.go deleted file mode 100644 index 54ec03e847fe6ca91cd98fd90c71c5bcdeb92565..0000000000000000000000000000000000000000 --- a/netbox/models/ip_address_status.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAddressStatus Status -// swagger:model ipAddressStatus -type IPAddressStatus struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this ip address status -func (m *IPAddressStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAddressStatus) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *IPAddressStatus) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAddressStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAddressStatus) UnmarshalBinary(b []byte) error { - var res IPAddressStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amaggregates_list_okbody.go b/netbox/models/ip_amaggregates_list_okbody.go deleted file mode 100644 index e43ff0a0a2695bbf220c0579a96a61727f7dfca1..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amaggregates_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMAggregatesListOKBody ipam aggregates list o k body -// swagger:model ipamAggregatesListOKBody -type IPAMAggregatesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMAggregatesListOKBodyResults `json:"results"` -} - -// Validate validates this ipam aggregates list o k body -func (m *IPAMAggregatesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMAggregatesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMAggregatesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMAggregatesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMAggregatesListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMAggregatesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amaggregates_list_okbody_results.go b/netbox/models/ip_amaggregates_list_okbody_results.go deleted file mode 100644 index e93c2aa5b2035d5a27b5e15d9f38a8b777c4d3d2..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amaggregates_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMAggregatesListOKBodyResults ipam aggregates list o k body results -// swagger:model ipamAggregatesListOKBodyResults -type IPAMAggregatesListOKBodyResults []*Aggregate - -// Validate validates this ipam aggregates list o k body results -func (m IPAMAggregatesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/ip_amip_addresses_list_okbody.go b/netbox/models/ip_amip_addresses_list_okbody.go deleted file mode 100644 index 3453bfdc48917b17baadbba2f485ffab5fbf4423..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amip_addresses_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMIPAddressesListOKBody ipam Ip addresses list o k body -// swagger:model ipamIpAddressesListOKBody -type IPAMIPAddressesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMIPAddressesListOKBodyResults `json:"results"` -} - -// Validate validates this ipam Ip addresses list o k body -func (m *IPAMIPAddressesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMIPAddressesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMIPAddressesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMIPAddressesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMIPAddressesListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMIPAddressesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amip_addresses_list_okbody_results.go b/netbox/models/ip_amip_addresses_list_okbody_results.go deleted file mode 100644 index 86968c6ea13200629f58260ff630e250dfaf6651..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amip_addresses_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMIPAddressesListOKBodyResults ipam Ip addresses list o k body results -// swagger:model ipamIpAddressesListOKBodyResults -type IPAMIPAddressesListOKBodyResults []*IPAddress - -// Validate validates this ipam Ip addresses list o k body results -func (m IPAMIPAddressesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/ip_amprefixes_list_okbody.go b/netbox/models/ip_amprefixes_list_okbody.go deleted file mode 100644 index 3a0455f84abe9e90a3b9ea853a5447efa7d9f76e..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amprefixes_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMPrefixesListOKBody ipam prefixes list o k body -// swagger:model ipamPrefixesListOKBody -type IPAMPrefixesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMPrefixesListOKBodyResults `json:"results"` -} - -// Validate validates this ipam prefixes list o k body -func (m *IPAMPrefixesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMPrefixesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMPrefixesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMPrefixesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMPrefixesListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMPrefixesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amprefixes_list_okbody_results.go b/netbox/models/ip_amprefixes_list_okbody_results.go deleted file mode 100644 index 7d5ae3a9188d2d7196f39b3d8f647f558f61c637..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amprefixes_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMPrefixesListOKBodyResults ipam prefixes list o k body results -// swagger:model ipamPrefixesListOKBodyResults -type IPAMPrefixesListOKBodyResults []*Prefix - -// Validate validates this ipam prefixes list o k body results -func (m IPAMPrefixesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/ip_amrirs_list_okbody.go b/netbox/models/ip_amrirs_list_okbody.go deleted file mode 100644 index 97aab23e89568a693e9c9e5891e679bb290a0f3b..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amrirs_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMRirsListOKBody ipam rirs list o k body -// swagger:model ipamRirsListOKBody -type IPAMRirsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMRirsListOKBodyResults `json:"results"` -} - -// Validate validates this ipam rirs list o k body -func (m *IPAMRirsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMRirsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMRirsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMRirsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMRirsListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMRirsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amrirs_list_okbody_results.go b/netbox/models/ip_amrirs_list_okbody_results.go deleted file mode 100644 index a8177741e6fdf209a292f23c6b4235977e68f711..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amrirs_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMRirsListOKBodyResults ipam rirs list o k body results -// swagger:model ipamRirsListOKBodyResults -type IPAMRirsListOKBodyResults []*RIR - -// Validate validates this ipam rirs list o k body results -func (m IPAMRirsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/ip_amroles_list_okbody.go b/netbox/models/ip_amroles_list_okbody.go deleted file mode 100644 index 044fa6bc05393cdcbf8d19ce774c622e1169e3c5..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amroles_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMRolesListOKBody ipam roles list o k body -// swagger:model ipamRolesListOKBody -type IPAMRolesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMRolesListOKBodyResults `json:"results"` -} - -// Validate validates this ipam roles list o k body -func (m *IPAMRolesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMRolesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMRolesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMRolesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMRolesListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMRolesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amroles_list_okbody_results.go b/netbox/models/ip_amroles_list_okbody_results.go deleted file mode 100644 index eda1619c22c7a9841acf4213cecf054a8e616f32..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amroles_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMRolesListOKBodyResults ipam roles list o k body results -// swagger:model ipamRolesListOKBodyResults -type IPAMRolesListOKBodyResults []*Role - -// Validate validates this ipam roles list o k body results -func (m IPAMRolesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/ip_amservices_list_okbody.go b/netbox/models/ip_amservices_list_okbody.go deleted file mode 100644 index 43866d0966ed3f4f38fbfc2a58e228ffe500621f..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amservices_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMServicesListOKBody ipam services list o k body -// swagger:model ipamServicesListOKBody -type IPAMServicesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMServicesListOKBodyResults `json:"results"` -} - -// Validate validates this ipam services list o k body -func (m *IPAMServicesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMServicesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMServicesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMServicesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMServicesListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMServicesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amservices_list_okbody_results.go b/netbox/models/ip_amservices_list_okbody_results.go deleted file mode 100644 index 6b8801565cb5449aec12664fb8c34794e7b27d6f..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amservices_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMServicesListOKBodyResults ipam services list o k body results -// swagger:model ipamServicesListOKBodyResults -type IPAMServicesListOKBodyResults []*Service - -// Validate validates this ipam services list o k body results -func (m IPAMServicesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/ip_amvlan_groups_list_okbody.go b/netbox/models/ip_amvlan_groups_list_okbody.go deleted file mode 100644 index c423bca2505acbe9a745304d8f482750a9223da8..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amvlan_groups_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMVlanGroupsListOKBody ipam vlan groups list o k body -// swagger:model ipamVlanGroupsListOKBody -type IPAMVlanGroupsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMVlanGroupsListOKBodyResults `json:"results"` -} - -// Validate validates this ipam vlan groups list o k body -func (m *IPAMVlanGroupsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMVlanGroupsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMVlanGroupsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMVlanGroupsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMVlanGroupsListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMVlanGroupsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amvlan_groups_list_okbody_results.go b/netbox/models/ip_amvlan_groups_list_okbody_results.go deleted file mode 100644 index eca97748e24e70cee148851c670b7225990befe5..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amvlan_groups_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMVlanGroupsListOKBodyResults ipam vlan groups list o k body results -// swagger:model ipamVlanGroupsListOKBodyResults -type IPAMVlanGroupsListOKBodyResults []*VLANGroup - -// Validate validates this ipam vlan groups list o k body results -func (m IPAMVlanGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/ip_amvlans_list_okbody.go b/netbox/models/ip_amvlans_list_okbody.go deleted file mode 100644 index 7154bca10da4a93f78785d8dcb47e79b64f28a9b..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amvlans_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMVlansListOKBody ipam vlans list o k body -// swagger:model ipamVlansListOKBody -type IPAMVlansListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMVlansListOKBodyResults `json:"results"` -} - -// Validate validates this ipam vlans list o k body -func (m *IPAMVlansListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMVlansListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMVlansListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMVlansListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMVlansListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMVlansListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amvlans_list_okbody_results.go b/netbox/models/ip_amvlans_list_okbody_results.go deleted file mode 100644 index 86a1ba0dbd2410223b7a2175c5fff3d84d063146..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amvlans_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMVlansListOKBodyResults ipam vlans list o k body results -// swagger:model ipamVlansListOKBodyResults -type IPAMVlansListOKBodyResults []*VLAN - -// Validate validates this ipam vlans list o k body results -func (m IPAMVlansListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/ip_amvrfs_list_okbody.go b/netbox/models/ip_amvrfs_list_okbody.go deleted file mode 100644 index 5fefe5552d6bb295e0912c489cb43dda2af7cf57..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amvrfs_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IPAMVrfsListOKBody ipam vrfs list o k body -// swagger:model ipamVrfsListOKBody -type IPAMVrfsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results IPAMVrfsListOKBodyResults `json:"results"` -} - -// Validate validates this ipam vrfs list o k body -func (m *IPAMVrfsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IPAMVrfsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *IPAMVrfsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *IPAMVrfsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IPAMVrfsListOKBody) UnmarshalBinary(b []byte) error { - var res IPAMVrfsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/ip_amvrfs_list_okbody_results.go b/netbox/models/ip_amvrfs_list_okbody_results.go deleted file mode 100644 index 7d069d8360416fc5e445ac48b3cc2af606a12078..0000000000000000000000000000000000000000 --- a/netbox/models/ip_amvrfs_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// IPAMVrfsListOKBodyResults ipam vrfs list o k body results -// swagger:model ipamVrfsListOKBodyResults -type IPAMVrfsListOKBodyResults []*VRF - -// Validate validates this ipam vrfs list o k body results -func (m IPAMVrfsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/manufacturer.go b/netbox/models/manufacturer.go index 9f4f21112db26273294bd6f931e1938c1e972841..7b675f3a9ae92324417c94dae6a177c84061e01a 100644 --- a/netbox/models/manufacturer.go +++ b/netbox/models/manufacturer.go @@ -31,18 +31,32 @@ import ( // swagger:model Manufacturer type Manufacturer struct { + // Devicetype count + // Read Only: true + DevicetypeCount int64 `json:"devicetype_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` + // Inventoryitem count + // Read Only: true + InventoryitemCount int64 `json:"inventoryitem_count,omitempty"` + // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Platform count + // Read Only: true + PlatformCount int64 `json:"platform_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -52,12 +66,10 @@ func (m *Manufacturer) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -73,6 +85,10 @@ func (m *Manufacturer) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -86,6 +102,10 @@ func (m *Manufacturer) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/interface_nested_circuit.go b/netbox/models/nested_cable.go similarity index 60% rename from netbox/models/interface_nested_circuit.go rename to netbox/models/nested_cable.go index 9f1bca812afb16694f90b8898261cb51c0dc5e4f..cd1e71c46716a81304d76b97c191edc9047ec425 100644 --- a/netbox/models/interface_nested_circuit.go +++ b/netbox/models/nested_cable.go @@ -27,30 +27,33 @@ import ( "github.com/go-openapi/validate" ) -// InterfaceNestedCircuit Circuit -// swagger:model InterfaceNestedCircuit -type InterfaceNestedCircuit struct { - - // Circuit ID - // Required: true - // Max Length: 50 - Cid *string `json:"cid"` +// NestedCable Cable +// swagger:model NestedCable +type NestedCable struct { // ID // Read Only: true ID int64 `json:"id,omitempty"` + // Label + // Max Length: 100 + Label string `json:"label,omitempty"` + // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } -// Validate validates this interface nested circuit -func (m *InterfaceNestedCircuit) Validate(formats strfmt.Registry) error { +// Validate validates this nested cable +func (m *NestedCable) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateCid(formats); err != nil { - // prop + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -60,13 +63,26 @@ func (m *InterfaceNestedCircuit) Validate(formats strfmt.Registry) error { return nil } -func (m *InterfaceNestedCircuit) validateCid(formats strfmt.Registry) error { +func (m *NestedCable) validateLabel(formats strfmt.Registry) error { + + if swag.IsZero(m.Label) { // not required + return nil + } - if err := validate.Required("cid", "body", m.Cid); err != nil { + if err := validate.MaxLength("label", "body", string(m.Label), 100); err != nil { return err } - if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return nil +} + +func (m *NestedCable) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { return err } @@ -74,7 +90,7 @@ func (m *InterfaceNestedCircuit) validateCid(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (m *InterfaceNestedCircuit) MarshalBinary() ([]byte, error) { +func (m *NestedCable) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -82,8 +98,8 @@ func (m *InterfaceNestedCircuit) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *InterfaceNestedCircuit) UnmarshalBinary(b []byte) error { - var res InterfaceNestedCircuit +func (m *NestedCable) UnmarshalBinary(b []byte) error { + var res NestedCable if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/netbox/models/nested_circuit.go b/netbox/models/nested_circuit.go index 14a77d9f5c91c978ec582972c3b8331ba8889b21..941726be7aa4989595f8d5960b1286d68c844dd9 100644 --- a/netbox/models/nested_circuit.go +++ b/netbox/models/nested_circuit.go @@ -34,6 +34,7 @@ type NestedCircuit struct { // Circuit ID // Required: true // Max Length: 50 + // Min Length: 1 Cid *string `json:"cid"` // ID @@ -42,6 +43,7 @@ type NestedCircuit struct { // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -50,7 +52,10 @@ func (m *NestedCircuit) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCid(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -66,6 +71,10 @@ func (m *NestedCircuit) validateCid(formats strfmt.Registry) error { return err } + if err := validate.MinLength("cid", "body", string(*m.Cid), 1); err != nil { + return err + } + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { return err } @@ -73,6 +82,19 @@ func (m *NestedCircuit) validateCid(formats strfmt.Registry) error { return nil } +func (m *NestedCircuit) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedCircuit) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_circuit_type.go b/netbox/models/nested_circuit_type.go index b85491ed186d03df9117b1d669d69e0f18dec0c7..2245e2748babea9f581f8d2972822a94bf3f5112 100644 --- a/netbox/models/nested_circuit_type.go +++ b/netbox/models/nested_circuit_type.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedCircuitType type NestedCircuitType struct { + // Circuit count + // Read Only: true + CircuitCount int64 `json:"circuit_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,16 +42,19 @@ type NestedCircuitType struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedCircuitType) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedCircuitType) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedCircuitType) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedCircuitType) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedCircuitType) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedCircuitType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_cluster.go b/netbox/models/nested_cluster.go index 01f29730f5693fd81d6f46c8e0ba4d0562cabc81..8fcee75099c9176beae9f2893e4fd85b053dcb8a 100644 --- a/netbox/models/nested_cluster.go +++ b/netbox/models/nested_cluster.go @@ -38,11 +38,17 @@ type NestedCluster struct { // Name // Required: true // Max Length: 100 + // Min Length: 1 Name *string `json:"name"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` } // Validate validates this nested cluster @@ -50,7 +56,10 @@ func (m *NestedCluster) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -66,6 +75,10 @@ func (m *NestedCluster) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { return err } @@ -73,6 +86,19 @@ func (m *NestedCluster) validateName(formats strfmt.Registry) error { return nil } +func (m *NestedCluster) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedCluster) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_cluster_group.go b/netbox/models/nested_cluster_group.go index 8ecd05e5c5f9c30846faeefb750fd5bec927b80f..259bfa4db9319b17d45a147a9b3f0375722a242a 100644 --- a/netbox/models/nested_cluster_group.go +++ b/netbox/models/nested_cluster_group.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedClusterGroup type NestedClusterGroup struct { + // Cluster count + // Read Only: true + ClusterCount int64 `json:"cluster_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,16 +42,19 @@ type NestedClusterGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedClusterGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedClusterGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedClusterGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedClusterGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedClusterGroup) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedClusterGroup) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_cluster_type.go b/netbox/models/nested_cluster_type.go index 37e547b1305ce6404a8b370a5ffd171a68593fe9..f2cd153852d095759d592a58bee55180389e3e65 100644 --- a/netbox/models/nested_cluster_type.go +++ b/netbox/models/nested_cluster_type.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedClusterType type NestedClusterType struct { + // Cluster count + // Read Only: true + ClusterCount int64 `json:"cluster_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,16 +42,19 @@ type NestedClusterType struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedClusterType) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedClusterType) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedClusterType) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedClusterType) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedClusterType) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedClusterType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_device.go b/netbox/models/nested_device.go index 4d562a81ce819feaaa40ef01a262c841783d0a74..470da014b356ec3c6755d399a062fbf290370dee 100644 --- a/netbox/models/nested_device.go +++ b/netbox/models/nested_device.go @@ -27,7 +27,7 @@ import ( "github.com/go-openapi/validate" ) -// NestedDevice Device +// NestedDevice Parent device // swagger:model NestedDevice type NestedDevice struct { @@ -41,10 +41,11 @@ type NestedDevice struct { // Name // Max Length: 64 - Name string `json:"name,omitempty"` + Name *string `json:"name,omitempty"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -53,7 +54,10 @@ func (m *NestedDevice) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -69,7 +73,20 @@ func (m *NestedDevice) validateName(formats strfmt.Registry) error { return nil } - if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *NestedDevice) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { return err } diff --git a/netbox/models/nested_device_role.go b/netbox/models/nested_device_role.go index f1fc28e2b0f4f621bd5ace709f152fb97609d3ae..b8dd66d6a0fa9c8fc04bec88eaf90e173b026627 100644 --- a/netbox/models/nested_device_role.go +++ b/netbox/models/nested_device_role.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedDeviceRole type NestedDeviceRole struct { + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,17 +42,24 @@ type NestedDeviceRole struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` } // Validate validates this nested device role @@ -56,12 +67,14 @@ func (m *NestedDeviceRole) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +90,10 @@ func (m *NestedDeviceRole) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +107,10 @@ func (m *NestedDeviceRole) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +122,19 @@ func (m *NestedDeviceRole) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedDeviceRole) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedDeviceRole) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_device_type.go b/netbox/models/nested_device_type.go index 1fb87eef22b4bc5d697c8b32423d6db356ae61e2..2b8a6e516c440db6d7818a9d8db66afac512eb49 100644 --- a/netbox/models/nested_device_type.go +++ b/netbox/models/nested_device_type.go @@ -31,27 +31,37 @@ import ( // swagger:model NestedDeviceType type NestedDeviceType struct { + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` // manufacturer - // Required: true - Manufacturer *NestedManufacturer `json:"manufacturer"` + Manufacturer *NestedManufacturer `json:"manufacturer,omitempty"` // Model // Required: true // Max Length: 50 + // Min Length: 1 Model *string `json:"model"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -60,17 +70,18 @@ func (m *NestedDeviceType) Validate(formats strfmt.Registry) error { var res []error if err := m.validateManufacturer(formats); err != nil { - // prop res = append(res, err) } if err := m.validateModel(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -82,12 +93,11 @@ func (m *NestedDeviceType) Validate(formats strfmt.Registry) error { func (m *NestedDeviceType) validateManufacturer(formats strfmt.Registry) error { - if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { - return err + if swag.IsZero(m.Manufacturer) { // not required + return nil } if m.Manufacturer != nil { - if err := m.Manufacturer.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("manufacturer") @@ -105,6 +115,10 @@ func (m *NestedDeviceType) validateModel(formats strfmt.Registry) error { return err } + if err := validate.MinLength("model", "body", string(*m.Model), 1); err != nil { + return err + } + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { return err } @@ -118,6 +132,10 @@ func (m *NestedDeviceType) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -129,6 +147,19 @@ func (m *NestedDeviceType) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedDeviceType) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedDeviceType) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_interface.go b/netbox/models/nested_interface.go index f764ad9be8e933f930bb5455326397c079041eaf..46c86336bf6538f7539b3939df9c34390166e2f4 100644 --- a/netbox/models/nested_interface.go +++ b/netbox/models/nested_interface.go @@ -27,10 +27,19 @@ import ( "github.com/go-openapi/validate" ) -// NestedInterface Lag +// NestedInterface Interface a // swagger:model NestedInterface type NestedInterface struct { + // Cable + Cable *int64 `json:"cable,omitempty"` + + // connection status + ConnectionStatus *NestedInterfaceConnectionStatus `json:"connection_status,omitempty"` + + // device + Device *NestedDevice `json:"device,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,10 +47,12 @@ type NestedInterface struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -49,8 +60,19 @@ type NestedInterface struct { func (m *NestedInterface) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -60,12 +82,52 @@ func (m *NestedInterface) Validate(formats strfmt.Registry) error { return nil } +func (m *NestedInterface) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + if m.ConnectionStatus != nil { + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + } + + return nil +} + +func (m *NestedInterface) validateDevice(formats strfmt.Registry) error { + + if swag.IsZero(m.Device) { // not required + return nil + } + + if m.Device != nil { + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + func (m *NestedInterface) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -73,6 +135,19 @@ func (m *NestedInterface) validateName(formats strfmt.Registry) error { return nil } +func (m *NestedInterface) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedInterface) MarshalBinary() ([]byte, error) { if m == nil { @@ -90,3 +165,70 @@ func (m *NestedInterface) UnmarshalBinary(b []byte) error { *m = res return nil } + +// NestedInterfaceConnectionStatus Connection status +// swagger:model NestedInterfaceConnectionStatus +type NestedInterfaceConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this nested interface connection status +func (m *NestedInterfaceConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedInterfaceConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *NestedInterfaceConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedInterfaceConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedInterfaceConnectionStatus) UnmarshalBinary(b []byte) error { + var res NestedInterfaceConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_ip_address.go b/netbox/models/nested_ip_address.go index b4cf100ab647b766e49ffb0db9252a2ee376b25c..48eba6e99037f143247072a94c442a1dfbb95e53 100644 --- a/netbox/models/nested_ip_address.go +++ b/netbox/models/nested_ip_address.go @@ -27,7 +27,7 @@ import ( "github.com/go-openapi/validate" ) -// NestedIPAddress Nat inside +// NestedIPAddress Primary ip // swagger:model NestedIPAddress type NestedIPAddress struct { @@ -47,6 +47,7 @@ type NestedIPAddress struct { // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -55,7 +56,10 @@ func (m *NestedIPAddress) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAddress(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -74,6 +78,19 @@ func (m *NestedIPAddress) validateAddress(formats strfmt.Registry) error { return nil } +func (m *NestedIPAddress) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedIPAddress) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_manufacturer.go b/netbox/models/nested_manufacturer.go index a0868af60d12a9309b5f766fd5ae68c0fc262598..ef3a6af07d58ea566e7182cfe3e0c846a2f60740 100644 --- a/netbox/models/nested_manufacturer.go +++ b/netbox/models/nested_manufacturer.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedManufacturer type NestedManufacturer struct { + // Devicetype count + // Read Only: true + DevicetypeCount int64 `json:"devicetype_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,16 +42,19 @@ type NestedManufacturer struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedManufacturer) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedManufacturer) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedManufacturer) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedManufacturer) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedManufacturer) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedManufacturer) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_platform.go b/netbox/models/nested_platform.go index 25e19cecd47246b6dc7c87894a1d4df4364cdf3e..bc218c07a106e5a662531d19f2e00fbe7b086b9a 100644 --- a/netbox/models/nested_platform.go +++ b/netbox/models/nested_platform.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedPlatform type NestedPlatform struct { + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,17 +42,24 @@ type NestedPlatform struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` } // Validate validates this nested platform @@ -56,12 +67,14 @@ func (m *NestedPlatform) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +90,10 @@ func (m *NestedPlatform) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +107,10 @@ func (m *NestedPlatform) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +122,19 @@ func (m *NestedPlatform) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedPlatform) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedPlatform) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_power_panel.go b/netbox/models/nested_power_panel.go new file mode 100644 index 0000000000000000000000000000000000000000..51d8c219531cf39dea32acfe7c6d56f17c0a8211 --- /dev/null +++ b/netbox/models/nested_power_panel.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedPowerPanel Power panel +// swagger:model NestedPowerPanel +type NestedPowerPanel struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + // Min Length: 1 + Name *string `json:"name"` + + // Powerfeed count + // Read Only: true + PowerfeedCount int64 `json:"powerfeed_count,omitempty"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested power panel +func (m *NestedPowerPanel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedPowerPanel) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedPowerPanel) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedPowerPanel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedPowerPanel) UnmarshalBinary(b []byte) error { + var res NestedPowerPanel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_power_port.go b/netbox/models/nested_power_port.go new file mode 100644 index 0000000000000000000000000000000000000000..9a9a7911acd05e60a2b7d74b56ca349f943f5866 --- /dev/null +++ b/netbox/models/nested_power_port.go @@ -0,0 +1,234 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedPowerPort Power port +// swagger:model NestedPowerPort +type NestedPowerPort struct { + + // Cable + Cable *int64 `json:"cable,omitempty"` + + // connection status + ConnectionStatus *NestedPowerPortConnectionStatus `json:"connection_status,omitempty"` + + // device + Device *NestedDevice `json:"device,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + // Min Length: 1 + Name *string `json:"name"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested power port +func (m *NestedPowerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedPowerPort) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + if m.ConnectionStatus != nil { + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + } + + return nil +} + +func (m *NestedPowerPort) validateDevice(formats strfmt.Registry) error { + + if swag.IsZero(m.Device) { // not required + return nil + } + + if m.Device != nil { + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *NestedPowerPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedPowerPort) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedPowerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedPowerPort) UnmarshalBinary(b []byte) error { + var res NestedPowerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// NestedPowerPortConnectionStatus Connection status +// swagger:model NestedPowerPortConnectionStatus +type NestedPowerPortConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this nested power port connection status +func (m *NestedPowerPortConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedPowerPortConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *NestedPowerPortConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedPowerPortConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedPowerPortConnectionStatus) UnmarshalBinary(b []byte) error { + var res NestedPowerPortConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_provider.go b/netbox/models/nested_provider.go index 2fa4752ced5b2d227d15fb5c291b562a3c000b45..088580d34bff3eb02e9b14f53fc1649b9bea3899 100644 --- a/netbox/models/nested_provider.go +++ b/netbox/models/nested_provider.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedProvider type NestedProvider struct { + // Circuit count + // Read Only: true + CircuitCount int64 `json:"circuit_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,16 +42,19 @@ type NestedProvider struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedProvider) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedProvider) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedProvider) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedProvider) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedProvider) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedProvider) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_rir.go b/netbox/models/nested_r_i_r.go similarity index 80% rename from netbox/models/nested_rir.go rename to netbox/models/nested_r_i_r.go index 33c67b42c9ee96557b5dff91589afec22e2de335..5812f5336eb358e292239d9d8419c8c7bd32cc0c 100644 --- a/netbox/models/nested_rir.go +++ b/netbox/models/nested_r_i_r.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedRIR type NestedRIR struct { + // Aggregate count + // Read Only: true + AggregateCount int64 `json:"aggregate_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -38,16 +42,19 @@ type NestedRIR struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedRIR) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedRIR) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedRIR) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedRIR) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedRIR) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedRIR) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_rack.go b/netbox/models/nested_rack.go index 08c5b42ed5eac852a66f0261f0e19873e4eb9f08..41a375e910735a8f2c1139487a4c6fef00bf35bf 100644 --- a/netbox/models/nested_rack.go +++ b/netbox/models/nested_rack.go @@ -31,6 +31,10 @@ import ( // swagger:model NestedRack type NestedRack struct { + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // Display name // Read Only: true DisplayName string `json:"display_name,omitempty"` @@ -42,10 +46,12 @@ type NestedRack struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -54,7 +60,10 @@ func (m *NestedRack) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -70,6 +79,10 @@ func (m *NestedRack) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -77,6 +90,19 @@ func (m *NestedRack) validateName(formats strfmt.Registry) error { return nil } +func (m *NestedRack) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedRack) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_rack_group.go b/netbox/models/nested_rack_group.go index 0f736ffaacb538f0e8b25e63ac2c002792cc0855..aee150df1b98b92db5bdfb9ef68e3bbe8aa102a5 100644 --- a/netbox/models/nested_rack_group.go +++ b/netbox/models/nested_rack_group.go @@ -27,7 +27,7 @@ import ( "github.com/go-openapi/validate" ) -// NestedRackGroup Group +// NestedRackGroup Rack group // swagger:model NestedRackGroup type NestedRackGroup struct { @@ -38,16 +38,23 @@ type NestedRackGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedRackGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedRackGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedRackGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedRackGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedRackGroup) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedRackGroup) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_rack_role.go b/netbox/models/nested_rack_role.go index 191fe3a554744357292e7d6316b031d89c82365f..5dff60c83cfe372e3ae0290168e13bf67ca09a00 100644 --- a/netbox/models/nested_rack_role.go +++ b/netbox/models/nested_rack_role.go @@ -38,16 +38,23 @@ type NestedRackRole struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedRackRole) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedRackRole) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedRackRole) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedRackRole) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedRackRole) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedRackRole) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_rear_port_template.go b/netbox/models/nested_rear_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..62443550b37283948a72735b4197a54b649f5cbf --- /dev/null +++ b/netbox/models/nested_rear_port_template.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NestedRearPortTemplate Rear port +// swagger:model NestedRearPortTemplate +type NestedRearPortTemplate struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // Url + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested rear port template +func (m *NestedRearPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRearPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *NestedRearPortTemplate) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedRearPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRearPortTemplate) UnmarshalBinary(b []byte) error { + var res NestedRearPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_region.go b/netbox/models/nested_region.go index 0945a6728c79a9f95cc1ab8f347c8c5b532c884e..603f27c3dd5cf2cf4acb76a9629abd98e219904f 100644 --- a/netbox/models/nested_region.go +++ b/netbox/models/nested_region.go @@ -38,16 +38,23 @@ type NestedRegion struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Site count + // Read Only: true + SiteCount int64 `json:"site_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedRegion) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedRegion) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedRegion) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedRegion) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedRegion) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedRegion) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_role.go b/netbox/models/nested_role.go index 8486baf9513b90bce94da2c074a3c3f547e7fcef..85ff46674af334cee6b6f323085e0795164ea2fa 100644 --- a/netbox/models/nested_role.go +++ b/netbox/models/nested_role.go @@ -38,17 +38,28 @@ type NestedRole struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` + + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` } // Validate validates this nested role @@ -56,12 +67,14 @@ func (m *NestedRole) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +90,10 @@ func (m *NestedRole) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +107,10 @@ func (m *NestedRole) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +122,19 @@ func (m *NestedRole) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedRole) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedRole) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_secret_role.go b/netbox/models/nested_secret_role.go index ce948db6f9169911900da70d18ef06cec80323fe..dbdd4e2ca70f9ac0a39a5bb245cded7fe3b158bc 100644 --- a/netbox/models/nested_secret_role.go +++ b/netbox/models/nested_secret_role.go @@ -38,16 +38,23 @@ type NestedSecretRole struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Secret count + // Read Only: true + SecretCount int64 `json:"secret_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedSecretRole) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedSecretRole) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedSecretRole) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedSecretRole) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedSecretRole) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedSecretRole) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_site.go b/netbox/models/nested_site.go index 3a3a7cb6b342a8ab113c4048c276b8cf5f8bf385..a843c3880983457781e87c03f49103db8300b5d4 100644 --- a/netbox/models/nested_site.go +++ b/netbox/models/nested_site.go @@ -38,16 +38,19 @@ type NestedSite struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +59,14 @@ func (m *NestedSite) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +82,10 @@ func (m *NestedSite) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +99,10 @@ func (m *NestedSite) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +114,19 @@ func (m *NestedSite) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedSite) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedSite) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_tenant.go b/netbox/models/nested_tenant.go index 149c6b54262bcd06d646c225556f8d5b7c3d330e..5aad4dd070c845e730825905853e911a1abac395 100644 --- a/netbox/models/nested_tenant.go +++ b/netbox/models/nested_tenant.go @@ -38,16 +38,19 @@ type NestedTenant struct { // Name // Required: true // Max Length: 30 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +59,14 @@ func (m *NestedTenant) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +82,10 @@ func (m *NestedTenant) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { return err } @@ -90,6 +99,10 @@ func (m *NestedTenant) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +114,19 @@ func (m *NestedTenant) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedTenant) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedTenant) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_tenant_group.go b/netbox/models/nested_tenant_group.go index a31c47a1b64b8a5f0b5e02644c26e0ce62fcc37e..8d303b441172cdf06aefa02ef1a355cb2958703c 100644 --- a/netbox/models/nested_tenant_group.go +++ b/netbox/models/nested_tenant_group.go @@ -27,7 +27,7 @@ import ( "github.com/go-openapi/validate" ) -// NestedTenantGroup Group +// NestedTenantGroup nested tenant group // swagger:model NestedTenantGroup type NestedTenantGroup struct { @@ -38,16 +38,23 @@ type NestedTenantGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // Tenant count + // Read Only: true + TenantCount int64 `json:"tenant_count,omitempty"` + // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -56,12 +63,14 @@ func (m *NestedTenantGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedTenantGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedTenantGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedTenantGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedTenantGroup) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedTenantGroup) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_user.go b/netbox/models/nested_user.go index aaf5c833355a546b8857c7e617c07c82d4b4e45c..6ad9ff192b99cbb255ab283f5c31d5f9c1c9aadc 100644 --- a/netbox/models/nested_user.go +++ b/netbox/models/nested_user.go @@ -40,6 +40,7 @@ type NestedUser struct { // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. // Required: true // Max Length: 150 + // Min Length: 1 // Pattern: ^[\w.@+-]+$ Username *string `json:"username"` } @@ -49,7 +50,6 @@ func (m *NestedUser) Validate(formats strfmt.Registry) error { var res []error if err := m.validateUsername(formats); err != nil { - // prop res = append(res, err) } @@ -65,6 +65,10 @@ func (m *NestedUser) validateUsername(formats strfmt.Registry) error { return err } + if err := validate.MinLength("username", "body", string(*m.Username), 1); err != nil { + return err + } + if err := validate.MaxLength("username", "body", string(*m.Username), 150); err != nil { return err } diff --git a/netbox/models/nested_vlan.go b/netbox/models/nested_v_l_a_n.go similarity index 85% rename from netbox/models/nested_vlan.go rename to netbox/models/nested_v_l_a_n.go index a9b0dc53e5abf8ce96d5451f36e899c926e32458..041ba48fef789816a54a71808ee4970896ad440c 100644 --- a/netbox/models/nested_vlan.go +++ b/netbox/models/nested_v_l_a_n.go @@ -27,7 +27,7 @@ import ( "github.com/go-openapi/validate" ) -// NestedVLAN Vlan +// NestedVLAN Untagged vlan // swagger:model NestedVLAN type NestedVLAN struct { @@ -42,10 +42,12 @@ type NestedVLAN struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` // ID @@ -60,12 +62,14 @@ func (m *NestedVLAN) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } if err := m.validateVid(formats); err != nil { - // prop res = append(res, err) } @@ -81,6 +85,10 @@ func (m *NestedVLAN) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -88,6 +96,19 @@ func (m *NestedVLAN) validateName(formats strfmt.Registry) error { return nil } +func (m *NestedVLAN) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + func (m *NestedVLAN) validateVid(formats strfmt.Registry) error { if err := validate.Required("vid", "body", m.Vid); err != nil { diff --git a/netbox/models/nested_vlangroup.go b/netbox/models/nested_v_l_a_n_group.go similarity index 80% rename from netbox/models/nested_vlangroup.go rename to netbox/models/nested_v_l_a_n_group.go index 89b2498ef6c18b2f531e54ffb9a8e4d7d1b88100..d146197d4aa686fae623e0a88c9d2f8a30a2b4d7 100644 --- a/netbox/models/nested_vlangroup.go +++ b/netbox/models/nested_v_l_a_n_group.go @@ -38,17 +38,24 @@ type NestedVLANGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` + + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` } // Validate validates this nested v l a n group @@ -56,12 +63,14 @@ func (m *NestedVLANGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -77,6 +86,10 @@ func (m *NestedVLANGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +103,10 @@ func (m *NestedVLANGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -101,6 +118,19 @@ func (m *NestedVLANGroup) validateSlug(formats strfmt.Registry) error { return nil } +func (m *NestedVLANGroup) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedVLANGroup) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/nested_vrf.go b/netbox/models/nested_v_r_f.go similarity index 79% rename from netbox/models/nested_vrf.go rename to netbox/models/nested_v_r_f.go index d7c05566dc4fc587dc12c808a8e5f2f0f4e2b2aa..902ad66b413c809284f3602c18376a4dbc9eaf83 100644 --- a/netbox/models/nested_vrf.go +++ b/netbox/models/nested_v_r_f.go @@ -38,15 +38,20 @@ type NestedVRF struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + // Route distinguisher - // Required: true // Max Length: 21 - Rd *string `json:"rd"` + Rd *string `json:"rd,omitempty"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -55,12 +60,14 @@ func (m *NestedVRF) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRd(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -76,6 +83,10 @@ func (m *NestedVRF) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -85,8 +96,8 @@ func (m *NestedVRF) validateName(formats strfmt.Registry) error { func (m *NestedVRF) validateRd(formats strfmt.Registry) error { - if err := validate.Required("rd", "body", m.Rd); err != nil { - return err + if swag.IsZero(m.Rd) { // not required + return nil } if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { @@ -96,6 +107,19 @@ func (m *NestedVRF) validateRd(formats strfmt.Registry) error { return nil } +func (m *NestedVRF) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedVRF) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/device_virtual_chassis.go b/netbox/models/nested_virtual_chassis.go similarity index 67% rename from netbox/models/device_virtual_chassis.go rename to netbox/models/nested_virtual_chassis.go index 16b284143cb008648ef0a13fa827ab0ddd7929d6..49294b6e178d4b8a91c58f1d7a4ffdc55cc34df1 100644 --- a/netbox/models/device_virtual_chassis.go +++ b/netbox/models/nested_virtual_chassis.go @@ -27,9 +27,9 @@ import ( "github.com/go-openapi/validate" ) -// DeviceVirtualChassis Virtual chassis -// swagger:model DeviceVirtualChassis -type DeviceVirtualChassis struct { +// NestedVirtualChassis Virtual chassis +// swagger:model NestedVirtualChassis +type NestedVirtualChassis struct { // ID // Read Only: true @@ -39,17 +39,25 @@ type DeviceVirtualChassis struct { // Required: true Master *NestedDevice `json:"master"` + // Member count + // Read Only: true + MemberCount int64 `json:"member_count,omitempty"` + // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } -// Validate validates this device virtual chassis -func (m *DeviceVirtualChassis) Validate(formats strfmt.Registry) error { +// Validate validates this nested virtual chassis +func (m *NestedVirtualChassis) Validate(formats strfmt.Registry) error { var res []error if err := m.validateMaster(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -59,14 +67,13 @@ func (m *DeviceVirtualChassis) Validate(formats strfmt.Registry) error { return nil } -func (m *DeviceVirtualChassis) validateMaster(formats strfmt.Registry) error { +func (m *NestedVirtualChassis) validateMaster(formats strfmt.Registry) error { if err := validate.Required("master", "body", m.Master); err != nil { return err } if m.Master != nil { - if err := m.Master.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("master") @@ -78,8 +85,21 @@ func (m *DeviceVirtualChassis) validateMaster(formats strfmt.Registry) error { return nil } +func (m *NestedVirtualChassis) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation -func (m *DeviceVirtualChassis) MarshalBinary() ([]byte, error) { +func (m *NestedVirtualChassis) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -87,8 +107,8 @@ func (m *DeviceVirtualChassis) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *DeviceVirtualChassis) UnmarshalBinary(b []byte) error { - var res DeviceVirtualChassis +func (m *NestedVirtualChassis) UnmarshalBinary(b []byte) error { + var res NestedVirtualChassis if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/netbox/models/nested_virtual_machine.go b/netbox/models/nested_virtual_machine.go index 0068bfb269887478b2353002d64d68fac4beffcd..5149b5079386df7f3d18a5e5c69ff91c68209976 100644 --- a/netbox/models/nested_virtual_machine.go +++ b/netbox/models/nested_virtual_machine.go @@ -38,10 +38,12 @@ type NestedVirtualMachine struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` // Url // Read Only: true + // Format: uri URL strfmt.URI `json:"url,omitempty"` } @@ -50,7 +52,10 @@ func (m *NestedVirtualMachine) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { res = append(res, err) } @@ -66,6 +71,10 @@ func (m *NestedVirtualMachine) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -73,6 +82,19 @@ func (m *NestedVirtualMachine) validateName(formats strfmt.Registry) error { return nil } +func (m *NestedVirtualMachine) validateURL(formats strfmt.Registry) error { + + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + // MarshalBinary interface implementation func (m *NestedVirtualMachine) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/object_change.go b/netbox/models/object_change.go new file mode 100644 index 0000000000000000000000000000000000000000..3b2f3082f80b6a7a9ed764fed0ab559fb65431a0 --- /dev/null +++ b/netbox/models/object_change.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ObjectChange object change +// swagger:model ObjectChange +type ObjectChange struct { + + // action + Action *ObjectChangeAction `json:"action,omitempty"` + + // Changed object + // + // + // Serialize a nested representation of the changed object. + // + // Read Only: true + ChangedObject map[string]string `json:"changed_object,omitempty"` + + // Changed object type + // Read Only: true + ChangedObjectType string `json:"changed_object_type,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Object data + // Read Only: true + ObjectData string `json:"object_data,omitempty"` + + // Request id + // Read Only: true + // Format: uuid + RequestID strfmt.UUID `json:"request_id,omitempty"` + + // Time + // Read Only: true + // Format: date-time + Time strfmt.DateTime `json:"time,omitempty"` + + // user + User *NestedUser `json:"user,omitempty"` + + // User name + // Read Only: true + // Min Length: 1 + UserName string `json:"user_name,omitempty"` +} + +// Validate validates this object change +func (m *ObjectChange) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAction(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTime(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ObjectChange) validateAction(formats strfmt.Registry) error { + + if swag.IsZero(m.Action) { // not required + return nil + } + + if m.Action != nil { + if err := m.Action.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("action") + } + return err + } + } + + return nil +} + +func (m *ObjectChange) validateRequestID(formats strfmt.Registry) error { + + if swag.IsZero(m.RequestID) { // not required + return nil + } + + if err := validate.FormatOf("request_id", "body", "uuid", m.RequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ObjectChange) validateTime(formats strfmt.Registry) error { + + if swag.IsZero(m.Time) { // not required + return nil + } + + if err := validate.FormatOf("time", "body", "date-time", m.Time.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ObjectChange) validateUser(formats strfmt.Registry) error { + + if swag.IsZero(m.User) { // not required + return nil + } + + if m.User != nil { + if err := m.User.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user") + } + return err + } + } + + return nil +} + +func (m *ObjectChange) validateUserName(formats strfmt.Registry) error { + + if swag.IsZero(m.UserName) { // not required + return nil + } + + if err := validate.MinLength("user_name", "body", string(m.UserName), 1); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ObjectChange) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ObjectChange) UnmarshalBinary(b []byte) error { + var res ObjectChange + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ObjectChangeAction Action +// swagger:model ObjectChangeAction +type ObjectChangeAction struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this object change action +func (m *ObjectChangeAction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ObjectChangeAction) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("action"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *ObjectChangeAction) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("action"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ObjectChangeAction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ObjectChangeAction) UnmarshalBinary(b []byte) error { + var res ObjectChangeAction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/peer_interface.go b/netbox/models/peer_interface.go deleted file mode 100644 index c10a3665b167a0dcd242fd7e906894adedd863de..0000000000000000000000000000000000000000 --- a/netbox/models/peer_interface.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PeerInterface Interface a -// swagger:model PeerInterface -type PeerInterface struct { - - // Description - // Max Length: 100 - Description string `json:"description,omitempty"` - - // device - // Required: true - Device *NestedDevice `json:"device"` - - // Enabled - Enabled bool `json:"enabled,omitempty"` - - // form factor - // Required: true - FormFactor *PeerInterfaceFormFactor `json:"form_factor"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // lag - // Required: true - Lag *NestedInterface `json:"lag"` - - // MAC Address - MacAddress string `json:"mac_address,omitempty"` - - // OOB Management - // - // This interface is used only for out-of-band management - MgmtOnly bool `json:"mgmt_only,omitempty"` - - // MTU - // Maximum: 32767 - // Minimum: 0 - Mtu *int64 `json:"mtu,omitempty"` - - // Name - // Required: true - // Max Length: 64 - Name *string `json:"name"` - - // Url - // Read Only: true - URL strfmt.URI `json:"url,omitempty"` -} - -// Validate validates this peer interface -func (m *PeerInterface) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateDevice(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateFormFactor(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateLag(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateMtu(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PeerInterface) validateDescription(formats strfmt.Registry) error { - - if swag.IsZero(m.Description) { // not required - return nil - } - - if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { - return err - } - - return nil -} - -func (m *PeerInterface) validateDevice(formats strfmt.Registry) error { - - if err := validate.Required("device", "body", m.Device); err != nil { - return err - } - - if m.Device != nil { - - if err := m.Device.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("device") - } - return err - } - } - - return nil -} - -func (m *PeerInterface) validateFormFactor(formats strfmt.Registry) error { - - if err := validate.Required("form_factor", "body", m.FormFactor); err != nil { - return err - } - - if m.FormFactor != nil { - - if err := m.FormFactor.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("form_factor") - } - return err - } - } - - return nil -} - -func (m *PeerInterface) validateLag(formats strfmt.Registry) error { - - if err := validate.Required("lag", "body", m.Lag); err != nil { - return err - } - - if m.Lag != nil { - - if err := m.Lag.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lag") - } - return err - } - } - - return nil -} - -func (m *PeerInterface) validateMtu(formats strfmt.Registry) error { - - if swag.IsZero(m.Mtu) { // not required - return nil - } - - if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { - return err - } - - return nil -} - -func (m *PeerInterface) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PeerInterface) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PeerInterface) UnmarshalBinary(b []byte) error { - var res PeerInterface - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/peer_interface_form_factor.go b/netbox/models/peer_interface_form_factor.go deleted file mode 100644 index 9964edcfe63fb192f85c904eacc62cd4fd501691..0000000000000000000000000000000000000000 --- a/netbox/models/peer_interface_form_factor.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PeerInterfaceFormFactor Form factor -// swagger:model peerInterfaceFormFactor -type PeerInterfaceFormFactor struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this peer interface form factor -func (m *PeerInterfaceFormFactor) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PeerInterfaceFormFactor) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *PeerInterfaceFormFactor) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PeerInterfaceFormFactor) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PeerInterfaceFormFactor) UnmarshalBinary(b []byte) error { - var res PeerInterfaceFormFactor - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/platform.go b/netbox/models/platform.go index 64e00744ea88a33231284fafa2d8e82fbe2c470c..e3fc8aad79f6d3f997caf3d4ca78611393469828 100644 --- a/netbox/models/platform.go +++ b/netbox/models/platform.go @@ -20,8 +20,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "encoding/json" - strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,33 +31,44 @@ import ( // swagger:model Platform type Platform struct { + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` // manufacturer - // Required: true - Manufacturer *NestedManufacturer `json:"manufacturer"` + Manufacturer *NestedManufacturer `json:"manufacturer,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // NAPALM arguments + // + // Additional arguments to pass when initiating the NAPALM driver (JSON format) + NapalmArgs *string `json:"napalm_args,omitempty"` + // NAPALM driver // // The name of the NAPALM driver to use when interacting with devices // Max Length: 50 NapalmDriver string `json:"napalm_driver,omitempty"` - // Legacy RPC client - RPCClient string `json:"rpc_client,omitempty"` - // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` } // Validate validates this platform @@ -67,27 +76,18 @@ func (m *Platform) Validate(formats strfmt.Registry) error { var res []error if err := m.validateManufacturer(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateNapalmDriver(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateRPCClient(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -99,12 +99,11 @@ func (m *Platform) Validate(formats strfmt.Registry) error { func (m *Platform) validateManufacturer(formats strfmt.Registry) error { - if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { - return err + if swag.IsZero(m.Manufacturer) { // not required + return nil } if m.Manufacturer != nil { - if err := m.Manufacturer.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("manufacturer") @@ -122,6 +121,10 @@ func (m *Platform) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -142,52 +145,13 @@ func (m *Platform) validateNapalmDriver(formats strfmt.Registry) error { return nil } -var platformTypeRPCClientPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["juniper-junos","cisco-ios","opengear"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - platformTypeRPCClientPropEnum = append(platformTypeRPCClientPropEnum, v) - } -} - -const ( - // PlatformRPCClientJuniperJunos captures enum value "juniper-junos" - PlatformRPCClientJuniperJunos string = "juniper-junos" - // PlatformRPCClientCiscoIos captures enum value "cisco-ios" - PlatformRPCClientCiscoIos string = "cisco-ios" - // PlatformRPCClientOpengear captures enum value "opengear" - PlatformRPCClientOpengear string = "opengear" -) - -// prop value enum -func (m *Platform) validateRPCClientEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, platformTypeRPCClientPropEnum); err != nil { - return err - } - return nil -} - -func (m *Platform) validateRPCClient(formats strfmt.Registry) error { - - if swag.IsZero(m.RPCClient) { // not required - return nil - } +func (m *Platform) validateSlug(formats strfmt.Registry) error { - // value enum - if err := m.validateRPCClientEnum("rpc_client", "body", m.RPCClient); err != nil { + if err := validate.Required("slug", "body", m.Slug); err != nil { return err } - return nil -} - -func (m *Platform) validateSlug(formats strfmt.Registry) error { - - if err := validate.Required("slug", "body", m.Slug); err != nil { + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { return err } diff --git a/netbox/models/power_feed.go b/netbox/models/power_feed.go new file mode 100644 index 0000000000000000000000000000000000000000..e0de038abdba50f7b1a9622c6c1fdce5ea8adf21 --- /dev/null +++ b/netbox/models/power_feed.go @@ -0,0 +1,720 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PowerFeed power feed +// swagger:model PowerFeed +type PowerFeed struct { + + // Amperage + // Maximum: 32767 + // Minimum: 1 + Amperage int64 `json:"amperage,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Max utilization + // + // Maximum permissible draw (percentage) + // Maximum: 100 + // Minimum: 1 + MaxUtilization int64 `json:"max_utilization,omitempty"` + + // Name + // Required: true + // Max Length: 50 + // Min Length: 1 + Name *string `json:"name"` + + // phase + Phase *PowerFeedPhase `json:"phase,omitempty"` + + // power panel + // Required: true + PowerPanel *NestedPowerPanel `json:"power_panel"` + + // rack + Rack *NestedRack `json:"rack,omitempty"` + + // status + Status *PowerFeedStatus `json:"status,omitempty"` + + // supply + Supply *PowerFeedSupply `json:"supply,omitempty"` + + // tags + Tags []string `json:"tags"` + + // type + Type *PowerFeedType `json:"type,omitempty"` + + // Voltage + // Maximum: 32767 + // Minimum: 1 + Voltage int64 `json:"voltage,omitempty"` +} + +// Validate validates this power feed +func (m *PowerFeed) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAmperage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxUtilization(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhase(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePowerPanel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRack(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSupply(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVoltage(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerFeed) validateAmperage(formats strfmt.Registry) error { + + if swag.IsZero(m.Amperage) { // not required + return nil + } + + if err := validate.MinimumInt("amperage", "body", int64(m.Amperage), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("amperage", "body", int64(m.Amperage), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *PowerFeed) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PowerFeed) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PowerFeed) validateMaxUtilization(formats strfmt.Registry) error { + + if swag.IsZero(m.MaxUtilization) { // not required + return nil + } + + if err := validate.MinimumInt("max_utilization", "body", int64(m.MaxUtilization), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("max_utilization", "body", int64(m.MaxUtilization), 100, false); err != nil { + return err + } + + return nil +} + +func (m *PowerFeed) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *PowerFeed) validatePhase(formats strfmt.Registry) error { + + if swag.IsZero(m.Phase) { // not required + return nil + } + + if m.Phase != nil { + if err := m.Phase.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("phase") + } + return err + } + } + + return nil +} + +func (m *PowerFeed) validatePowerPanel(formats strfmt.Registry) error { + + if err := validate.Required("power_panel", "body", m.PowerPanel); err != nil { + return err + } + + if m.PowerPanel != nil { + if err := m.PowerPanel.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("power_panel") + } + return err + } + } + + return nil +} + +func (m *PowerFeed) validateRack(formats strfmt.Registry) error { + + if swag.IsZero(m.Rack) { // not required + return nil + } + + if m.Rack != nil { + if err := m.Rack.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rack") + } + return err + } + } + + return nil +} + +func (m *PowerFeed) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *PowerFeed) validateSupply(formats strfmt.Registry) error { + + if swag.IsZero(m.Supply) { // not required + return nil + } + + if m.Supply != nil { + if err := m.Supply.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("supply") + } + return err + } + } + + return nil +} + +func (m *PowerFeed) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +func (m *PowerFeed) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *PowerFeed) validateVoltage(formats strfmt.Registry) error { + + if swag.IsZero(m.Voltage) { // not required + return nil + } + + if err := validate.MinimumInt("voltage", "body", int64(m.Voltage), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("voltage", "body", int64(m.Voltage), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerFeed) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerFeed) UnmarshalBinary(b []byte) error { + var res PowerFeed + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PowerFeedPhase Phase +// swagger:model PowerFeedPhase +type PowerFeedPhase struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +func (m *PowerFeedPhase) UnmarshalJSON(b []byte) error { + type PowerFeedPhaseAlias PowerFeedPhase + var t PowerFeedPhaseAlias + if err := json.Unmarshal([]byte("{\"label\":\"Single phase\",\"value\":1}"), &t); err != nil { + return err + } + if err := json.Unmarshal(b, &t); err != nil { + return err + } + *m = PowerFeedPhase(t) + return nil +} + +// Validate validates this power feed phase +func (m *PowerFeedPhase) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerFeedPhase) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("phase"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PowerFeedPhase) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("phase"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerFeedPhase) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerFeedPhase) UnmarshalBinary(b []byte) error { + var res PowerFeedPhase + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PowerFeedStatus Status +// swagger:model PowerFeedStatus +type PowerFeedStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +func (m *PowerFeedStatus) UnmarshalJSON(b []byte) error { + type PowerFeedStatusAlias PowerFeedStatus + var t PowerFeedStatusAlias + if err := json.Unmarshal([]byte("{\"label\":\"Active\",\"value\":1}"), &t); err != nil { + return err + } + if err := json.Unmarshal(b, &t); err != nil { + return err + } + *m = PowerFeedStatus(t) + return nil +} + +// Validate validates this power feed status +func (m *PowerFeedStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerFeedStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PowerFeedStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerFeedStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerFeedStatus) UnmarshalBinary(b []byte) error { + var res PowerFeedStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PowerFeedSupply Supply +// swagger:model PowerFeedSupply +type PowerFeedSupply struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +func (m *PowerFeedSupply) UnmarshalJSON(b []byte) error { + type PowerFeedSupplyAlias PowerFeedSupply + var t PowerFeedSupplyAlias + if err := json.Unmarshal([]byte("{\"label\":\"AC\",\"value\":1}"), &t); err != nil { + return err + } + if err := json.Unmarshal(b, &t); err != nil { + return err + } + *m = PowerFeedSupply(t) + return nil +} + +// Validate validates this power feed supply +func (m *PowerFeedSupply) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerFeedSupply) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("supply"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PowerFeedSupply) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("supply"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerFeedSupply) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerFeedSupply) UnmarshalBinary(b []byte) error { + var res PowerFeedSupply + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PowerFeedType Type +// swagger:model PowerFeedType +type PowerFeedType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +func (m *PowerFeedType) UnmarshalJSON(b []byte) error { + type PowerFeedTypeAlias PowerFeedType + var t PowerFeedTypeAlias + if err := json.Unmarshal([]byte("{\"label\":\"Primary\",\"value\":1}"), &t); err != nil { + return err + } + if err := json.Unmarshal(b, &t); err != nil { + return err + } + *m = PowerFeedType(t) + return nil +} + +// Validate validates this power feed type +func (m *PowerFeedType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerFeedType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PowerFeedType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerFeedType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerFeedType) UnmarshalBinary(b []byte) error { + var res PowerFeedType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_outlet.go b/netbox/models/power_outlet.go index 85a2c7d97c32e3d1a834fc7ed3890c2b19f23827..71153834986ef01c22fb8089ff0a2085893daaf6 100644 --- a/netbox/models/power_outlet.go +++ b/netbox/models/power_outlet.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -27,18 +29,39 @@ import ( "github.com/go-openapi/validate" ) -// PowerOutlet Power outlet +// PowerOutlet power outlet // swagger:model PowerOutlet type PowerOutlet struct { - // Connected port + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type // Read Only: true - ConnectedPort string `json:"connected_port,omitempty"` + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // connection status + ConnectionStatus *PowerOutletConnectionStatus `json:"connection_status,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` // device // Required: true Device *NestedDevice `json:"device"` + // feed leg + FeedLeg *PowerOutletFeedLeg `json:"feed_leg,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -46,20 +69,49 @@ type PowerOutlet struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // power port + PowerPort *NestedPowerPort `json:"power_port,omitempty"` + + // tags + Tags []string `json:"tags"` } // Validate validates this power outlet func (m *PowerOutlet) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateFeedLeg(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validatePowerPort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -69,6 +121,55 @@ func (m *PowerOutlet) Validate(formats strfmt.Registry) error { return nil } +func (m *PowerOutlet) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +func (m *PowerOutlet) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + if m.ConnectionStatus != nil { + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + } + + return nil +} + +func (m *PowerOutlet) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *PowerOutlet) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -76,7 +177,6 @@ func (m *PowerOutlet) validateDevice(formats strfmt.Registry) error { } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -88,12 +188,34 @@ func (m *PowerOutlet) validateDevice(formats strfmt.Registry) error { return nil } +func (m *PowerOutlet) validateFeedLeg(formats strfmt.Registry) error { + + if swag.IsZero(m.FeedLeg) { // not required + return nil + } + + if m.FeedLeg != nil { + if err := m.FeedLeg.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feed_leg") + } + return err + } + } + + return nil +} + func (m *PowerOutlet) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -101,6 +223,41 @@ func (m *PowerOutlet) validateName(formats strfmt.Registry) error { return nil } +func (m *PowerOutlet) validatePowerPort(formats strfmt.Registry) error { + + if swag.IsZero(m.PowerPort) { // not required + return nil + } + + if m.PowerPort != nil { + if err := m.PowerPort.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("power_port") + } + return err + } + } + + return nil +} + +func (m *PowerOutlet) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *PowerOutlet) MarshalBinary() ([]byte, error) { if m == nil { @@ -118,3 +275,137 @@ func (m *PowerOutlet) UnmarshalBinary(b []byte) error { *m = res return nil } + +// PowerOutletConnectionStatus Connection status +// swagger:model PowerOutletConnectionStatus +type PowerOutletConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this power outlet connection status +func (m *PowerOutletConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerOutletConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PowerOutletConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerOutletConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerOutletConnectionStatus) UnmarshalBinary(b []byte) error { + var res PowerOutletConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PowerOutletFeedLeg Feed leg +// swagger:model PowerOutletFeedLeg +type PowerOutletFeedLeg struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this power outlet feed leg +func (m *PowerOutletFeedLeg) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerOutletFeedLeg) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("feed_leg"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PowerOutletFeedLeg) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("feed_leg"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerOutletFeedLeg) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerOutletFeedLeg) UnmarshalBinary(b []byte) error { + var res PowerOutletFeedLeg + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_outlet_template.go b/netbox/models/power_outlet_template.go index a393cb2ca65ddb85daf428a62d6c30b39a78e3fb..804cc9f1bbd67f425a2083dd6723c0a8dd614637 100644 --- a/netbox/models/power_outlet_template.go +++ b/netbox/models/power_outlet_template.go @@ -35,6 +35,9 @@ type PowerOutletTemplate struct { // Required: true DeviceType *NestedDeviceType `json:"device_type"` + // feed leg + FeedLeg *PowerOutletTemplateFeedLeg `json:"feed_leg,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -42,7 +45,11 @@ type PowerOutletTemplate struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // power port + PowerPort *PowerPortTemplate `json:"power_port,omitempty"` } // Validate validates this power outlet template @@ -50,12 +57,18 @@ func (m *PowerOutletTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateFeedLeg(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validatePowerPort(formats); err != nil { res = append(res, err) } @@ -72,7 +85,6 @@ func (m *PowerOutletTemplate) validateDeviceType(formats strfmt.Registry) error } if m.DeviceType != nil { - if err := m.DeviceType.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device_type") @@ -84,12 +96,34 @@ func (m *PowerOutletTemplate) validateDeviceType(formats strfmt.Registry) error return nil } +func (m *PowerOutletTemplate) validateFeedLeg(formats strfmt.Registry) error { + + if swag.IsZero(m.FeedLeg) { // not required + return nil + } + + if m.FeedLeg != nil { + if err := m.FeedLeg.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("feed_leg") + } + return err + } + } + + return nil +} + func (m *PowerOutletTemplate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -97,6 +131,24 @@ func (m *PowerOutletTemplate) validateName(formats strfmt.Registry) error { return nil } +func (m *PowerOutletTemplate) validatePowerPort(formats strfmt.Registry) error { + + if swag.IsZero(m.PowerPort) { // not required + return nil + } + + if m.PowerPort != nil { + if err := m.PowerPort.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("power_port") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *PowerOutletTemplate) MarshalBinary() ([]byte, error) { if m == nil { @@ -114,3 +166,70 @@ func (m *PowerOutletTemplate) UnmarshalBinary(b []byte) error { *m = res return nil } + +// PowerOutletTemplateFeedLeg Feed leg +// swagger:model PowerOutletTemplateFeedLeg +type PowerOutletTemplateFeedLeg struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this power outlet template feed leg +func (m *PowerOutletTemplateFeedLeg) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerOutletTemplateFeedLeg) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("feed_leg"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PowerOutletTemplateFeedLeg) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("feed_leg"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerOutletTemplateFeedLeg) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerOutletTemplateFeedLeg) UnmarshalBinary(b []byte) error { + var res PowerOutletTemplateFeedLeg + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_panel.go b/netbox/models/power_panel.go new file mode 100644 index 0000000000000000000000000000000000000000..237fca33ada4996c9a914b94fbfe5393ad1bcc0f --- /dev/null +++ b/netbox/models/power_panel.go @@ -0,0 +1,147 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PowerPanel power panel +// swagger:model PowerPanel +type PowerPanel struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + // Min Length: 1 + Name *string `json:"name"` + + // Powerfeed count + // Read Only: true + PowerfeedCount int64 `json:"powerfeed_count,omitempty"` + + // rack group + RackGroup *NestedRackGroup `json:"rack_group,omitempty"` + + // site + // Required: true + Site *NestedSite `json:"site"` +} + +// Validate validates this power panel +func (m *PowerPanel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRackGroup(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerPanel) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *PowerPanel) validateRackGroup(formats strfmt.Registry) error { + + if swag.IsZero(m.RackGroup) { // not required + return nil + } + + if m.RackGroup != nil { + if err := m.RackGroup.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rack_group") + } + return err + } + } + + return nil +} + +func (m *PowerPanel) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerPanel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerPanel) UnmarshalBinary(b []byte) error { + var res PowerPanel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_port.go b/netbox/models/power_port.go index 6b1fc4b5e611ca3ee4212e2e40f5d55943b3547f..209303928929bde1327ee96a991bd442493a08de 100644 --- a/netbox/models/power_port.go +++ b/netbox/models/power_port.go @@ -20,7 +20,7 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -33,8 +33,34 @@ import ( // swagger:model PowerPort type PowerPort struct { - // Connection status - ConnectionStatus bool `json:"connection_status,omitempty"` + // Allocated draw + // + // Allocated current draw (watts) + // Maximum: 32767 + // Minimum: 1 + AllocatedDraw *int64 `json:"allocated_draw,omitempty"` + + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // connection status + ConnectionStatus *PowerPortConnectionStatus `json:"connection_status,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` // device // Required: true @@ -44,37 +70,56 @@ type PowerPort struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Maximum draw + // + // Maximum current draw (watts) + // Maximum: 32767 + // Minimum: 1 + MaximumDraw *int64 `json:"maximum_draw,omitempty"` + // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` - // power outlet - // Required: true - PowerOutlet *PowerOutlet `json:"power_outlet"` + // tags + Tags []string `json:"tags"` } // Validate validates this power port func (m *PowerPort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAllocatedDraw(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + if err := m.validateConnectionStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { res = append(res, err) } if err := m.validateDevice(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateMaximumDraw(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } - if err := m.validatePowerOutlet(formats); err != nil { - // prop + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -84,23 +129,38 @@ func (m *PowerPort) Validate(formats strfmt.Registry) error { return nil } -var powerPortTypeConnectionStatusPropEnum []interface{} +func (m *PowerPort) validateAllocatedDraw(formats strfmt.Registry) error { -func init() { - var res []bool - if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { - panic(err) + if swag.IsZero(m.AllocatedDraw) { // not required + return nil } - for _, v := range res { - powerPortTypeConnectionStatusPropEnum = append(powerPortTypeConnectionStatusPropEnum, v) + + if err := validate.MinimumInt("allocated_draw", "body", int64(*m.AllocatedDraw), 1, false); err != nil { + return err } -} -// prop value enum -func (m *PowerPort) validateConnectionStatusEnum(path, location string, value bool) error { - if err := validate.Enum(path, location, value, powerPortTypeConnectionStatusPropEnum); err != nil { + if err := validate.MaximumInt("allocated_draw", "body", int64(*m.AllocatedDraw), 32767, false); err != nil { return err } + + return nil +} + +func (m *PowerPort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + return nil } @@ -110,8 +170,25 @@ func (m *PowerPort) validateConnectionStatus(formats strfmt.Registry) error { return nil } - // value enum - if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + if m.ConnectionStatus != nil { + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + } + + return nil +} + +func (m *PowerPort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { return err } @@ -125,7 +202,6 @@ func (m *PowerPort) validateDevice(formats strfmt.Registry) error { } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -137,12 +213,33 @@ func (m *PowerPort) validateDevice(formats strfmt.Registry) error { return nil } +func (m *PowerPort) validateMaximumDraw(formats strfmt.Registry) error { + + if swag.IsZero(m.MaximumDraw) { // not required + return nil + } + + if err := validate.MinimumInt("maximum_draw", "body", int64(*m.MaximumDraw), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("maximum_draw", "body", int64(*m.MaximumDraw), 32767, false); err != nil { + return err + } + + return nil +} + func (m *PowerPort) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -150,20 +247,18 @@ func (m *PowerPort) validateName(formats strfmt.Registry) error { return nil } -func (m *PowerPort) validatePowerOutlet(formats strfmt.Registry) error { +func (m *PowerPort) validateTags(formats strfmt.Registry) error { - if err := validate.Required("power_outlet", "body", m.PowerOutlet); err != nil { - return err + if swag.IsZero(m.Tags) { // not required + return nil } - if m.PowerOutlet != nil { + for i := 0; i < len(m.Tags); i++ { - if err := m.PowerOutlet.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("power_outlet") - } + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { return err } + } return nil @@ -186,3 +281,70 @@ func (m *PowerPort) UnmarshalBinary(b []byte) error { *m = res return nil } + +// PowerPortConnectionStatus Connection status +// swagger:model PowerPortConnectionStatus +type PowerPortConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this power port connection status +func (m *PowerPortConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerPortConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PowerPortConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("connection_status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerPortConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerPortConnectionStatus) UnmarshalBinary(b []byte) error { + var res PowerPortConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_port_template.go b/netbox/models/power_port_template.go index 7b628bba0649cb7f5ce1a94b2375ac51c551c421..5cf748011f01c416a2256cc7979b8b8c64e5f493 100644 --- a/netbox/models/power_port_template.go +++ b/netbox/models/power_port_template.go @@ -27,10 +27,17 @@ import ( "github.com/go-openapi/validate" ) -// PowerPortTemplate power port template +// PowerPortTemplate Power port // swagger:model PowerPortTemplate type PowerPortTemplate struct { + // Allocated draw + // + // Allocated current draw (watts) + // Maximum: 32767 + // Minimum: 1 + AllocatedDraw *int64 `json:"allocated_draw,omitempty"` + // device type // Required: true DeviceType *NestedDeviceType `json:"device_type"` @@ -39,9 +46,17 @@ type PowerPortTemplate struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Maximum draw + // + // Maximum current draw (watts) + // Maximum: 32767 + // Minimum: 1 + MaximumDraw *int64 `json:"maximum_draw,omitempty"` + // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` } @@ -49,13 +64,19 @@ type PowerPortTemplate struct { func (m *PowerPortTemplate) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAllocatedDraw(formats); err != nil { + res = append(res, err) + } + if err := m.validateDeviceType(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateMaximumDraw(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } @@ -65,6 +86,23 @@ func (m *PowerPortTemplate) Validate(formats strfmt.Registry) error { return nil } +func (m *PowerPortTemplate) validateAllocatedDraw(formats strfmt.Registry) error { + + if swag.IsZero(m.AllocatedDraw) { // not required + return nil + } + + if err := validate.MinimumInt("allocated_draw", "body", int64(*m.AllocatedDraw), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("allocated_draw", "body", int64(*m.AllocatedDraw), 32767, false); err != nil { + return err + } + + return nil +} + func (m *PowerPortTemplate) validateDeviceType(formats strfmt.Registry) error { if err := validate.Required("device_type", "body", m.DeviceType); err != nil { @@ -72,7 +110,6 @@ func (m *PowerPortTemplate) validateDeviceType(formats strfmt.Registry) error { } if m.DeviceType != nil { - if err := m.DeviceType.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device_type") @@ -84,12 +121,33 @@ func (m *PowerPortTemplate) validateDeviceType(formats strfmt.Registry) error { return nil } +func (m *PowerPortTemplate) validateMaximumDraw(formats strfmt.Registry) error { + + if swag.IsZero(m.MaximumDraw) { // not required + return nil + } + + if err := validate.MinimumInt("maximum_draw", "body", int64(*m.MaximumDraw), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("maximum_draw", "body", int64(*m.MaximumDraw), 32767, false); err != nil { + return err + } + + return nil +} + func (m *PowerPortTemplate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } diff --git a/netbox/models/prefix.go b/netbox/models/prefix.go index a5ea409be2029123042c700607666dbd9af88485..6c8a42328a5e073963926a82974e654218140cc7 100644 --- a/netbox/models/prefix.go +++ b/netbox/models/prefix.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,6 +35,7 @@ type Prefix struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -42,9 +45,8 @@ type Prefix struct { // Max Length: 100 Description string `json:"description,omitempty"` - // Family - // Read Only: true - Family int64 `json:"family,omitempty"` + // family + Family *PrefixFamily `json:"family,omitempty"` // ID // Read Only: true @@ -57,6 +59,7 @@ type Prefix struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Prefix @@ -66,71 +69,76 @@ type Prefix struct { Prefix *string `json:"prefix"` // role - // Required: true - Role *NestedRole `json:"role"` + Role *NestedRole `json:"role,omitempty"` // site - // Required: true - Site *NestedSite `json:"site"` + Site *NestedSite `json:"site,omitempty"` // status - // Required: true - Status *PrefixStatus `json:"status"` + Status *PrefixStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // vlan - // Required: true - Vlan *NestedVLAN `json:"vlan"` + Vlan *NestedVLAN `json:"vlan,omitempty"` // vrf - // Required: true - Vrf *NestedVRF `json:"vrf"` + Vrf *NestedVRF `json:"vrf,omitempty"` } // Validate validates this prefix func (m *Prefix) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateFamily(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validatePrefix(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRole(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVlan(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVrf(formats); err != nil { - // prop res = append(res, err) } @@ -140,6 +148,19 @@ func (m *Prefix) Validate(formats strfmt.Registry) error { return nil } +func (m *Prefix) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Prefix) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -153,6 +174,37 @@ func (m *Prefix) validateDescription(formats strfmt.Registry) error { return nil } +func (m *Prefix) validateFamily(formats strfmt.Registry) error { + + if swag.IsZero(m.Family) { // not required + return nil + } + + if m.Family != nil { + if err := m.Family.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("family") + } + return err + } + } + + return nil +} + +func (m *Prefix) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Prefix) validatePrefix(formats strfmt.Registry) error { if err := validate.Required("prefix", "body", m.Prefix); err != nil { @@ -164,12 +216,11 @@ func (m *Prefix) validatePrefix(formats strfmt.Registry) error { func (m *Prefix) validateRole(formats strfmt.Registry) error { - if err := validate.Required("role", "body", m.Role); err != nil { - return err + if swag.IsZero(m.Role) { // not required + return nil } if m.Role != nil { - if err := m.Role.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("role") @@ -183,12 +234,11 @@ func (m *Prefix) validateRole(formats strfmt.Registry) error { func (m *Prefix) validateSite(formats strfmt.Registry) error { - if err := validate.Required("site", "body", m.Site); err != nil { - return err + if swag.IsZero(m.Site) { // not required + return nil } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -202,12 +252,11 @@ func (m *Prefix) validateSite(formats strfmt.Registry) error { func (m *Prefix) validateStatus(formats strfmt.Registry) error { - if err := validate.Required("status", "body", m.Status); err != nil { - return err + if swag.IsZero(m.Status) { // not required + return nil } if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") @@ -219,14 +268,30 @@ func (m *Prefix) validateStatus(formats strfmt.Registry) error { return nil } +func (m *Prefix) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *Prefix) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -240,12 +305,11 @@ func (m *Prefix) validateTenant(formats strfmt.Registry) error { func (m *Prefix) validateVlan(formats strfmt.Registry) error { - if err := validate.Required("vlan", "body", m.Vlan); err != nil { - return err + if swag.IsZero(m.Vlan) { // not required + return nil } if m.Vlan != nil { - if err := m.Vlan.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vlan") @@ -259,12 +323,11 @@ func (m *Prefix) validateVlan(formats strfmt.Registry) error { func (m *Prefix) validateVrf(formats strfmt.Registry) error { - if err := validate.Required("vrf", "body", m.Vrf); err != nil { - return err + if swag.IsZero(m.Vrf) { // not required + return nil } if m.Vrf != nil { - if err := m.Vrf.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("vrf") @@ -293,3 +356,137 @@ func (m *Prefix) UnmarshalBinary(b []byte) error { *m = res return nil } + +// PrefixFamily Family +// swagger:model PrefixFamily +type PrefixFamily struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this prefix family +func (m *PrefixFamily) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PrefixFamily) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("family"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PrefixFamily) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("family"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PrefixFamily) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrefixFamily) UnmarshalBinary(b []byte) error { + var res PrefixFamily + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PrefixStatus Status +// swagger:model PrefixStatus +type PrefixStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this prefix status +func (m *PrefixStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PrefixStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PrefixStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PrefixStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrefixStatus) UnmarshalBinary(b []byte) error { + var res PrefixStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/prefix_status.go b/netbox/models/prefix_status.go deleted file mode 100644 index 15c2528eeba669cfad979117089d028c501932e6..0000000000000000000000000000000000000000 --- a/netbox/models/prefix_status.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PrefixStatus Status -// swagger:model prefixStatus -type PrefixStatus struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this prefix status -func (m *PrefixStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PrefixStatus) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *PrefixStatus) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PrefixStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PrefixStatus) UnmarshalBinary(b []byte) error { - var res PrefixStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/provider.go b/netbox/models/provider.go index e3add7ab0db4a889f710aa897e56ea550b5a9407..370b04f0844003a21975ef35d13d79ae8317a873 100644 --- a/netbox/models/provider.go +++ b/netbox/models/provider.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -41,13 +43,18 @@ type Provider struct { // ASN // Maximum: 4.294967295e+09 // Minimum: 1 - Asn int64 `json:"asn,omitempty"` + Asn *int64 `json:"asn,omitempty"` + + // Circuit count + // Read Only: true + CircuitCount int64 `json:"circuit_count,omitempty"` // Comments Comments string `json:"comments,omitempty"` // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -59,11 +66,13 @@ type Provider struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // NOC contact @@ -71,13 +80,18 @@ type Provider struct { // Portal // Max Length: 200 + // Format: uri PortalURL strfmt.URI `json:"portal_url,omitempty"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + + // tags + Tags []string `json:"tags"` } // Validate validates this provider @@ -85,27 +99,34 @@ func (m *Provider) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAccount(formats); err != nil { - // prop res = append(res, err) } if err := m.validateAsn(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePortalURL(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -134,11 +155,37 @@ func (m *Provider) validateAsn(formats strfmt.Registry) error { return nil } - if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + if err := validate.MinimumInt("asn", "body", int64(*m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(*m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Provider) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { return err } - if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return nil +} + +func (m *Provider) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { return err } @@ -151,6 +198,10 @@ func (m *Provider) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -181,6 +232,10 @@ func (m *Provider) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -192,6 +247,23 @@ func (m *Provider) validateSlug(formats strfmt.Registry) error { return nil } +func (m *Provider) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Provider) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/rir.go b/netbox/models/r_i_r.go similarity index 89% rename from netbox/models/rir.go rename to netbox/models/r_i_r.go index 16ddcc52497642fb6668c5a3ee207d06ce8e14df..ee70133014e842f66a9c0384cd88329ee4768ef2 100644 --- a/netbox/models/rir.go +++ b/netbox/models/r_i_r.go @@ -31,6 +31,10 @@ import ( // swagger:model RIR type RIR struct { + // Aggregate count + // Read Only: true + AggregateCount int64 `json:"aggregate_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -43,11 +47,13 @@ type RIR struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -57,12 +63,10 @@ func (m *RIR) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -78,6 +82,10 @@ func (m *RIR) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -91,6 +99,10 @@ func (m *RIR) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/rack.go b/netbox/models/rack.go index 539df8183ba236118f8a9db79048d4fef70f8ecf..4e608cef5e0afd46964595d5cbaa95f3bb2276dc 100644 --- a/netbox/models/rack.go +++ b/netbox/models/rack.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -31,11 +33,18 @@ import ( // swagger:model Rack type Rack struct { + // Asset tag + // + // A unique tag used to identify this rack + // Max Length: 50 + AssetTag *string `json:"asset_tag,omitempty"` + // Comments Comments string `json:"comments,omitempty"` // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -46,18 +55,20 @@ type Rack struct { // Units are numbered top-to-bottom DescUnits bool `json:"desc_units,omitempty"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // Display name // Read Only: true DisplayName string `json:"display_name,omitempty"` // Facility ID - // Required: true // Max Length: 50 - FacilityID *string `json:"facility_id"` + FacilityID *string `json:"facility_id,omitempty"` // group - // Required: true - Group *NestedRackGroup `json:"group"` + Group *NestedRackGroup `json:"group,omitempty"` // ID // Read Only: true @@ -65,16 +76,34 @@ type Rack struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Outer depth + // Maximum: 32767 + // Minimum: 0 + OuterDepth *int64 `json:"outer_depth,omitempty"` + + // outer unit + OuterUnit *RackOuterUnit `json:"outer_unit,omitempty"` + + // Outer width + // Maximum: 32767 + // Minimum: 0 + OuterWidth *int64 `json:"outer_width,omitempty"` + + // Powerfeed count + // Read Only: true + PowerfeedCount int64 `json:"powerfeed_count,omitempty"` + // role - // Required: true - Role *NestedRackRole `json:"role"` + Role *NestedRackRole `json:"role,omitempty"` // Serial number // Max Length: 50 @@ -84,13 +113,17 @@ type Rack struct { // Required: true Site *NestedSite `json:"site"` + // status + Status *RackStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` + // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // type - // Required: true - Type *RackType `json:"type"` + Type *RackType `json:"type,omitempty"` // Height (U) // Maximum: 100 @@ -98,61 +131,82 @@ type Rack struct { UHeight int64 `json:"u_height,omitempty"` // width - // Required: true - Width *RackWidth `json:"width"` + Width *RackWidth `json:"width,omitempty"` } // Validate validates this rack func (m *Rack) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAssetTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateFacilityID(formats); err != nil { - // prop res = append(res, err) } if err := m.validateGroup(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateOuterDepth(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOuterUnit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOuterWidth(formats); err != nil { res = append(res, err) } if err := m.validateRole(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSerial(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateUHeight(formats); err != nil { - // prop res = append(res, err) } if err := m.validateWidth(formats); err != nil { - // prop res = append(res, err) } @@ -162,12 +216,38 @@ func (m *Rack) Validate(formats strfmt.Registry) error { return nil } -func (m *Rack) validateFacilityID(formats strfmt.Registry) error { +func (m *Rack) validateAssetTag(formats strfmt.Registry) error { - if err := validate.Required("facility_id", "body", m.FacilityID); err != nil { + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(*m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { return err } + return nil +} + +func (m *Rack) validateFacilityID(formats strfmt.Registry) error { + + if swag.IsZero(m.FacilityID) { // not required + return nil + } + if err := validate.MaxLength("facility_id", "body", string(*m.FacilityID), 50); err != nil { return err } @@ -177,12 +257,11 @@ func (m *Rack) validateFacilityID(formats strfmt.Registry) error { func (m *Rack) validateGroup(formats strfmt.Registry) error { - if err := validate.Required("group", "body", m.Group); err != nil { - return err + if swag.IsZero(m.Group) { // not required + return nil } if m.Group != nil { - if err := m.Group.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("group") @@ -194,12 +273,29 @@ func (m *Rack) validateGroup(formats strfmt.Registry) error { return nil } +func (m *Rack) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Rack) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -207,14 +303,65 @@ func (m *Rack) validateName(formats strfmt.Registry) error { return nil } -func (m *Rack) validateRole(formats strfmt.Registry) error { +func (m *Rack) validateOuterDepth(formats strfmt.Registry) error { - if err := validate.Required("role", "body", m.Role); err != nil { + if swag.IsZero(m.OuterDepth) { // not required + return nil + } + + if err := validate.MinimumInt("outer_depth", "body", int64(*m.OuterDepth), 0, false); err != nil { return err } - if m.Role != nil { + if err := validate.MaximumInt("outer_depth", "body", int64(*m.OuterDepth), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateOuterUnit(formats strfmt.Registry) error { + + if swag.IsZero(m.OuterUnit) { // not required + return nil + } + + if m.OuterUnit != nil { + if err := m.OuterUnit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("outer_unit") + } + return err + } + } + return nil +} + +func (m *Rack) validateOuterWidth(formats strfmt.Registry) error { + + if swag.IsZero(m.OuterWidth) { // not required + return nil + } + + if err := validate.MinimumInt("outer_width", "body", int64(*m.OuterWidth), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("outer_width", "body", int64(*m.OuterWidth), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateRole(formats strfmt.Registry) error { + + if swag.IsZero(m.Role) { // not required + return nil + } + + if m.Role != nil { if err := m.Role.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("role") @@ -246,7 +393,6 @@ func (m *Rack) validateSite(formats strfmt.Registry) error { } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -258,14 +404,48 @@ func (m *Rack) validateSite(formats strfmt.Registry) error { return nil } +func (m *Rack) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *Rack) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *Rack) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -279,12 +459,11 @@ func (m *Rack) validateTenant(formats strfmt.Registry) error { func (m *Rack) validateType(formats strfmt.Registry) error { - if err := validate.Required("type", "body", m.Type); err != nil { - return err + if swag.IsZero(m.Type) { // not required + return nil } if m.Type != nil { - if err := m.Type.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("type") @@ -315,12 +494,11 @@ func (m *Rack) validateUHeight(formats strfmt.Registry) error { func (m *Rack) validateWidth(formats strfmt.Registry) error { - if err := validate.Required("width", "body", m.Width); err != nil { - return err + if swag.IsZero(m.Width) { // not required + return nil } if m.Width != nil { - if err := m.Width.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("width") @@ -349,3 +527,271 @@ func (m *Rack) UnmarshalBinary(b []byte) error { *m = res return nil } + +// RackOuterUnit Outer unit +// swagger:model RackOuterUnit +type RackOuterUnit struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rack outer unit +func (m *RackOuterUnit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackOuterUnit) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("outer_unit"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RackOuterUnit) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("outer_unit"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackOuterUnit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackOuterUnit) UnmarshalBinary(b []byte) error { + var res RackOuterUnit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// RackStatus Status +// swagger:model RackStatus +type RackStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rack status +func (m *RackStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RackStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackStatus) UnmarshalBinary(b []byte) error { + var res RackStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// RackType Type +// swagger:model RackType +type RackType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rack type +func (m *RackType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RackType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackType) UnmarshalBinary(b []byte) error { + var res RackType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// RackWidth Width +// swagger:model RackWidth +type RackWidth struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rack width +func (m *RackWidth) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackWidth) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("width"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RackWidth) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("width"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackWidth) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackWidth) UnmarshalBinary(b []byte) error { + var res RackWidth + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rack_group.go b/netbox/models/rack_group.go index fadd59e0d37608c9008bb6d120f3193f893f7116..05a67bb4f23259f4ebfad6ede801c74504b4558d 100644 --- a/netbox/models/rack_group.go +++ b/netbox/models/rack_group.go @@ -38,8 +38,13 @@ type RackGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + // site // Required: true Site *NestedSite `json:"site"` @@ -47,6 +52,7 @@ type RackGroup struct { // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -56,17 +62,14 @@ func (m *RackGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -82,6 +85,10 @@ func (m *RackGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -96,7 +103,6 @@ func (m *RackGroup) validateSite(formats strfmt.Registry) error { } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -114,6 +120,10 @@ func (m *RackGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/rack_reservation.go b/netbox/models/rack_reservation.go index 6b0a1a2ad51e1d52e260f59ed5b3534795fa10f8..618403338a08986ac90fddc454e2d5190fdf94c4 100644 --- a/netbox/models/rack_reservation.go +++ b/netbox/models/rack_reservation.go @@ -35,11 +35,13 @@ type RackReservation struct { // Created // Read Only: true - Created strfmt.DateTime `json:"created,omitempty"` + // Format: date + Created strfmt.Date `json:"created,omitempty"` // Description // Required: true // Max Length: 100 + // Min Length: 1 Description *string `json:"description"` // ID @@ -51,8 +53,7 @@ type RackReservation struct { Rack *NestedRack `json:"rack"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // units // Required: true @@ -67,28 +68,27 @@ type RackReservation struct { func (m *RackReservation) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRack(formats); err != nil { - // prop res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } if err := m.validateUnits(formats); err != nil { - // prop res = append(res, err) } if err := m.validateUser(formats); err != nil { - // prop res = append(res, err) } @@ -98,12 +98,29 @@ func (m *RackReservation) Validate(formats strfmt.Registry) error { return nil } +func (m *RackReservation) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *RackReservation) validateDescription(formats strfmt.Registry) error { if err := validate.Required("description", "body", m.Description); err != nil { return err } + if err := validate.MinLength("description", "body", string(*m.Description), 1); err != nil { + return err + } + if err := validate.MaxLength("description", "body", string(*m.Description), 100); err != nil { return err } @@ -118,7 +135,6 @@ func (m *RackReservation) validateRack(formats strfmt.Registry) error { } if m.Rack != nil { - if err := m.Rack.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("rack") @@ -132,12 +148,11 @@ func (m *RackReservation) validateRack(formats strfmt.Registry) error { func (m *RackReservation) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -156,7 +171,6 @@ func (m *RackReservation) validateUnits(formats strfmt.Registry) error { } for i := 0; i < len(m.Units); i++ { - if swag.IsZero(m.Units[i]) { // not required continue } @@ -181,7 +195,6 @@ func (m *RackReservation) validateUser(formats strfmt.Registry) error { } if m.User != nil { - if err := m.User.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("user") diff --git a/netbox/models/rack_role.go b/netbox/models/rack_role.go index b0f6787fe20e04c17313468be77ebb47ea1f049b..7f4c78366c771f2eeb4a74bc2d4c29ae64082f35 100644 --- a/netbox/models/rack_role.go +++ b/netbox/models/rack_role.go @@ -34,6 +34,7 @@ type RackRole struct { // Color // Required: true // Max Length: 6 + // Min Length: 1 // Pattern: ^[0-9a-f]{6}$ Color *string `json:"color"` @@ -44,11 +45,17 @@ type RackRole struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -58,17 +65,14 @@ func (m *RackRole) Validate(formats strfmt.Registry) error { var res []error if err := m.validateColor(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -84,6 +88,10 @@ func (m *RackRole) validateColor(formats strfmt.Registry) error { return err } + if err := validate.MinLength("color", "body", string(*m.Color), 1); err != nil { + return err + } + if err := validate.MaxLength("color", "body", string(*m.Color), 6); err != nil { return err } @@ -101,6 +109,10 @@ func (m *RackRole) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -114,6 +126,10 @@ func (m *RackRole) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/rack_type.go b/netbox/models/rack_type.go deleted file mode 100644 index 68259b5204438cfb6d07fc74ab277c8cf50b812c..0000000000000000000000000000000000000000 --- a/netbox/models/rack_type.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RackType Type -// swagger:model rackType -type RackType struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this rack type -func (m *RackType) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RackType) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *RackType) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RackType) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RackType) UnmarshalBinary(b []byte) error { - var res RackType - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/rack_width.go b/netbox/models/rack_width.go deleted file mode 100644 index 9ccf06e4a9c21ec960f9e5537d1d700030320601..0000000000000000000000000000000000000000 --- a/netbox/models/rack_width.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RackWidth Width -// swagger:model rackWidth -type RackWidth struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this rack width -func (m *RackWidth) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RackWidth) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *RackWidth) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RackWidth) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RackWidth) UnmarshalBinary(b []byte) error { - var res RackWidth - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/rear_port.go b/netbox/models/rear_port.go new file mode 100644 index 0000000000000000000000000000000000000000..889b26cbf8268cbcbb03ccc2844fde280935f582 --- /dev/null +++ b/netbox/models/rear_port.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RearPort rear port +// swagger:model RearPort +type RearPort struct { + + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // Positions + // Maximum: 64 + // Minimum: 1 + Positions int64 `json:"positions,omitempty"` + + // tags + Tags []string `json:"tags"` + + // type + // Required: true + Type *RearPortType `json:"type"` +} + +// Validate validates this rear port +func (m *RearPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePositions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RearPort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +func (m *RearPort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *RearPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *RearPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *RearPort) validatePositions(formats strfmt.Registry) error { + + if swag.IsZero(m.Positions) { // not required + return nil + } + + if err := validate.MinimumInt("positions", "body", int64(m.Positions), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("positions", "body", int64(m.Positions), 64, false); err != nil { + return err + } + + return nil +} + +func (m *RearPort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +func (m *RearPort) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RearPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RearPort) UnmarshalBinary(b []byte) error { + var res RearPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// RearPortType Type +// swagger:model RearPortType +type RearPortType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rear port type +func (m *RearPortType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RearPortType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RearPortType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RearPortType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RearPortType) UnmarshalBinary(b []byte) error { + var res RearPortType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rear_port_template.go b/netbox/models/rear_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..5f90a08d6a39e8c81c3e26753c0df621cdba6c09 --- /dev/null +++ b/netbox/models/rear_port_template.go @@ -0,0 +1,237 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RearPortTemplate rear port template +// swagger:model RearPortTemplate +type RearPortTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // Positions + // Maximum: 64 + // Minimum: 1 + Positions int64 `json:"positions,omitempty"` + + // type + // Required: true + Type *RearPortTemplateType `json:"type"` +} + +// Validate validates this rear port template +func (m *RearPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePositions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RearPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *RearPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *RearPortTemplate) validatePositions(formats strfmt.Registry) error { + + if swag.IsZero(m.Positions) { // not required + return nil + } + + if err := validate.MinimumInt("positions", "body", int64(m.Positions), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("positions", "body", int64(m.Positions), 64, false); err != nil { + return err + } + + return nil +} + +func (m *RearPortTemplate) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RearPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RearPortTemplate) UnmarshalBinary(b []byte) error { + var res RearPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// RearPortTemplateType Type +// swagger:model RearPortTemplateType +type RearPortTemplateType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rear port template type +func (m *RearPortTemplateType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RearPortTemplateType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RearPortTemplateType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RearPortTemplateType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RearPortTemplateType) UnmarshalBinary(b []byte) error { + var res RearPortTemplateType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/region.go b/netbox/models/region.go index 08d951d3bf48cd570c082c8738bb1012edd7bd3c..18ac7c84b89b338dc4f8e186da7d1df53fb43b08 100644 --- a/netbox/models/region.go +++ b/netbox/models/region.go @@ -38,15 +38,20 @@ type Region struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // parent - // Required: true - Parent *NestedRegion `json:"parent"` + Parent *NestedRegion `json:"parent,omitempty"` + + // Site count + // Read Only: true + SiteCount int64 `json:"site_count,omitempty"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -56,17 +61,14 @@ func (m *Region) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateParent(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -82,6 +84,10 @@ func (m *Region) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -91,12 +97,11 @@ func (m *Region) validateName(formats strfmt.Registry) error { func (m *Region) validateParent(formats strfmt.Registry) error { - if err := validate.Required("parent", "body", m.Parent); err != nil { - return err + if swag.IsZero(m.Parent) { // not required + return nil } if m.Parent != nil { - if err := m.Parent.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("parent") @@ -114,6 +119,10 @@ func (m *Region) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/role.go b/netbox/models/role.go index dfc3fe8a061faf2d0a6731230887df72423f9d72..e787f26aa63e9fcd1fa9c6ec0244e272879c086f 100644 --- a/netbox/models/role.go +++ b/netbox/models/role.go @@ -38,14 +38,24 @@ type Role struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` + // Weight // Maximum: 32767 // Minimum: 0 @@ -57,17 +67,14 @@ func (m *Role) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } if err := m.validateWeight(formats); err != nil { - // prop res = append(res, err) } @@ -83,6 +90,10 @@ func (m *Role) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -96,6 +107,10 @@ func (m *Role) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/secret.go b/netbox/models/secret.go index 28320bfde4e8ff176a2cfa29e2edd16b3e8cc059..0c7017bd514b8bb882cfa23734d737ee423defc0 100644 --- a/netbox/models/secret.go +++ b/netbox/models/secret.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,14 +35,19 @@ type Secret struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + // device // Required: true Device *NestedDevice `json:"device"` // Hash // Read Only: true + // Min Length: 1 Hash string `json:"hash,omitempty"` // ID @@ -49,38 +56,59 @@ type Secret struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name - // Required: true // Max Length: 100 - Name *string `json:"name"` + Name string `json:"name,omitempty"` // Plaintext - // Read Only: true - Plaintext string `json:"plaintext,omitempty"` + // Required: true + // Min Length: 1 + Plaintext *string `json:"plaintext"` // role // Required: true Role *NestedSecretRole `json:"role"` + + // tags + Tags []string `json:"tags"` } // Validate validates this secret func (m *Secret) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validatePlaintext(formats); err != nil { res = append(res, err) } if err := m.validateRole(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -90,6 +118,19 @@ func (m *Secret) Validate(formats strfmt.Registry) error { return nil } +func (m *Secret) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Secret) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -97,7 +138,6 @@ func (m *Secret) validateDevice(formats strfmt.Registry) error { } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -109,13 +149,52 @@ func (m *Secret) validateDevice(formats strfmt.Registry) error { return nil } +func (m *Secret) validateHash(formats strfmt.Registry) error { + + if swag.IsZero(m.Hash) { // not required + return nil + } + + if err := validate.MinLength("hash", "body", string(m.Hash), 1); err != nil { + return err + } + + return nil +} + +func (m *Secret) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Secret) validateName(formats strfmt.Registry) error { - if err := validate.Required("name", "body", m.Name); err != nil { + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 100); err != nil { return err } - if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return nil +} + +func (m *Secret) validatePlaintext(formats strfmt.Registry) error { + + if err := validate.Required("plaintext", "body", m.Plaintext); err != nil { + return err + } + + if err := validate.MinLength("plaintext", "body", string(*m.Plaintext), 1); err != nil { return err } @@ -129,7 +208,6 @@ func (m *Secret) validateRole(formats strfmt.Registry) error { } if m.Role != nil { - if err := m.Role.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("role") @@ -141,6 +219,23 @@ func (m *Secret) validateRole(formats strfmt.Registry) error { return nil } +func (m *Secret) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Secret) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/secret_role.go b/netbox/models/secret_role.go index cf06bd397cb26ae8b88ede2ffb8d315b3a167443..fd3bb964850ac0a539d167fa3c7b52d8a0fa4066 100644 --- a/netbox/models/secret_role.go +++ b/netbox/models/secret_role.go @@ -38,11 +38,17 @@ type SecretRole struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Secret count + // Read Only: true + SecretCount int64 `json:"secret_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -52,12 +58,10 @@ func (m *SecretRole) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -73,6 +77,10 @@ func (m *SecretRole) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -86,6 +94,10 @@ func (m *SecretRole) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/secrets_secret_roles_list_okbody.go b/netbox/models/secrets_secret_roles_list_okbody.go deleted file mode 100644 index 5ffee8bcc3347779ad741133d951cf57b62ac99b..0000000000000000000000000000000000000000 --- a/netbox/models/secrets_secret_roles_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SecretsSecretRolesListOKBody secrets secret roles list o k body -// swagger:model secretsSecretRolesListOKBody -type SecretsSecretRolesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results SecretsSecretRolesListOKBodyResults `json:"results"` -} - -// Validate validates this secrets secret roles list o k body -func (m *SecretsSecretRolesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SecretsSecretRolesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *SecretsSecretRolesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SecretsSecretRolesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SecretsSecretRolesListOKBody) UnmarshalBinary(b []byte) error { - var res SecretsSecretRolesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/secrets_secret_roles_list_okbody_results.go b/netbox/models/secrets_secret_roles_list_okbody_results.go deleted file mode 100644 index fcab8a5a07917f1e822e8743a113fbb61f47d072..0000000000000000000000000000000000000000 --- a/netbox/models/secrets_secret_roles_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// SecretsSecretRolesListOKBodyResults secrets secret roles list o k body results -// swagger:model secretsSecretRolesListOKBodyResults -type SecretsSecretRolesListOKBodyResults []*SecretRole - -// Validate validates this secrets secret roles list o k body results -func (m SecretsSecretRolesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/secrets_secrets_list_okbody.go b/netbox/models/secrets_secrets_list_okbody.go deleted file mode 100644 index 582eae50a326a5cd57a27cc23d1c1341d8c13f9d..0000000000000000000000000000000000000000 --- a/netbox/models/secrets_secrets_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SecretsSecretsListOKBody secrets secrets list o k body -// swagger:model secretsSecretsListOKBody -type SecretsSecretsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results SecretsSecretsListOKBodyResults `json:"results"` -} - -// Validate validates this secrets secrets list o k body -func (m *SecretsSecretsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SecretsSecretsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *SecretsSecretsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SecretsSecretsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SecretsSecretsListOKBody) UnmarshalBinary(b []byte) error { - var res SecretsSecretsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/secrets_secrets_list_okbody_results.go b/netbox/models/secrets_secrets_list_okbody_results.go deleted file mode 100644 index 5e61fe989aa77025da324971d1cfd297121467f4..0000000000000000000000000000000000000000 --- a/netbox/models/secrets_secrets_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// SecretsSecretsListOKBodyResults secrets secrets list o k body results -// swagger:model secretsSecretsListOKBodyResults -type SecretsSecretsListOKBodyResults []*Secret - -// Validate validates this secrets secrets list o k body results -func (m SecretsSecretsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/service.go b/netbox/models/service.go index 2a3ef9973f678ecee0455fe266882d3484cf51c4..fb39e499373412530abfae74b4bce2eced6668fb 100644 --- a/netbox/models/service.go +++ b/netbox/models/service.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,31 +35,36 @@ type Service struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + // Description // Max Length: 100 Description string `json:"description,omitempty"` // device - // Required: true - Device *NestedDevice `json:"device"` + Device *NestedDevice `json:"device,omitempty"` // ID // Read Only: true ID int64 `json:"id,omitempty"` // ipaddresses - // Required: true - Ipaddresses ServiceIpaddresses `json:"ipaddresses"` + // Unique: true + Ipaddresses []*NestedIPAddress `json:"ipaddresses"` // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 30 + // Min Length: 1 Name *string `json:"name"` // Port number @@ -71,46 +78,46 @@ type Service struct { Protocol *ServiceProtocol `json:"protocol"` // virtual machine - // Required: true - VirtualMachine *NestedVirtualMachine `json:"virtual_machine"` + VirtualMachine *NestedVirtualMachine `json:"virtual_machine,omitempty"` } // Validate validates this service func (m *Service) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateIpaddresses(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePort(formats); err != nil { - // prop res = append(res, err) } if err := m.validateProtocol(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVirtualMachine(formats); err != nil { - // prop res = append(res, err) } @@ -120,6 +127,19 @@ func (m *Service) Validate(formats strfmt.Registry) error { return nil } +func (m *Service) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Service) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -135,12 +155,11 @@ func (m *Service) validateDescription(formats strfmt.Registry) error { func (m *Service) validateDevice(formats strfmt.Registry) error { - if err := validate.Required("device", "body", m.Device); err != nil { - return err + if swag.IsZero(m.Device) { // not required + return nil } if m.Device != nil { - if err := m.Device.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("device") @@ -154,14 +173,40 @@ func (m *Service) validateDevice(formats strfmt.Registry) error { func (m *Service) validateIpaddresses(formats strfmt.Registry) error { - if err := validate.Required("ipaddresses", "body", m.Ipaddresses); err != nil { + if swag.IsZero(m.Ipaddresses) { // not required + return nil + } + + if err := validate.UniqueItems("ipaddresses", "body", m.Ipaddresses); err != nil { return err } - if err := m.Ipaddresses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ipaddresses") + for i := 0; i < len(m.Ipaddresses); i++ { + if swag.IsZero(m.Ipaddresses[i]) { // not required + continue + } + + if m.Ipaddresses[i] != nil { + if err := m.Ipaddresses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipaddresses" + "." + strconv.Itoa(i)) + } + return err + } } + + } + + return nil +} + +func (m *Service) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { return err } @@ -174,6 +219,10 @@ func (m *Service) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { return err } @@ -205,7 +254,6 @@ func (m *Service) validateProtocol(formats strfmt.Registry) error { } if m.Protocol != nil { - if err := m.Protocol.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("protocol") @@ -219,12 +267,11 @@ func (m *Service) validateProtocol(formats strfmt.Registry) error { func (m *Service) validateVirtualMachine(formats strfmt.Registry) error { - if err := validate.Required("virtual_machine", "body", m.VirtualMachine); err != nil { - return err + if swag.IsZero(m.VirtualMachine) { // not required + return nil } if m.VirtualMachine != nil { - if err := m.VirtualMachine.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("virtual_machine") @@ -253,3 +300,70 @@ func (m *Service) UnmarshalBinary(b []byte) error { *m = res return nil } + +// ServiceProtocol Protocol +// swagger:model ServiceProtocol +type ServiceProtocol struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this service protocol +func (m *ServiceProtocol) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceProtocol) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("protocol"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *ServiceProtocol) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("protocol"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceProtocol) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceProtocol) UnmarshalBinary(b []byte) error { + var res ServiceProtocol + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/service_ipaddresses.go b/netbox/models/service_ipaddresses.go deleted file mode 100644 index 8cf99e7e5b483772d6ef60f004efd2d12dc86dea..0000000000000000000000000000000000000000 --- a/netbox/models/service_ipaddresses.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// ServiceIpaddresses service ipaddresses -// swagger:model serviceIpaddresses -type ServiceIpaddresses []*NestedIPAddress - -// Validate validates this service ipaddresses -func (m ServiceIpaddresses) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/service_protocol.go b/netbox/models/service_protocol.go deleted file mode 100644 index 6701ce6c49f8783ab969517d15d4e2374e377855..0000000000000000000000000000000000000000 --- a/netbox/models/service_protocol.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceProtocol Protocol -// swagger:model serviceProtocol -type ServiceProtocol struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this service protocol -func (m *ServiceProtocol) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceProtocol) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *ServiceProtocol) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceProtocol) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceProtocol) UnmarshalBinary(b []byte) error { - var res ServiceProtocol - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/site.go b/netbox/models/site.go index 6d4c0ce1c9c975072a1f02f6af74fb87d4c81c62..26716c2b5563b3c10c43077906d79b3a48c85177 100644 --- a/netbox/models/site.go +++ b/netbox/models/site.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -34,13 +36,18 @@ type Site struct { // ASN // Maximum: 4.294967295e+09 // Minimum: 1 - Asn int64 `json:"asn,omitempty"` + Asn *int64 `json:"asn,omitempty"` + + // Circuit count + // Read Only: true + CircuitCount int64 `json:"circuit_count,omitempty"` // Comments Comments string `json:"comments,omitempty"` // Contact E-mail // Max Length: 254 + // Format: email ContactEmail strfmt.Email `json:"contact_email,omitempty"` // Contact name @@ -51,28 +58,9 @@ type Site struct { // Max Length: 20 ContactPhone string `json:"contact_phone,omitempty"` - // Count circuits - // Read Only: true - CountCircuits string `json:"count_circuits,omitempty"` - - // Count devices - // Read Only: true - CountDevices string `json:"count_devices,omitempty"` - - // Count prefixes - // Read Only: true - CountPrefixes string `json:"count_prefixes,omitempty"` - - // Count racks - // Read Only: true - CountRacks string `json:"count_racks,omitempty"` - - // Count vlans - // Read Only: true - CountVlans string `json:"count_vlans,omitempty"` - // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -82,6 +70,10 @@ type Site struct { // Max Length: 100 Description string `json:"description,omitempty"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // Facility // Max Length: 50 Facility string `json:"facility,omitempty"` @@ -92,20 +84,35 @@ type Site struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Latitude + Latitude *string `json:"latitude,omitempty"` + + // Longitude + Longitude *string `json:"longitude,omitempty"` + // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Physical address // Max Length: 200 PhysicalAddress string `json:"physical_address,omitempty"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + // region - // Required: true - Region *NestedRegion `json:"region"` + Region *NestedRegion `json:"region,omitempty"` // Shipping address // Max Length: 200 @@ -114,19 +121,29 @@ type Site struct { // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // status - // Required: true - Status *SiteStatus `json:"status"` + Status *SiteStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // Time zone TimeZone string `json:"time_zone,omitempty"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` + + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` } // Validate validates this site @@ -134,67 +151,66 @@ func (m *Site) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAsn(formats); err != nil { - // prop res = append(res, err) } if err := m.validateContactEmail(formats); err != nil { - // prop res = append(res, err) } if err := m.validateContactName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateContactPhone(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateFacility(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePhysicalAddress(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRegion(formats); err != nil { - // prop res = append(res, err) } if err := m.validateShippingAddress(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } @@ -210,11 +226,11 @@ func (m *Site) validateAsn(formats strfmt.Registry) error { return nil } - if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + if err := validate.MinimumInt("asn", "body", int64(*m.Asn), 1, false); err != nil { return err } - if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + if err := validate.MaximumInt("asn", "body", int64(*m.Asn), 4.294967295e+09, false); err != nil { return err } @@ -264,6 +280,19 @@ func (m *Site) validateContactPhone(formats strfmt.Registry) error { return nil } +func (m *Site) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Site) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -290,12 +319,29 @@ func (m *Site) validateFacility(formats strfmt.Registry) error { return nil } +func (m *Site) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Site) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -318,12 +364,11 @@ func (m *Site) validatePhysicalAddress(formats strfmt.Registry) error { func (m *Site) validateRegion(formats strfmt.Registry) error { - if err := validate.Required("region", "body", m.Region); err != nil { - return err + if swag.IsZero(m.Region) { // not required + return nil } if m.Region != nil { - if err := m.Region.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("region") @@ -354,6 +399,10 @@ func (m *Site) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -367,12 +416,11 @@ func (m *Site) validateSlug(formats strfmt.Registry) error { func (m *Site) validateStatus(formats strfmt.Registry) error { - if err := validate.Required("status", "body", m.Status); err != nil { - return err + if swag.IsZero(m.Status) { // not required + return nil } if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") @@ -384,14 +432,30 @@ func (m *Site) validateStatus(formats strfmt.Registry) error { return nil } +func (m *Site) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *Site) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -420,3 +484,70 @@ func (m *Site) UnmarshalBinary(b []byte) error { *m = res return nil } + +// SiteStatus Status +// swagger:model SiteStatus +type SiteStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this site status +func (m *SiteStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SiteStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *SiteStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SiteStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SiteStatus) UnmarshalBinary(b []byte) error { + var res SiteStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/site_status.go b/netbox/models/site_status.go deleted file mode 100644 index 1280836180ebe2104d49e5c6ed34728ebebc4d84..0000000000000000000000000000000000000000 --- a/netbox/models/site_status.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SiteStatus Status -// swagger:model siteStatus -type SiteStatus struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this site status -func (m *SiteStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SiteStatus) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *SiteStatus) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SiteStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SiteStatus) UnmarshalBinary(b []byte) error { - var res SiteStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/tag.go b/netbox/models/tag.go new file mode 100644 index 0000000000000000000000000000000000000000..4e0dcf117e93b94a666eabc66b69a3fc3323e61d --- /dev/null +++ b/netbox/models/tag.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Tag tag +// swagger:model Tag +type Tag struct { + + // Color + // Max Length: 6 + // Min Length: 1 + // Pattern: ^[0-9a-f]{6}$ + Color string `json:"color,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 100 + // Min Length: 1 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Tagged items + // Read Only: true + TaggedItems int64 `json:"tagged_items,omitempty"` +} + +// Validate validates this tag +func (m *Tag) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Tag) validateColor(formats strfmt.Registry) error { + + if swag.IsZero(m.Color) { // not required + return nil + } + + if err := validate.MinLength("color", "body", string(m.Color), 1); err != nil { + return err + } + + if err := validate.MaxLength("color", "body", string(m.Color), 6); err != nil { + return err + } + + if err := validate.Pattern("color", "body", string(m.Color), `^[0-9a-f]{6}$`); err != nil { + return err + } + + return nil +} + +func (m *Tag) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *Tag) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 100); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Tag) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Tag) UnmarshalBinary(b []byte) error { + var res Tag + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/tenancy_tenant_groups_list_okbody.go b/netbox/models/tenancy_tenant_groups_list_okbody.go deleted file mode 100644 index 7409990fecc6462c70230587225d2c2a50bf2ce5..0000000000000000000000000000000000000000 --- a/netbox/models/tenancy_tenant_groups_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TenancyTenantGroupsListOKBody tenancy tenant groups list o k body -// swagger:model tenancyTenantGroupsListOKBody -type TenancyTenantGroupsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results TenancyTenantGroupsListOKBodyResults `json:"results"` -} - -// Validate validates this tenancy tenant groups list o k body -func (m *TenancyTenantGroupsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TenancyTenantGroupsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *TenancyTenantGroupsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TenancyTenantGroupsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TenancyTenantGroupsListOKBody) UnmarshalBinary(b []byte) error { - var res TenancyTenantGroupsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/tenancy_tenant_groups_list_okbody_results.go b/netbox/models/tenancy_tenant_groups_list_okbody_results.go deleted file mode 100644 index 02f25a79e0a9b36c1789313aed807d9610dbe488..0000000000000000000000000000000000000000 --- a/netbox/models/tenancy_tenant_groups_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TenancyTenantGroupsListOKBodyResults tenancy tenant groups list o k body results -// swagger:model tenancyTenantGroupsListOKBodyResults -type TenancyTenantGroupsListOKBodyResults []*TenantGroup - -// Validate validates this tenancy tenant groups list o k body results -func (m TenancyTenantGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/tenancy_tenants_list_okbody.go b/netbox/models/tenancy_tenants_list_okbody.go deleted file mode 100644 index 664ae51a541fced12020e8349e0c2aeb7b8a9e11..0000000000000000000000000000000000000000 --- a/netbox/models/tenancy_tenants_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TenancyTenantsListOKBody tenancy tenants list o k body -// swagger:model tenancyTenantsListOKBody -type TenancyTenantsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results TenancyTenantsListOKBodyResults `json:"results"` -} - -// Validate validates this tenancy tenants list o k body -func (m *TenancyTenantsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TenancyTenantsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *TenancyTenantsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TenancyTenantsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TenancyTenantsListOKBody) UnmarshalBinary(b []byte) error { - var res TenancyTenantsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/tenancy_tenants_list_okbody_results.go b/netbox/models/tenancy_tenants_list_okbody_results.go deleted file mode 100644 index 6573450e7a4c8a10c53a0fb039149fe965ee572e..0000000000000000000000000000000000000000 --- a/netbox/models/tenancy_tenants_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// TenancyTenantsListOKBodyResults tenancy tenants list o k body results -// swagger:model tenancyTenantsListOKBodyResults -type TenancyTenantsListOKBodyResults []*Tenant - -// Validate validates this tenancy tenants list o k body results -func (m TenancyTenantsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/tenant.go b/netbox/models/tenant.go index e3a4446d790c7875f5ce36416a1432f61227cdc9..77ce0be3f149244585311f9f022666b7e24ab104 100644 --- a/netbox/models/tenant.go +++ b/netbox/models/tenant.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -31,11 +33,16 @@ import ( // swagger:model Tenant type Tenant struct { + // Circuit count + // Read Only: true + CircuitCount int64 `json:"circuit_count,omitempty"` + // Comments Comments string `json:"comments,omitempty"` // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -47,51 +54,96 @@ type Tenant struct { // Max Length: 100 Description string `json:"description,omitempty"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // group - // Required: true - Group *NestedTenantGroup `json:"group"` + Group *NestedTenantGroup `json:"group,omitempty"` // ID // Read Only: true ID int64 `json:"id,omitempty"` + // Ipaddress count + // Read Only: true + IpaddressCount int64 `json:"ipaddress_count,omitempty"` + // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 30 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + + // Site count + // Read Only: true + SiteCount int64 `json:"site_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + + // tags + Tags []string `json:"tags"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` + + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` + + // Vrf count + // Read Only: true + VrfCount int64 `json:"vrf_count,omitempty"` } // Validate validates this tenant func (m *Tenant) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateGroup(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -101,6 +153,19 @@ func (m *Tenant) Validate(formats strfmt.Registry) error { return nil } +func (m *Tenant) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Tenant) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -116,12 +181,11 @@ func (m *Tenant) validateDescription(formats strfmt.Registry) error { func (m *Tenant) validateGroup(formats strfmt.Registry) error { - if err := validate.Required("group", "body", m.Group); err != nil { - return err + if swag.IsZero(m.Group) { // not required + return nil } if m.Group != nil { - if err := m.Group.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("group") @@ -133,12 +197,29 @@ func (m *Tenant) validateGroup(formats strfmt.Registry) error { return nil } +func (m *Tenant) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Tenant) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { return err } @@ -152,6 +233,10 @@ func (m *Tenant) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -163,6 +248,23 @@ func (m *Tenant) validateSlug(formats strfmt.Registry) error { return nil } +func (m *Tenant) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *Tenant) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/tenant_group.go b/netbox/models/tenant_group.go index 4ca8b30a96bb49e6623d55e71bb25bdbe5dd95fb..2f4141da1dd4c457c49077a5396b5030b78071a5 100644 --- a/netbox/models/tenant_group.go +++ b/netbox/models/tenant_group.go @@ -38,13 +38,19 @@ type TenantGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + + // Tenant count + // Read Only: true + TenantCount int64 `json:"tenant_count,omitempty"` } // Validate validates this tenant group @@ -52,12 +58,10 @@ func (m *TenantGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -73,6 +77,10 @@ func (m *TenantGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -86,6 +94,10 @@ func (m *TenantGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/topology_map.go b/netbox/models/topology_map.go index e338136329e603722b1a1225ab3785154377c377..92dd9e49ce0dde431941c9d6e65e96ef345c8e43 100644 --- a/netbox/models/topology_map.go +++ b/netbox/models/topology_map.go @@ -39,6 +39,7 @@ type TopologyMap struct { // // Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined. // Required: true + // Min Length: 1 DevicePatterns *string `json:"device_patterns"` // ID @@ -48,6 +49,7 @@ type TopologyMap struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // site @@ -57,6 +59,7 @@ type TopologyMap struct { // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -66,27 +69,22 @@ func (m *TopologyMap) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDevicePatterns(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -115,6 +113,10 @@ func (m *TopologyMap) validateDevicePatterns(formats strfmt.Registry) error { return err } + if err := validate.MinLength("device_patterns", "body", string(*m.DevicePatterns), 1); err != nil { + return err + } + return nil } @@ -124,6 +126,10 @@ func (m *TopologyMap) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -138,7 +144,6 @@ func (m *TopologyMap) validateSite(formats strfmt.Registry) error { } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -156,6 +161,10 @@ func (m *TopologyMap) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/user_action.go b/netbox/models/user_action.go deleted file mode 100644 index 882b01269063678cc8771a5dd667065409d7ca77..0000000000000000000000000000000000000000 --- a/netbox/models/user_action.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UserAction user action -// swagger:model UserAction -type UserAction struct { - - // action - // Required: true - Action *UserActionAction `json:"action"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Message - Message string `json:"message,omitempty"` - - // Time - // Read Only: true - Time strfmt.DateTime `json:"time,omitempty"` - - // user - // Required: true - User *NestedUser `json:"user"` -} - -// Validate validates this user action -func (m *UserAction) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAction(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateUser(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UserAction) validateAction(formats strfmt.Registry) error { - - if err := validate.Required("action", "body", m.Action); err != nil { - return err - } - - if m.Action != nil { - - if err := m.Action.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("action") - } - return err - } - } - - return nil -} - -func (m *UserAction) validateUser(formats strfmt.Registry) error { - - if err := validate.Required("user", "body", m.User); err != nil { - return err - } - - if m.User != nil { - - if err := m.User.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("user") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UserAction) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UserAction) UnmarshalBinary(b []byte) error { - var res UserAction - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/user_action_action.go b/netbox/models/user_action_action.go deleted file mode 100644 index 8679750715e15493c426dfc6f54286805e6b4f67..0000000000000000000000000000000000000000 --- a/netbox/models/user_action_action.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UserActionAction Action -// swagger:model userActionAction -type UserActionAction struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this user action action -func (m *UserActionAction) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UserActionAction) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *UserActionAction) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UserActionAction) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UserActionAction) UnmarshalBinary(b []byte) error { - var res UserActionAction - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/vlan.go b/netbox/models/v_l_a_n.go similarity index 62% rename from netbox/models/vlan.go rename to netbox/models/v_l_a_n.go index b12091a000b75d1af5f5384f49613d42a96772b5..ac9500a7fe55d7873a8695486f389fa5300a34fb 100644 --- a/netbox/models/vlan.go +++ b/netbox/models/v_l_a_n.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,6 +35,7 @@ type VLAN struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -47,8 +50,7 @@ type VLAN struct { DisplayName string `json:"display_name,omitempty"` // group - // Required: true - Group *NestedVLANGroup `json:"group"` + Group *NestedVLANGroup `json:"group,omitempty"` // ID // Read Only: true @@ -56,28 +58,33 @@ type VLAN struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + // role - // Required: true - Role *NestedRole `json:"role"` + Role *NestedRole `json:"role,omitempty"` // site - // Required: true - Site *NestedSite `json:"site"` + Site *NestedSite `json:"site,omitempty"` // status - // Required: true - Status *VLANStatus `json:"status"` + Status *VLANStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // ID // Required: true @@ -90,43 +97,47 @@ type VLAN struct { func (m *VLAN) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateGroup(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRole(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVid(formats); err != nil { - // prop res = append(res, err) } @@ -136,6 +147,19 @@ func (m *VLAN) Validate(formats strfmt.Registry) error { return nil } +func (m *VLAN) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *VLAN) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -151,12 +175,11 @@ func (m *VLAN) validateDescription(formats strfmt.Registry) error { func (m *VLAN) validateGroup(formats strfmt.Registry) error { - if err := validate.Required("group", "body", m.Group); err != nil { - return err + if swag.IsZero(m.Group) { // not required + return nil } if m.Group != nil { - if err := m.Group.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("group") @@ -168,12 +191,29 @@ func (m *VLAN) validateGroup(formats strfmt.Registry) error { return nil } +func (m *VLAN) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *VLAN) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -183,12 +223,11 @@ func (m *VLAN) validateName(formats strfmt.Registry) error { func (m *VLAN) validateRole(formats strfmt.Registry) error { - if err := validate.Required("role", "body", m.Role); err != nil { - return err + if swag.IsZero(m.Role) { // not required + return nil } if m.Role != nil { - if err := m.Role.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("role") @@ -202,12 +241,11 @@ func (m *VLAN) validateRole(formats strfmt.Registry) error { func (m *VLAN) validateSite(formats strfmt.Registry) error { - if err := validate.Required("site", "body", m.Site); err != nil { - return err + if swag.IsZero(m.Site) { // not required + return nil } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -221,12 +259,11 @@ func (m *VLAN) validateSite(formats strfmt.Registry) error { func (m *VLAN) validateStatus(formats strfmt.Registry) error { - if err := validate.Required("status", "body", m.Status); err != nil { - return err + if swag.IsZero(m.Status) { // not required + return nil } if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") @@ -238,14 +275,30 @@ func (m *VLAN) validateStatus(formats strfmt.Registry) error { return nil } +func (m *VLAN) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *VLAN) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -291,3 +344,70 @@ func (m *VLAN) UnmarshalBinary(b []byte) error { *m = res return nil } + +// VLANStatus Status +// swagger:model VLANStatus +type VLANStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this v l a n status +func (m *VLANStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VLANStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *VLANStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VLANStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLANStatus) UnmarshalBinary(b []byte) error { + var res VLANStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/vlangroup.go b/netbox/models/v_l_a_n_group.go similarity index 88% rename from netbox/models/vlangroup.go rename to netbox/models/v_l_a_n_group.go index 8014aaf326dc64cff626bad142379a1f2d44ec95..210d3a391c8fbec0f26ef69ca1b8c19b1a4c7338 100644 --- a/netbox/models/vlangroup.go +++ b/netbox/models/v_l_a_n_group.go @@ -38,17 +38,22 @@ type VLANGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // site - // Required: true - Site *NestedSite `json:"site"` + Site *NestedSite `json:"site,omitempty"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` } // Validate validates this v l a n group @@ -56,17 +61,14 @@ func (m *VLANGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -82,6 +84,10 @@ func (m *VLANGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -91,12 +97,11 @@ func (m *VLANGroup) validateName(formats strfmt.Registry) error { func (m *VLANGroup) validateSite(formats strfmt.Registry) error { - if err := validate.Required("site", "body", m.Site); err != nil { - return err + if swag.IsZero(m.Site) { // not required + return nil } if m.Site != nil { - if err := m.Site.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("site") @@ -114,6 +119,10 @@ func (m *VLANGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/vrf.go b/netbox/models/v_r_f.go similarity index 68% rename from netbox/models/vrf.go rename to netbox/models/v_r_f.go index d172ea05048dfa5d6bcc6836617c5c7aa1b784f6..1968698677b94e610fc7eec5b71e2aed6505c1f8 100644 --- a/netbox/models/vrf.go +++ b/netbox/models/v_r_f.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,6 +35,7 @@ type VRF struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -55,46 +58,65 @@ type VRF struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Ipaddress count + // Read Only: true + IpaddressCount int64 `json:"ipaddress_count,omitempty"` + // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + // Route distinguisher - // Required: true // Max Length: 21 - Rd *string `json:"rd"` + Rd *string `json:"rd,omitempty"` + + // tags + Tags []string `json:"tags"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` } // Validate validates this v r f func (m *VRF) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRd(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } @@ -104,6 +126,19 @@ func (m *VRF) Validate(formats strfmt.Registry) error { return nil } +func (m *VRF) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *VRF) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -117,12 +152,29 @@ func (m *VRF) validateDescription(formats strfmt.Registry) error { return nil } +func (m *VRF) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *VRF) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -132,8 +184,8 @@ func (m *VRF) validateName(formats strfmt.Registry) error { func (m *VRF) validateRd(formats strfmt.Registry) error { - if err := validate.Required("rd", "body", m.Rd); err != nil { - return err + if swag.IsZero(m.Rd) { // not required + return nil } if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { @@ -143,14 +195,30 @@ func (m *VRF) validateRd(formats strfmt.Registry) error { return nil } +func (m *VRF) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *VRF) validateTenant(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tenant) { // not required + return nil } if m.Tenant != nil { - if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") diff --git a/netbox/models/virtual_chassis.go b/netbox/models/virtual_chassis.go index be46fe99e65088112f36b1d809e44a260832f5a2..765151cd4e31d5a6790f1ce5e88f07017b2c6805 100644 --- a/netbox/models/virtual_chassis.go +++ b/netbox/models/virtual_chassis.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -42,6 +44,13 @@ type VirtualChassis struct { // master // Required: true Master *NestedDevice `json:"master"` + + // Member count + // Read Only: true + MemberCount int64 `json:"member_count,omitempty"` + + // tags + Tags []string `json:"tags"` } // Validate validates this virtual chassis @@ -49,12 +58,14 @@ func (m *VirtualChassis) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDomain(formats); err != nil { - // prop res = append(res, err) } if err := m.validateMaster(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -84,7 +95,6 @@ func (m *VirtualChassis) validateMaster(formats strfmt.Registry) error { } if m.Master != nil { - if err := m.Master.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("master") @@ -96,6 +106,23 @@ func (m *VirtualChassis) validateMaster(formats strfmt.Registry) error { return nil } +func (m *VirtualChassis) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *VirtualChassis) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/virtual_machine_interface.go b/netbox/models/virtual_machine_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..ef3e827fdbc9d90a6a22d34839903f3db741558c --- /dev/null +++ b/netbox/models/virtual_machine_interface.go @@ -0,0 +1,457 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VirtualMachineInterface virtual machine interface +// swagger:model VirtualMachineInterface +type VirtualMachineInterface struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // MAC Address + MacAddress *string `json:"mac_address,omitempty"` + + // mode + Mode *VirtualMachineInterfaceMode `json:"mode,omitempty"` + + // MTU + // Maximum: 65536 + // Minimum: 1 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // tagged vlans + // Unique: true + TaggedVlans []*NestedVLAN `json:"tagged_vlans"` + + // tags + Tags []string `json:"tags"` + + // type + Type *VirtualMachineInterfaceType `json:"type,omitempty"` + + // untagged vlan + UntaggedVlan *NestedVLAN `json:"untagged_vlan,omitempty"` + + // virtual machine + // Required: true + VirtualMachine *NestedVirtualMachine `json:"virtual_machine"` +} + +// Validate validates this virtual machine interface +func (m *VirtualMachineInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaggedVlans(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUntaggedVlan(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVirtualMachine(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachineInterface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineInterface) validateMode(formats strfmt.Registry) error { + + if swag.IsZero(m.Mode) { // not required + return nil + } + + if m.Mode != nil { + if err := m.Mode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mode") + } + return err + } + } + + return nil +} + +func (m *VirtualMachineInterface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 65536, false); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineInterface) validateTaggedVlans(formats strfmt.Registry) error { + + if swag.IsZero(m.TaggedVlans) { // not required + return nil + } + + if err := validate.UniqueItems("tagged_vlans", "body", m.TaggedVlans); err != nil { + return err + } + + for i := 0; i < len(m.TaggedVlans); i++ { + if swag.IsZero(m.TaggedVlans[i]) { // not required + continue + } + + if m.TaggedVlans[i] != nil { + if err := m.TaggedVlans[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tagged_vlans" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *VirtualMachineInterface) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +func (m *VirtualMachineInterface) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if m.Type != nil { + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *VirtualMachineInterface) validateUntaggedVlan(formats strfmt.Registry) error { + + if swag.IsZero(m.UntaggedVlan) { // not required + return nil + } + + if m.UntaggedVlan != nil { + if err := m.UntaggedVlan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("untagged_vlan") + } + return err + } + } + + return nil +} + +func (m *VirtualMachineInterface) validateVirtualMachine(formats strfmt.Registry) error { + + if err := validate.Required("virtual_machine", "body", m.VirtualMachine); err != nil { + return err + } + + if m.VirtualMachine != nil { + if err := m.VirtualMachine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_machine") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachineInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachineInterface) UnmarshalBinary(b []byte) error { + var res VirtualMachineInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// VirtualMachineInterfaceMode Mode +// swagger:model VirtualMachineInterfaceMode +type VirtualMachineInterfaceMode struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this virtual machine interface mode +func (m *VirtualMachineInterfaceMode) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachineInterfaceMode) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("mode"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineInterfaceMode) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("mode"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachineInterfaceMode) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachineInterfaceMode) UnmarshalBinary(b []byte) error { + var res VirtualMachineInterfaceMode + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// VirtualMachineInterfaceType Type +// swagger:model VirtualMachineInterfaceType +type VirtualMachineInterfaceType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +func (m *VirtualMachineInterfaceType) UnmarshalJSON(b []byte) error { + type VirtualMachineInterfaceTypeAlias VirtualMachineInterfaceType + var t VirtualMachineInterfaceTypeAlias + if err := json.Unmarshal([]byte("{\"label\":\"Virtual\",\"value\":0}"), &t); err != nil { + return err + } + if err := json.Unmarshal(b, &t); err != nil { + return err + } + *m = VirtualMachineInterfaceType(t) + return nil +} + +// Validate validates this virtual machine interface type +func (m *VirtualMachineInterfaceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachineInterfaceType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineInterfaceType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("type"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachineInterfaceType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachineInterfaceType) UnmarshalBinary(b []byte) error { + var res VirtualMachineInterfaceType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtual_machine_ip_address.go b/netbox/models/virtual_machine_ip_address.go deleted file mode 100644 index 240a8e2f7839b8d76a10d896eb3d08d86f49d621..0000000000000000000000000000000000000000 --- a/netbox/models/virtual_machine_ip_address.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VirtualMachineIPAddress Primary ip -// swagger:model VirtualMachineIPAddress -type VirtualMachineIPAddress struct { - - // Address - // - // IPv4 or IPv6 address (with mask) - // Required: true - Address *string `json:"address"` - - // Family - // Read Only: true - Family int64 `json:"family,omitempty"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Url - // Read Only: true - URL strfmt.URI `json:"url,omitempty"` -} - -// Validate validates this virtual machine IP address -func (m *VirtualMachineIPAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VirtualMachineIPAddress) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualMachineIPAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualMachineIPAddress) UnmarshalBinary(b []byte) error { - var res VirtualMachineIPAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/virtual_machine_status.go b/netbox/models/virtual_machine_status.go deleted file mode 100644 index 462fd4fd88bd6e452253d60352744bb091b5e443..0000000000000000000000000000000000000000 --- a/netbox/models/virtual_machine_status.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VirtualMachineStatus Status -// swagger:model virtualMachineStatus -type VirtualMachineStatus struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this virtual machine status -func (m *VirtualMachineStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VirtualMachineStatus) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *VirtualMachineStatus) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualMachineStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualMachineStatus) UnmarshalBinary(b []byte) error { - var res VirtualMachineStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/virtual_machine.go b/netbox/models/virtual_machine_with_config_context.go similarity index 51% rename from netbox/models/virtual_machine.go rename to netbox/models/virtual_machine_with_config_context.go index b850193add4cbf0c12ee4eb8b7be9618c65c2232..717251b12db1bc0cae02328e67da49f0d429ccc5 100644 --- a/netbox/models/virtual_machine.go +++ b/netbox/models/virtual_machine_with_config_context.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -27,9 +29,9 @@ import ( "github.com/go-openapi/validate" ) -// VirtualMachine virtual machine -// swagger:model VirtualMachine -type VirtualMachine struct { +// VirtualMachineWithConfigContext virtual machine with config context +// swagger:model VirtualMachineWithConfigContext +type VirtualMachineWithConfigContext struct { // cluster // Required: true @@ -38,8 +40,13 @@ type VirtualMachine struct { // Comments Comments string `json:"comments,omitempty"` + // Config context + // Read Only: true + ConfigContext map[string]string `json:"config_context,omitempty"` + // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -56,8 +63,12 @@ type VirtualMachine struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Local context data + LocalContextData *string `json:"local_context_data,omitempty"` + // Memory (MB) // Maximum: 2.147483647e+09 // Minimum: 0 @@ -66,35 +77,35 @@ type VirtualMachine struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` // platform - // Required: true - Platform *NestedPlatform `json:"platform"` + Platform *NestedPlatform `json:"platform,omitempty"` // primary ip - // Required: true - PrimaryIP *VirtualMachineIPAddress `json:"primary_ip"` + PrimaryIP *NestedIPAddress `json:"primary_ip,omitempty"` // primary ip4 - // Required: true - PrimaryIp4 *VirtualMachineIPAddress `json:"primary_ip4"` + PrimaryIp4 *NestedIPAddress `json:"primary_ip4,omitempty"` // primary ip6 - // Required: true - PrimaryIp6 *VirtualMachineIPAddress `json:"primary_ip6"` + PrimaryIp6 *NestedIPAddress `json:"primary_ip6,omitempty"` // role - // Required: true - Role *NestedDeviceRole `json:"role"` + Role *NestedDeviceRole `json:"role,omitempty"` + + // site + Site *NestedSite `json:"site,omitempty"` // status - // Required: true - Status *VirtualMachineStatus `json:"status"` + Status *VirtualMachineWithConfigContextStatus `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` // tenant - // Required: true - Tenant *NestedTenant `json:"tenant"` + Tenant *NestedTenant `json:"tenant,omitempty"` // VCPUs // Maximum: 32767 @@ -102,67 +113,71 @@ type VirtualMachine struct { Vcpus *int64 `json:"vcpus,omitempty"` } -// Validate validates this virtual machine -func (m *VirtualMachine) Validate(formats strfmt.Registry) error { +// Validate validates this virtual machine with config context +func (m *VirtualMachineWithConfigContext) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCluster(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDisk(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateMemory(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePlatform(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePrimaryIP(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePrimaryIp4(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePrimaryIp6(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRole(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateTenant(formats); err != nil { - // prop res = append(res, err) } if err := m.validateVcpus(formats); err != nil { - // prop res = append(res, err) } @@ -172,14 +187,13 @@ func (m *VirtualMachine) Validate(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validateCluster(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validateCluster(formats strfmt.Registry) error { if err := validate.Required("cluster", "body", m.Cluster); err != nil { return err } if m.Cluster != nil { - if err := m.Cluster.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("cluster") @@ -191,7 +205,20 @@ func (m *VirtualMachine) validateCluster(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validateDisk(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineWithConfigContext) validateDisk(formats strfmt.Registry) error { if swag.IsZero(m.Disk) { // not required return nil @@ -208,7 +235,20 @@ func (m *VirtualMachine) validateDisk(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validateMemory(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineWithConfigContext) validateMemory(formats strfmt.Registry) error { if swag.IsZero(m.Memory) { // not required return nil @@ -225,12 +265,16 @@ func (m *VirtualMachine) validateMemory(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validateName(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -238,14 +282,13 @@ func (m *VirtualMachine) validateName(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validatePlatform(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validatePlatform(formats strfmt.Registry) error { - if err := validate.Required("platform", "body", m.Platform); err != nil { - return err + if swag.IsZero(m.Platform) { // not required + return nil } if m.Platform != nil { - if err := m.Platform.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("platform") @@ -257,14 +300,13 @@ func (m *VirtualMachine) validatePlatform(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validatePrimaryIP(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validatePrimaryIP(formats strfmt.Registry) error { - if err := validate.Required("primary_ip", "body", m.PrimaryIP); err != nil { - return err + if swag.IsZero(m.PrimaryIP) { // not required + return nil } if m.PrimaryIP != nil { - if err := m.PrimaryIP.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary_ip") @@ -276,14 +318,13 @@ func (m *VirtualMachine) validatePrimaryIP(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validatePrimaryIp4(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validatePrimaryIp4(formats strfmt.Registry) error { - if err := validate.Required("primary_ip4", "body", m.PrimaryIp4); err != nil { - return err + if swag.IsZero(m.PrimaryIp4) { // not required + return nil } if m.PrimaryIp4 != nil { - if err := m.PrimaryIp4.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary_ip4") @@ -295,14 +336,13 @@ func (m *VirtualMachine) validatePrimaryIp4(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validatePrimaryIp6(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validatePrimaryIp6(formats strfmt.Registry) error { - if err := validate.Required("primary_ip6", "body", m.PrimaryIp6); err != nil { - return err + if swag.IsZero(m.PrimaryIp6) { // not required + return nil } if m.PrimaryIp6 != nil { - if err := m.PrimaryIp6.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("primary_ip6") @@ -314,14 +354,13 @@ func (m *VirtualMachine) validatePrimaryIp6(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validateRole(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validateRole(formats strfmt.Registry) error { - if err := validate.Required("role", "body", m.Role); err != nil { - return err + if swag.IsZero(m.Role) { // not required + return nil } if m.Role != nil { - if err := m.Role.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("role") @@ -333,14 +372,31 @@ func (m *VirtualMachine) validateRole(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validateStatus(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validateSite(formats strfmt.Registry) error { - if err := validate.Required("status", "body", m.Status); err != nil { - return err + if swag.IsZero(m.Site) { // not required + return nil } - if m.Status != nil { + if m.Site != nil { + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + return nil +} + +func (m *VirtualMachineWithConfigContext) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { if err := m.Status.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("status") @@ -352,14 +408,30 @@ func (m *VirtualMachine) validateStatus(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validateTenant(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validateTags(formats strfmt.Registry) error { - if err := validate.Required("tenant", "body", m.Tenant); err != nil { - return err + if swag.IsZero(m.Tags) { // not required + return nil } - if m.Tenant != nil { + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} +func (m *VirtualMachineWithConfigContext) validateTenant(formats strfmt.Registry) error { + + if swag.IsZero(m.Tenant) { // not required + return nil + } + + if m.Tenant != nil { if err := m.Tenant.Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("tenant") @@ -371,7 +443,7 @@ func (m *VirtualMachine) validateTenant(formats strfmt.Registry) error { return nil } -func (m *VirtualMachine) validateVcpus(formats strfmt.Registry) error { +func (m *VirtualMachineWithConfigContext) validateVcpus(formats strfmt.Registry) error { if swag.IsZero(m.Vcpus) { // not required return nil @@ -389,7 +461,74 @@ func (m *VirtualMachine) validateVcpus(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (m *VirtualMachine) MarshalBinary() ([]byte, error) { +func (m *VirtualMachineWithConfigContext) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachineWithConfigContext) UnmarshalBinary(b []byte) error { + var res VirtualMachineWithConfigContext + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// VirtualMachineWithConfigContextStatus Status +// swagger:model VirtualMachineWithConfigContextStatus +type VirtualMachineWithConfigContextStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this virtual machine with config context status +func (m *VirtualMachineWithConfigContextStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachineWithConfigContextStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineWithConfigContextStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("status"+"."+"value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachineWithConfigContextStatus) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -397,8 +536,8 @@ func (m *VirtualMachine) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *VirtualMachine) UnmarshalBinary(b []byte) error { - var res VirtualMachine +func (m *VirtualMachineWithConfigContextStatus) UnmarshalBinary(b []byte) error { + var res VirtualMachineWithConfigContextStatus if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/netbox/models/virtualization_cluster_groups_list_okbody.go b/netbox/models/virtualization_cluster_groups_list_okbody.go deleted file mode 100644 index 3cb5e6075a98c7b47c8f783030997cdf878b800b..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_cluster_groups_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VirtualizationClusterGroupsListOKBody virtualization cluster groups list o k body -// swagger:model virtualizationClusterGroupsListOKBody -type VirtualizationClusterGroupsListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results VirtualizationClusterGroupsListOKBodyResults `json:"results"` -} - -// Validate validates this virtualization cluster groups list o k body -func (m *VirtualizationClusterGroupsListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VirtualizationClusterGroupsListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *VirtualizationClusterGroupsListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualizationClusterGroupsListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualizationClusterGroupsListOKBody) UnmarshalBinary(b []byte) error { - var res VirtualizationClusterGroupsListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/virtualization_cluster_groups_list_okbody_results.go b/netbox/models/virtualization_cluster_groups_list_okbody_results.go deleted file mode 100644 index 8dd968e1fad27717b332903ba70c492e03c14da3..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_cluster_groups_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// VirtualizationClusterGroupsListOKBodyResults virtualization cluster groups list o k body results -// swagger:model virtualizationClusterGroupsListOKBodyResults -type VirtualizationClusterGroupsListOKBodyResults []*ClusterGroup - -// Validate validates this virtualization cluster groups list o k body results -func (m VirtualizationClusterGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/virtualization_cluster_types_list_okbody.go b/netbox/models/virtualization_cluster_types_list_okbody.go deleted file mode 100644 index 96f65286ae714e530c3cc0fd3a3844a2564d53f0..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_cluster_types_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VirtualizationClusterTypesListOKBody virtualization cluster types list o k body -// swagger:model virtualizationClusterTypesListOKBody -type VirtualizationClusterTypesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results VirtualizationClusterTypesListOKBodyResults `json:"results"` -} - -// Validate validates this virtualization cluster types list o k body -func (m *VirtualizationClusterTypesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VirtualizationClusterTypesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *VirtualizationClusterTypesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualizationClusterTypesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualizationClusterTypesListOKBody) UnmarshalBinary(b []byte) error { - var res VirtualizationClusterTypesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/virtualization_cluster_types_list_okbody_results.go b/netbox/models/virtualization_cluster_types_list_okbody_results.go deleted file mode 100644 index aac33c79dc517b6429412a82422e81a9597ec050..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_cluster_types_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// VirtualizationClusterTypesListOKBodyResults virtualization cluster types list o k body results -// swagger:model virtualizationClusterTypesListOKBodyResults -type VirtualizationClusterTypesListOKBodyResults []*ClusterType - -// Validate validates this virtualization cluster types list o k body results -func (m VirtualizationClusterTypesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/virtualization_clusters_list_okbody.go b/netbox/models/virtualization_clusters_list_okbody.go deleted file mode 100644 index f36c19fddfcd23e383bf22ca1813a5ece19e2051..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_clusters_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VirtualizationClustersListOKBody virtualization clusters list o k body -// swagger:model virtualizationClustersListOKBody -type VirtualizationClustersListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results VirtualizationClustersListOKBodyResults `json:"results"` -} - -// Validate validates this virtualization clusters list o k body -func (m *VirtualizationClustersListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VirtualizationClustersListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *VirtualizationClustersListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualizationClustersListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualizationClustersListOKBody) UnmarshalBinary(b []byte) error { - var res VirtualizationClustersListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/virtualization_clusters_list_okbody_results.go b/netbox/models/virtualization_clusters_list_okbody_results.go deleted file mode 100644 index f562a93e55f4288d3c2bf56bbde48951296f41e9..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_clusters_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// VirtualizationClustersListOKBodyResults virtualization clusters list o k body results -// swagger:model virtualizationClustersListOKBodyResults -type VirtualizationClustersListOKBodyResults []*Cluster - -// Validate validates this virtualization clusters list o k body results -func (m VirtualizationClustersListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/virtualization_interfaces_list_okbody.go b/netbox/models/virtualization_interfaces_list_okbody.go deleted file mode 100644 index 58ed446a90b12d8dbc52e31a036e20b7de8bfc87..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_interfaces_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VirtualizationInterfacesListOKBody virtualization interfaces list o k body -// swagger:model virtualizationInterfacesListOKBody -type VirtualizationInterfacesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results VirtualizationInterfacesListOKBodyResults `json:"results"` -} - -// Validate validates this virtualization interfaces list o k body -func (m *VirtualizationInterfacesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VirtualizationInterfacesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *VirtualizationInterfacesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualizationInterfacesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualizationInterfacesListOKBody) UnmarshalBinary(b []byte) error { - var res VirtualizationInterfacesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/virtualization_interfaces_list_okbody_results.go b/netbox/models/virtualization_interfaces_list_okbody_results.go deleted file mode 100644 index 7974f6adb1ad91ce59722e5de079adbe238733c2..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_interfaces_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// VirtualizationInterfacesListOKBodyResults virtualization interfaces list o k body results -// swagger:model virtualizationInterfacesListOKBodyResults -type VirtualizationInterfacesListOKBodyResults []*Interface - -// Validate validates this virtualization interfaces list o k body results -func (m VirtualizationInterfacesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/virtualization_virtual_machines_list_okbody.go b/netbox/models/virtualization_virtual_machines_list_okbody.go deleted file mode 100644 index 18fa88b1268e2b0f57b1bd59756d6ee42a7b2034..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_virtual_machines_list_okbody.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VirtualizationVirtualMachinesListOKBody virtualization virtual machines list o k body -// swagger:model virtualizationVirtualMachinesListOKBody -type VirtualizationVirtualMachinesListOKBody struct { - - // count - // Required: true - Count *int64 `json:"count"` - - // next - Next *strfmt.URI `json:"next,omitempty"` - - // previous - Previous *strfmt.URI `json:"previous,omitempty"` - - // results - // Required: true - Results VirtualizationVirtualMachinesListOKBodyResults `json:"results"` -} - -// Validate validates this virtualization virtual machines list o k body -func (m *VirtualizationVirtualMachinesListOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateResults(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VirtualizationVirtualMachinesListOKBody) validateCount(formats strfmt.Registry) error { - - if err := validate.Required("count", "body", m.Count); err != nil { - return err - } - - return nil -} - -func (m *VirtualizationVirtualMachinesListOKBody) validateResults(formats strfmt.Registry) error { - - if err := validate.Required("results", "body", m.Results); err != nil { - return err - } - - if err := m.Results.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("results") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VirtualizationVirtualMachinesListOKBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VirtualizationVirtualMachinesListOKBody) UnmarshalBinary(b []byte) error { - var res VirtualizationVirtualMachinesListOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/virtualization_virtual_machines_list_okbody_results.go b/netbox/models/virtualization_virtual_machines_list_okbody_results.go deleted file mode 100644 index 874c63a21da47e06eb94f0b40025a9a853c8847a..0000000000000000000000000000000000000000 --- a/netbox/models/virtualization_virtual_machines_list_okbody_results.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "strconv" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" -) - -// VirtualizationVirtualMachinesListOKBodyResults virtualization virtual machines list o k body results -// swagger:model virtualizationVirtualMachinesListOKBodyResults -type VirtualizationVirtualMachinesListOKBodyResults []*VirtualMachine - -// Validate validates this virtualization virtual machines list o k body results -func (m VirtualizationVirtualMachinesListOKBodyResults) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/netbox/models/vlanstatus.go b/netbox/models/vlanstatus.go deleted file mode 100644 index 46466c2f019d29949c8111a8be8b8ec9c8dfe463..0000000000000000000000000000000000000000 --- a/netbox/models/vlanstatus.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VLANStatus Status -// swagger:model vLANStatus -type VLANStatus struct { - - // label - // Required: true - Label *string `json:"label"` - - // value - // Required: true - Value *int64 `json:"value"` -} - -// Validate validates this v l a n status -func (m *VLANStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateValue(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VLANStatus) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *VLANStatus) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *VLANStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VLANStatus) UnmarshalBinary(b []byte) error { - var res VLANStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/writable_aggregate.go b/netbox/models/writable_aggregate.go index 7f2de135dcc116e52e09d8696e99a35f391a7766..eabc93eafe5c356a78790299bbb30167b52ceafe 100644 --- a/netbox/models/writable_aggregate.go +++ b/netbox/models/writable_aggregate.go @@ -20,6 +20,9 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,24 +36,32 @@ type WritableAggregate struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` // Date added - DateAdded strfmt.Date `json:"date_added,omitempty"` + // Format: date + DateAdded *strfmt.Date `json:"date_added,omitempty"` // Description // Max Length: 100 Description string `json:"description,omitempty"` + // Family + // Read Only: true + // Enum: [4 6] + Family int64 `json:"family,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Prefix @@ -60,24 +71,44 @@ type WritableAggregate struct { // RIR // Required: true Rir *int64 `json:"rir"` + + // tags + Tags []string `json:"tags"` } // Validate validates this writable aggregate func (m *WritableAggregate) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateAdded(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateFamily(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validatePrefix(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRir(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -87,6 +118,32 @@ func (m *WritableAggregate) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableAggregate) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableAggregate) validateDateAdded(formats strfmt.Registry) error { + + if swag.IsZero(m.DateAdded) { // not required + return nil + } + + if err := validate.FormatOf("date_added", "body", "date", m.DateAdded.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableAggregate) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -100,6 +157,53 @@ func (m *WritableAggregate) validateDescription(formats strfmt.Registry) error { return nil } +var writableAggregateTypeFamilyPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[4,6]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableAggregateTypeFamilyPropEnum = append(writableAggregateTypeFamilyPropEnum, v) + } +} + +// prop value enum +func (m *WritableAggregate) validateFamilyEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableAggregateTypeFamilyPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableAggregate) validateFamily(formats strfmt.Registry) error { + + if swag.IsZero(m.Family) { // not required + return nil + } + + // value enum + if err := m.validateFamilyEnum("family", "body", m.Family); err != nil { + return err + } + + return nil +} + +func (m *WritableAggregate) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableAggregate) validatePrefix(formats strfmt.Registry) error { if err := validate.Required("prefix", "body", m.Prefix); err != nil { @@ -118,6 +222,23 @@ func (m *WritableAggregate) validateRir(formats strfmt.Registry) error { return nil } +func (m *WritableAggregate) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableAggregate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_cable.go b/netbox/models/writable_cable.go new file mode 100644 index 0000000000000000000000000000000000000000..69083cd0ea8d3d2e6085586509ea089dce41bed5 --- /dev/null +++ b/netbox/models/writable_cable.go @@ -0,0 +1,362 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableCable writable cable +// swagger:model WritableCable +type WritableCable struct { + + // Color + // Max Length: 6 + // Pattern: ^[0-9a-f]{6}$ + Color string `json:"color,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Label + // Max Length: 100 + Label string `json:"label,omitempty"` + + // Length + // Maximum: 32767 + // Minimum: 0 + Length *int64 `json:"length,omitempty"` + + // Length unit + // Enum: [1200 1100 2100 2000] + LengthUnit *int64 `json:"length_unit,omitempty"` + + // Status + // Enum: [false true] + Status bool `json:"status,omitempty"` + + // Termination a + // Read Only: true + TerminationA map[string]string `json:"termination_a,omitempty"` + + // Termination a id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + TerminationAID *int64 `json:"termination_a_id"` + + // Termination a type + // Required: true + TerminationAType *string `json:"termination_a_type"` + + // Termination b + // Read Only: true + TerminationB map[string]string `json:"termination_b,omitempty"` + + // Termination b id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + TerminationBID *int64 `json:"termination_b_id"` + + // Termination b type + // Required: true + TerminationBType *string `json:"termination_b_type"` + + // Type + // Enum: [1300 1500 1510 1600 1610 1700 1800 1810 3000 3010 3020 3030 3040 3500 3510 3520 3800 5000] + Type *int64 `json:"type,omitempty"` +} + +// Validate validates this writable cable +func (m *WritableCable) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLabel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLength(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLengthUnit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTerminationAID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTerminationAType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTerminationBID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTerminationBType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableCable) validateColor(formats strfmt.Registry) error { + + if swag.IsZero(m.Color) { // not required + return nil + } + + if err := validate.MaxLength("color", "body", string(m.Color), 6); err != nil { + return err + } + + if err := validate.Pattern("color", "body", string(m.Color), `^[0-9a-f]{6}$`); err != nil { + return err + } + + return nil +} + +func (m *WritableCable) validateLabel(formats strfmt.Registry) error { + + if swag.IsZero(m.Label) { // not required + return nil + } + + if err := validate.MaxLength("label", "body", string(m.Label), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableCable) validateLength(formats strfmt.Registry) error { + + if swag.IsZero(m.Length) { // not required + return nil + } + + if err := validate.MinimumInt("length", "body", int64(*m.Length), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("length", "body", int64(*m.Length), 32767, false); err != nil { + return err + } + + return nil +} + +var writableCableTypeLengthUnitPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1200,1100,2100,2000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableCableTypeLengthUnitPropEnum = append(writableCableTypeLengthUnitPropEnum, v) + } +} + +// prop value enum +func (m *WritableCable) validateLengthUnitEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableCableTypeLengthUnitPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableCable) validateLengthUnit(formats strfmt.Registry) error { + + if swag.IsZero(m.LengthUnit) { // not required + return nil + } + + // value enum + if err := m.validateLengthUnitEnum("length_unit", "body", *m.LengthUnit); err != nil { + return err + } + + return nil +} + +var writableCableTypeStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableCableTypeStatusPropEnum = append(writableCableTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableCable) validateStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableCableTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableCable) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *WritableCable) validateTerminationAID(formats strfmt.Registry) error { + + if err := validate.Required("termination_a_id", "body", m.TerminationAID); err != nil { + return err + } + + if err := validate.MinimumInt("termination_a_id", "body", int64(*m.TerminationAID), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("termination_a_id", "body", int64(*m.TerminationAID), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableCable) validateTerminationAType(formats strfmt.Registry) error { + + if err := validate.Required("termination_a_type", "body", m.TerminationAType); err != nil { + return err + } + + return nil +} + +func (m *WritableCable) validateTerminationBID(formats strfmt.Registry) error { + + if err := validate.Required("termination_b_id", "body", m.TerminationBID); err != nil { + return err + } + + if err := validate.MinimumInt("termination_b_id", "body", int64(*m.TerminationBID), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("termination_b_id", "body", int64(*m.TerminationBID), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableCable) validateTerminationBType(formats strfmt.Registry) error { + + if err := validate.Required("termination_b_type", "body", m.TerminationBType); err != nil { + return err + } + + return nil +} + +var writableCableTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1300,1500,1510,1600,1610,1700,1800,1810,3000,3010,3020,3030,3040,3500,3510,3520,3800,5000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableCableTypeTypePropEnum = append(writableCableTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableCable) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableCableTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableCable) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableCable) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableCable) UnmarshalBinary(b []byte) error { + var res WritableCable + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_circuit.go b/netbox/models/writable_circuit.go index d0a92cc47d5ba15a681998e4e8e06b06c82a7a82..e02cbbad1b5c9afb6638f049b3726e653b3ca675 100644 --- a/netbox/models/writable_circuit.go +++ b/netbox/models/writable_circuit.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -36,6 +37,7 @@ type WritableCircuit struct { // Circuit ID // Required: true // Max Length: 50 + // Min Length: 1 Cid *string `json:"cid"` // Comments @@ -48,6 +50,7 @@ type WritableCircuit struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -62,10 +65,12 @@ type WritableCircuit struct { ID int64 `json:"id,omitempty"` // Date installed - InstallDate strfmt.Date `json:"install_date,omitempty"` + // Format: date + InstallDate *strfmt.Date `json:"install_date,omitempty"` // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Provider @@ -73,10 +78,14 @@ type WritableCircuit struct { Provider *int64 `json:"provider"` // Status + // Enum: [2 3 1 4 0 5] Status int64 `json:"status,omitempty"` + // tags + Tags []string `json:"tags"` + // Tenant - Tenant int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant,omitempty"` // Type // Required: true @@ -88,32 +97,42 @@ func (m *WritableCircuit) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCid(formats); err != nil { - // prop res = append(res, err) } if err := m.validateCommitRate(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateInstallDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateProvider(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } @@ -129,6 +148,10 @@ func (m *WritableCircuit) validateCid(formats strfmt.Registry) error { return err } + if err := validate.MinLength("cid", "body", string(*m.Cid), 1); err != nil { + return err + } + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { return err } @@ -153,6 +176,19 @@ func (m *WritableCircuit) validateCommitRate(formats strfmt.Registry) error { return nil } +func (m *WritableCircuit) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableCircuit) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -166,6 +202,32 @@ func (m *WritableCircuit) validateDescription(formats strfmt.Registry) error { return nil } +func (m *WritableCircuit) validateInstallDate(formats strfmt.Registry) error { + + if swag.IsZero(m.InstallDate) { // not required + return nil + } + + if err := validate.FormatOf("install_date", "body", "date", m.InstallDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuit) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableCircuit) validateProvider(formats strfmt.Registry) error { if err := validate.Required("provider", "body", m.Provider); err != nil { @@ -209,6 +271,23 @@ func (m *WritableCircuit) validateStatus(formats strfmt.Registry) error { return nil } +func (m *WritableCircuit) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *WritableCircuit) validateType(formats strfmt.Registry) error { if err := validate.Required("type", "body", m.Type); err != nil { diff --git a/netbox/models/writable_circuit_termination.go b/netbox/models/writable_circuit_termination.go index cb837e40b3578a6774fb957d3a2e4e8b0ae84b18..2d42b371c420fb28d3e407798cbc2d76b887a2d5 100644 --- a/netbox/models/writable_circuit_termination.go +++ b/netbox/models/writable_circuit_termination.go @@ -33,17 +33,37 @@ import ( // swagger:model WritableCircuitTermination type WritableCircuitTermination struct { + // cable + Cable *NestedCable `json:"cable,omitempty"` + // Circuit // Required: true Circuit *int64 `json:"circuit"` + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // Connection status + // Enum: [false true] + ConnectionStatus bool `json:"connection_status,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` - // Interface - Interface int64 `json:"interface,omitempty"` - // Port speed (Kbps) // Required: true // Maximum: 2.147483647e+09 @@ -60,6 +80,7 @@ type WritableCircuitTermination struct { // Termination // Required: true + // Enum: [A Z] TermSide *string `json:"term_side"` // Upstream speed (Kbps) @@ -78,38 +99,43 @@ type WritableCircuitTermination struct { func (m *WritableCircuitTermination) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + if err := m.validateCircuit(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { res = append(res, err) } if err := m.validatePortSpeed(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePpInfo(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateTermSide(formats); err != nil { - // prop res = append(res, err) } if err := m.validateUpstreamSpeed(formats); err != nil { - // prop res = append(res, err) } if err := m.validateXconnectID(formats); err != nil { - // prop res = append(res, err) } @@ -119,6 +145,24 @@ func (m *WritableCircuitTermination) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableCircuitTermination) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + func (m *WritableCircuitTermination) validateCircuit(formats strfmt.Registry) error { if err := validate.Required("circuit", "body", m.Circuit); err != nil { @@ -128,6 +172,53 @@ func (m *WritableCircuitTermination) validateCircuit(formats strfmt.Registry) er return nil } +var writableCircuitTerminationTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableCircuitTerminationTypeConnectionStatusPropEnum = append(writableCircuitTerminationTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableCircuitTermination) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableCircuitTerminationTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableCircuitTermination) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *WritableCircuitTermination) validatePortSpeed(formats strfmt.Registry) error { if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { @@ -180,8 +271,10 @@ func init() { } const ( + // WritableCircuitTerminationTermSideA captures enum value "A" WritableCircuitTerminationTermSideA string = "A" + // WritableCircuitTerminationTermSideZ captures enum value "Z" WritableCircuitTerminationTermSideZ string = "Z" ) diff --git a/netbox/models/writable_cluster.go b/netbox/models/writable_cluster.go index 03f05b68eb31d7be96cb57222f3207ff1f6b3229..01e87bbd124db60a356479a3f6cba34321737c29 100644 --- a/netbox/models/writable_cluster.go +++ b/netbox/models/writable_cluster.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -36,13 +38,18 @@ type WritableCluster struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // Group - Group int64 `json:"group,omitempty"` + Group *int64 `json:"group,omitempty"` // ID // Read Only: true @@ -50,32 +57,51 @@ type WritableCluster struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 100 + // Min Length: 1 Name *string `json:"name"` // Site - Site int64 `json:"site,omitempty"` + Site *int64 `json:"site,omitempty"` + + // tags + Tags []string `json:"tags"` // Type // Required: true Type *int64 `json:"type"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` } // Validate validates this writable cluster func (m *WritableCluster) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } @@ -85,12 +111,42 @@ func (m *WritableCluster) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableCluster) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableCluster) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableCluster) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { return err } @@ -98,6 +154,23 @@ func (m *WritableCluster) validateName(formats strfmt.Registry) error { return nil } +func (m *WritableCluster) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *WritableCluster) validateType(formats strfmt.Registry) error { if err := validate.Required("type", "body", m.Type); err != nil { diff --git a/netbox/models/writable_config_context.go b/netbox/models/writable_config_context.go new file mode 100644 index 0000000000000000000000000000000000000000..36dbe4c147a3d32e67023d96d6687771e43de177 --- /dev/null +++ b/netbox/models/writable_config_context.go @@ -0,0 +1,285 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableConfigContext writable config context +// swagger:model WritableConfigContext +type WritableConfigContext struct { + + // Data + // Required: true + Data *string `json:"data"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Is active + IsActive bool `json:"is_active,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // platforms + // Unique: true + Platforms []int64 `json:"platforms"` + + // regions + // Unique: true + Regions []int64 `json:"regions"` + + // roles + // Unique: true + Roles []int64 `json:"roles"` + + // sites + // Unique: true + Sites []int64 `json:"sites"` + + // tenant groups + // Unique: true + TenantGroups []int64 `json:"tenant_groups"` + + // tenants + // Unique: true + Tenants []int64 `json:"tenants"` + + // Weight + // Maximum: 32767 + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this writable config context +func (m *WritableConfigContext) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateData(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePlatforms(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRegions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSites(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenantGroups(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTenants(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableConfigContext) validateData(formats strfmt.Registry) error { + + if err := validate.Required("data", "body", m.Data); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validatePlatforms(formats strfmt.Registry) error { + + if swag.IsZero(m.Platforms) { // not required + return nil + } + + if err := validate.UniqueItems("platforms", "body", m.Platforms); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validateRegions(formats strfmt.Registry) error { + + if swag.IsZero(m.Regions) { // not required + return nil + } + + if err := validate.UniqueItems("regions", "body", m.Regions); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validateRoles(formats strfmt.Registry) error { + + if swag.IsZero(m.Roles) { // not required + return nil + } + + if err := validate.UniqueItems("roles", "body", m.Roles); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validateSites(formats strfmt.Registry) error { + + if swag.IsZero(m.Sites) { // not required + return nil + } + + if err := validate.UniqueItems("sites", "body", m.Sites); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validateTenantGroups(formats strfmt.Registry) error { + + if swag.IsZero(m.TenantGroups) { // not required + return nil + } + + if err := validate.UniqueItems("tenant_groups", "body", m.TenantGroups); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validateTenants(formats strfmt.Registry) error { + + if swag.IsZero(m.Tenants) { // not required + return nil + } + + if err := validate.UniqueItems("tenants", "body", m.Tenants); err != nil { + return err + } + + return nil +} + +func (m *WritableConfigContext) validateWeight(formats strfmt.Registry) error { + + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", int64(*m.Weight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("weight", "body", int64(*m.Weight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableConfigContext) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConfigContext) UnmarshalBinary(b []byte) error { + var res WritableConfigContext + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_console_port.go b/netbox/models/writable_console_port.go index 4c27c85566c61bd0cf1fb1a9f93d635021cb3420..1b7e612e9f302fd361ae2f2dc73112f9f3c122e8 100644 --- a/netbox/models/writable_console_port.go +++ b/netbox/models/writable_console_port.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -33,11 +34,28 @@ import ( // swagger:model WritableConsolePort type WritableConsolePort struct { + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + // Connection status + // Enum: [false true] ConnectionStatus bool `json:"connection_status,omitempty"` - // Console server port - CsPort int64 `json:"cs_port,omitempty"` + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` // Device // Required: true @@ -50,25 +68,38 @@ type WritableConsolePort struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // tags + Tags []string `json:"tags"` } // Validate validates this writable console port func (m *WritableConsolePort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + if err := m.validateConnectionStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { res = append(res, err) } if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -78,6 +109,24 @@ func (m *WritableConsolePort) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableConsolePort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + var writableConsolePortTypeConnectionStatusPropEnum []interface{} func init() { @@ -112,6 +161,19 @@ func (m *WritableConsolePort) validateConnectionStatus(formats strfmt.Registry) return nil } +func (m *WritableConsolePort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *WritableConsolePort) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -127,6 +189,10 @@ func (m *WritableConsolePort) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -134,6 +200,23 @@ func (m *WritableConsolePort) validateName(formats strfmt.Registry) error { return nil } +func (m *WritableConsolePort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableConsolePort) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_console_port_template.go b/netbox/models/writable_console_port_template.go index ec34e448864297d5982248b5a762e4d98ca678c4..9c15e51241868bb9a5bfa6701eead15c711c75a4 100644 --- a/netbox/models/writable_console_port_template.go +++ b/netbox/models/writable_console_port_template.go @@ -42,6 +42,7 @@ type WritableConsolePortTemplate struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` } @@ -50,12 +51,10 @@ func (m *WritableConsolePortTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } @@ -80,6 +79,10 @@ func (m *WritableConsolePortTemplate) validateName(formats strfmt.Registry) erro return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } diff --git a/netbox/models/writable_console_server_port.go b/netbox/models/writable_console_server_port.go index d0609761c6e9fe7db9cc8c8795d5c95640bb6a8b..dfa474cbb97952df37689e9b9fd91b97a982d6d5 100644 --- a/netbox/models/writable_console_server_port.go +++ b/netbox/models/writable_console_server_port.go @@ -20,6 +20,9 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -31,6 +34,29 @@ import ( // swagger:model WritableConsoleServerPort type WritableConsoleServerPort struct { + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // Connection status + // Enum: [false true] + ConnectionStatus bool `json:"connection_status,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // Device // Required: true Device *int64 `json:"device"` @@ -42,20 +68,38 @@ type WritableConsoleServerPort struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // tags + Tags []string `json:"tags"` } // Validate validates this writable console server port func (m *WritableConsoleServerPort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -65,6 +109,71 @@ func (m *WritableConsoleServerPort) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableConsoleServerPort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +var writableConsoleServerPortTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableConsoleServerPortTypeConnectionStatusPropEnum = append(writableConsoleServerPortTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableConsoleServerPort) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableConsoleServerPortTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableConsoleServerPort) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *WritableConsoleServerPort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *WritableConsoleServerPort) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -80,6 +189,10 @@ func (m *WritableConsoleServerPort) validateName(formats strfmt.Registry) error return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -87,6 +200,23 @@ func (m *WritableConsoleServerPort) validateName(formats strfmt.Registry) error return nil } +func (m *WritableConsoleServerPort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableConsoleServerPort) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_console_server_port_template.go b/netbox/models/writable_console_server_port_template.go index 35e16a1e31030d5bea8102f76f4d9c2fb66e5417..745874c98653657da8a8e54bdbc775dcf23d2f1b 100644 --- a/netbox/models/writable_console_server_port_template.go +++ b/netbox/models/writable_console_server_port_template.go @@ -42,6 +42,7 @@ type WritableConsoleServerPortTemplate struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` } @@ -50,12 +51,10 @@ func (m *WritableConsoleServerPortTemplate) Validate(formats strfmt.Registry) er var res []error if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } @@ -80,6 +79,10 @@ func (m *WritableConsoleServerPortTemplate) validateName(formats strfmt.Registry return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } diff --git a/netbox/models/writable_device.go b/netbox/models/writable_device.go deleted file mode 100644 index a047d7735f55057a348595817fe7352027dfc1db..0000000000000000000000000000000000000000 --- a/netbox/models/writable_device.go +++ /dev/null @@ -1,391 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WritableDevice writable device -// swagger:model WritableDevice -type WritableDevice struct { - - // Asset tag - // - // A unique tag used to identify this device - // Max Length: 50 - AssetTag string `json:"asset_tag,omitempty"` - - // Cluster - Cluster int64 `json:"cluster,omitempty"` - - // Comments - Comments string `json:"comments,omitempty"` - - // Created - // Read Only: true - Created strfmt.Date `json:"created,omitempty"` - - // Custom fields - CustomFields interface{} `json:"custom_fields,omitempty"` - - // Device role - // Required: true - DeviceRole *int64 `json:"device_role"` - - // Device type - // Required: true - DeviceType *int64 `json:"device_type"` - - // Rack face - Face int64 `json:"face,omitempty"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Last updated - // Read Only: true - LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` - - // Name - // Max Length: 64 - Name string `json:"name,omitempty"` - - // Platform - Platform int64 `json:"platform,omitempty"` - - // Position (U) - // - // The lowest-numbered unit occupied by the device - // Maximum: 32767 - // Minimum: 1 - Position int64 `json:"position,omitempty"` - - // Primary IPv4 - PrimaryIp4 int64 `json:"primary_ip4,omitempty"` - - // Primary IPv6 - PrimaryIp6 int64 `json:"primary_ip6,omitempty"` - - // Rack - Rack int64 `json:"rack,omitempty"` - - // Serial number - // Max Length: 50 - Serial string `json:"serial,omitempty"` - - // Site - // Required: true - Site *int64 `json:"site"` - - // Status - Status int64 `json:"status,omitempty"` - - // Tenant - Tenant int64 `json:"tenant,omitempty"` - - // Vc position - // Maximum: 255 - // Minimum: 0 - VcPosition *int64 `json:"vc_position,omitempty"` - - // Vc priority - // Maximum: 255 - // Minimum: 0 - VcPriority *int64 `json:"vc_priority,omitempty"` - - // Virtual chassis - VirtualChassis int64 `json:"virtual_chassis,omitempty"` -} - -// Validate validates this writable device -func (m *WritableDevice) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAssetTag(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateDeviceRole(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateDeviceType(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateFace(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validatePosition(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateSerial(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateSite(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateVcPosition(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateVcPriority(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WritableDevice) validateAssetTag(formats strfmt.Registry) error { - - if swag.IsZero(m.AssetTag) { // not required - return nil - } - - if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { - return err - } - - return nil -} - -func (m *WritableDevice) validateDeviceRole(formats strfmt.Registry) error { - - if err := validate.Required("device_role", "body", m.DeviceRole); err != nil { - return err - } - - return nil -} - -func (m *WritableDevice) validateDeviceType(formats strfmt.Registry) error { - - if err := validate.Required("device_type", "body", m.DeviceType); err != nil { - return err - } - - return nil -} - -var writableDeviceTypeFacePropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[0,1]`), &res); err != nil { - panic(err) - } - for _, v := range res { - writableDeviceTypeFacePropEnum = append(writableDeviceTypeFacePropEnum, v) - } -} - -// prop value enum -func (m *WritableDevice) validateFaceEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, writableDeviceTypeFacePropEnum); err != nil { - return err - } - return nil -} - -func (m *WritableDevice) validateFace(formats strfmt.Registry) error { - - if swag.IsZero(m.Face) { // not required - return nil - } - - // value enum - if err := m.validateFaceEnum("face", "body", m.Face); err != nil { - return err - } - - return nil -} - -func (m *WritableDevice) validateName(formats strfmt.Registry) error { - - if swag.IsZero(m.Name) { // not required - return nil - } - - if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { - return err - } - - return nil -} - -func (m *WritableDevice) validatePosition(formats strfmt.Registry) error { - - if swag.IsZero(m.Position) { // not required - return nil - } - - if err := validate.MinimumInt("position", "body", int64(m.Position), 1, false); err != nil { - return err - } - - if err := validate.MaximumInt("position", "body", int64(m.Position), 32767, false); err != nil { - return err - } - - return nil -} - -func (m *WritableDevice) validateSerial(formats strfmt.Registry) error { - - if swag.IsZero(m.Serial) { // not required - return nil - } - - if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { - return err - } - - return nil -} - -func (m *WritableDevice) validateSite(formats strfmt.Registry) error { - - if err := validate.Required("site", "body", m.Site); err != nil { - return err - } - - return nil -} - -var writableDeviceTypeStatusPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,0,2,3,4,5]`), &res); err != nil { - panic(err) - } - for _, v := range res { - writableDeviceTypeStatusPropEnum = append(writableDeviceTypeStatusPropEnum, v) - } -} - -// prop value enum -func (m *WritableDevice) validateStatusEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, writableDeviceTypeStatusPropEnum); err != nil { - return err - } - return nil -} - -func (m *WritableDevice) validateStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *WritableDevice) validateVcPosition(formats strfmt.Registry) error { - - if swag.IsZero(m.VcPosition) { // not required - return nil - } - - if err := validate.MinimumInt("vc_position", "body", int64(*m.VcPosition), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("vc_position", "body", int64(*m.VcPosition), 255, false); err != nil { - return err - } - - return nil -} - -func (m *WritableDevice) validateVcPriority(formats strfmt.Registry) error { - - if swag.IsZero(m.VcPriority) { // not required - return nil - } - - if err := validate.MinimumInt("vc_priority", "body", int64(*m.VcPriority), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("vc_priority", "body", int64(*m.VcPriority), 255, false); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WritableDevice) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WritableDevice) UnmarshalBinary(b []byte) error { - var res WritableDevice - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/writable_device_bay.go b/netbox/models/writable_device_bay.go index e1caaeeac6e3ad9c023f3cf0163810461404920d..bceb7cbbc12d62e3b5b47f2c6b82dbb17decf180 100644 --- a/netbox/models/writable_device_bay.go +++ b/netbox/models/writable_device_bay.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -31,6 +33,10 @@ import ( // swagger:model WritableDeviceBay type WritableDeviceBay struct { + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // Device // Required: true Device *int64 `json:"device"` @@ -40,25 +46,35 @@ type WritableDeviceBay struct { ID int64 `json:"id,omitempty"` // Installed device - InstalledDevice int64 `json:"installed_device,omitempty"` + InstalledDevice *int64 `json:"installed_device,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // tags + Tags []string `json:"tags"` } // Validate validates this writable device bay func (m *WritableDeviceBay) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -68,6 +84,19 @@ func (m *WritableDeviceBay) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableDeviceBay) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *WritableDeviceBay) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -83,6 +112,10 @@ func (m *WritableDeviceBay) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -90,6 +123,23 @@ func (m *WritableDeviceBay) validateName(formats strfmt.Registry) error { return nil } +func (m *WritableDeviceBay) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableDeviceBay) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_device_bay_template.go b/netbox/models/writable_device_bay_template.go index 65148be7ea5d393a23f72617fabfa80bd74ba83c..ae5c9ebf097fb53a7235acce826a296c10315aea 100644 --- a/netbox/models/writable_device_bay_template.go +++ b/netbox/models/writable_device_bay_template.go @@ -42,6 +42,7 @@ type WritableDeviceBayTemplate struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` } @@ -50,12 +51,10 @@ func (m *WritableDeviceBayTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } @@ -80,6 +79,10 @@ func (m *WritableDeviceBayTemplate) validateName(formats strfmt.Registry) error return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } diff --git a/netbox/models/writable_device_interface.go b/netbox/models/writable_device_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..0be307dcdad516830a2bae37328e925eb956cf4a --- /dev/null +++ b/netbox/models/writable_device_interface.go @@ -0,0 +1,392 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableDeviceInterface writable device interface +// swagger:model WritableDeviceInterface +type WritableDeviceInterface struct { + + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // Connection status + // Enum: [false true] + ConnectionStatus bool `json:"connection_status,omitempty"` + + // Count ipaddresses + // Read Only: true + CountIpaddresses string `json:"count_ipaddresses,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // Form factor + // Read Only: true + FormFactor string `json:"form_factor,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Parent LAG + Lag *int64 `json:"lag,omitempty"` + + // MAC Address + MacAddress *string `json:"mac_address,omitempty"` + + // OOB Management + // + // This interface is used only for out-of-band management + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // Mode + // Enum: [100 200 300] + Mode *int64 `json:"mode,omitempty"` + + // MTU + // Maximum: 65536 + // Minimum: 1 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // tagged vlans + // Unique: true + TaggedVlans []int64 `json:"tagged_vlans"` + + // tags + Tags []string `json:"tags"` + + // Type + // Enum: [0 200 800 1000 1120 1130 1150 1170 1050 1100 1200 1300 1310 1320 1350 1400 1420 1500 1510 1650 1520 1550 1600 1700 1750 2600 2610 2620 2630 2640 2810 2820 2830 6100 6200 6300 6400 6500 6600 6700 3010 3020 3040 3080 3160 3320 3400 4000 4010 4040 4050 5000 5050 5100 5150 5200 5300 5310 5320 5330 32767] + Type int64 `json:"type,omitempty"` + + // Untagged VLAN + UntaggedVlan *int64 `json:"untagged_vlan,omitempty"` +} + +// Validate validates this writable device interface +func (m *WritableDeviceInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaggedVlans(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableDeviceInterface) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +var writableDeviceInterfaceTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceInterfaceTypeConnectionStatusPropEnum = append(writableDeviceInterfaceTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceInterface) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableDeviceInterfaceTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceInterface) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceInterface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceInterface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +var writableDeviceInterfaceTypeModePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[100,200,300]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceInterfaceTypeModePropEnum = append(writableDeviceInterfaceTypeModePropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceInterface) validateModeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceInterfaceTypeModePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceInterface) validateMode(formats strfmt.Registry) error { + + if swag.IsZero(m.Mode) { // not required + return nil + } + + // value enum + if err := m.validateModeEnum("mode", "body", *m.Mode); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceInterface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 65536, false); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceInterface) validateTaggedVlans(formats strfmt.Registry) error { + + if swag.IsZero(m.TaggedVlans) { // not required + return nil + } + + if err := validate.UniqueItems("tagged_vlans", "body", m.TaggedVlans); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceInterface) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +var writableDeviceInterfaceTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,200,800,1000,1120,1130,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1420,1500,1510,1650,1520,1550,1600,1700,1750,2600,2610,2620,2630,2640,2810,2820,2830,6100,6200,6300,6400,6500,6600,6700,3010,3020,3040,3080,3160,3320,3400,4000,4010,4040,4050,5000,5050,5100,5150,5200,5300,5310,5320,5330,32767]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceInterfaceTypeTypePropEnum = append(writableDeviceInterfaceTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceInterface) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceInterfaceTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceInterface) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableDeviceInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDeviceInterface) UnmarshalBinary(b []byte) error { + var res WritableDeviceInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_device_type.go b/netbox/models/writable_device_type.go index 68d1c690ab25d1a408cf6c1d1c551289fa092fff..5d8239648d633cc0d99ede2680bba41c60635e42 100644 --- a/netbox/models/writable_device_type.go +++ b/netbox/models/writable_device_type.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -36,35 +37,35 @@ type WritableDeviceType struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` - // ID + // Device count // Read Only: true - ID int64 `json:"id,omitempty"` + DeviceCount int64 `json:"device_count,omitempty"` - // Interface ordering - InterfaceOrdering int64 `json:"interface_ordering,omitempty"` + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` - // Is a console server - // - // This type of device has console server ports - IsConsoleServer bool `json:"is_console_server,omitempty"` + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` // Is full depth // // Device consumes both front and rear rack faces IsFullDepth bool `json:"is_full_depth,omitempty"` - // Is a network device - // - // This type of device has network interfaces - IsNetworkDevice bool `json:"is_network_device,omitempty"` - - // Is a PDU - // - // This type of device has power outlets - IsPdu bool `json:"is_pdu,omitempty"` + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Manufacturer // Required: true @@ -73,6 +74,7 @@ type WritableDeviceType struct { // Model // Required: true // Max Length: 50 + // Min Length: 1 Model *string `json:"model"` // Part number @@ -84,13 +86,18 @@ type WritableDeviceType struct { // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Parent/child status // // Parent devices house child devices in device bays. Select "None" if this device type is neither a parent nor a child. - SubdeviceRole *bool `json:"subdevice_role,omitempty"` + // Enum: [<nil> true false] + SubdeviceRole bool `json:"subdevice_role,omitempty"` + + // tags + Tags []string `json:"tags"` // Height (U) // Maximum: 32767 @@ -102,38 +109,39 @@ type WritableDeviceType struct { func (m *WritableDeviceType) Validate(formats strfmt.Registry) error { var res []error - if err := m.validateInterfaceOrdering(formats); err != nil { - // prop + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateManufacturer(formats); err != nil { - // prop res = append(res, err) } if err := m.validateModel(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePartNumber(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSubdeviceRole(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateUHeight(formats); err != nil { - // prop res = append(res, err) } @@ -143,34 +151,26 @@ func (m *WritableDeviceType) Validate(formats strfmt.Registry) error { return nil } -var writableDeviceTypeTypeInterfaceOrderingPropEnum []interface{} +func (m *WritableDeviceType) validateCreated(formats strfmt.Registry) error { -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil { - panic(err) - } - for _, v := range res { - writableDeviceTypeTypeInterfaceOrderingPropEnum = append(writableDeviceTypeTypeInterfaceOrderingPropEnum, v) + if swag.IsZero(m.Created) { // not required + return nil } -} -// prop value enum -func (m *WritableDeviceType) validateInterfaceOrderingEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, writableDeviceTypeTypeInterfaceOrderingPropEnum); err != nil { + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { return err } + return nil } -func (m *WritableDeviceType) validateInterfaceOrdering(formats strfmt.Registry) error { +func (m *WritableDeviceType) validateLastUpdated(formats strfmt.Registry) error { - if swag.IsZero(m.InterfaceOrdering) { // not required + if swag.IsZero(m.LastUpdated) { // not required return nil } - // value enum - if err := m.validateInterfaceOrderingEnum("interface_ordering", "body", m.InterfaceOrdering); err != nil { + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { return err } @@ -192,6 +192,10 @@ func (m *WritableDeviceType) validateModel(formats strfmt.Registry) error { return err } + if err := validate.MinLength("model", "body", string(*m.Model), 1); err != nil { + return err + } + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { return err } @@ -218,6 +222,10 @@ func (m *WritableDeviceType) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -256,13 +264,30 @@ func (m *WritableDeviceType) validateSubdeviceRole(formats strfmt.Registry) erro } // value enum - if err := m.validateSubdeviceRoleEnum("subdevice_role", "body", *m.SubdeviceRole); err != nil { + if err := m.validateSubdeviceRoleEnum("subdevice_role", "body", m.SubdeviceRole); err != nil { return err } return nil } +func (m *WritableDeviceType) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *WritableDeviceType) validateUHeight(formats strfmt.Registry) error { if swag.IsZero(m.UHeight) { // not required diff --git a/netbox/models/writable_device_with_config_context.go b/netbox/models/writable_device_with_config_context.go new file mode 100644 index 0000000000000000000000000000000000000000..e4a16e9968a4195fe5fb87cdc5b3db93eff54ca1 --- /dev/null +++ b/netbox/models/writable_device_with_config_context.go @@ -0,0 +1,483 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableDeviceWithConfigContext writable device with config context +// swagger:model WritableDeviceWithConfigContext +type WritableDeviceWithConfigContext struct { + + // Asset tag + // + // A unique tag used to identify this device + // Max Length: 50 + AssetTag *string `json:"asset_tag,omitempty"` + + // Cluster + Cluster *int64 `json:"cluster,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Config context + // Read Only: true + ConfigContext map[string]string `json:"config_context,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Device role + // Required: true + DeviceRole *int64 `json:"device_role"` + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // Rack face + // Enum: [0 1] + Face *int64 `json:"face,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Local context data + LocalContextData *string `json:"local_context_data,omitempty"` + + // Name + // Max Length: 64 + Name *string `json:"name,omitempty"` + + // parent device + ParentDevice *NestedDevice `json:"parent_device,omitempty"` + + // Platform + Platform *int64 `json:"platform,omitempty"` + + // Position (U) + // + // The lowest-numbered unit occupied by the device + // Maximum: 32767 + // Minimum: 1 + Position *int64 `json:"position,omitempty"` + + // Primary ip + // Read Only: true + PrimaryIP string `json:"primary_ip,omitempty"` + + // Primary IPv4 + PrimaryIp4 *int64 `json:"primary_ip4,omitempty"` + + // Primary IPv6 + PrimaryIp6 *int64 `json:"primary_ip6,omitempty"` + + // Rack + Rack *int64 `json:"rack,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Status + // Enum: [1 0 2 3 4 5 6] + Status int64 `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` + + // Tenant + Tenant *int64 `json:"tenant,omitempty"` + + // Vc position + // Maximum: 255 + // Minimum: 0 + VcPosition *int64 `json:"vc_position,omitempty"` + + // Vc priority + // Maximum: 255 + // Minimum: 0 + VcPriority *int64 `json:"vc_priority,omitempty"` + + // Virtual chassis + VirtualChassis *int64 `json:"virtual_chassis,omitempty"` +} + +// Validate validates this writable device with config context +func (m *WritableDeviceWithConfigContext) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeviceRole(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeviceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFace(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParentDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVcPosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVcPriority(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableDeviceWithConfigContext) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(*m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateDeviceRole(formats strfmt.Registry) error { + + if err := validate.Required("device_role", "body", m.DeviceRole); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +var writableDeviceWithConfigContextTypeFacePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,1]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceWithConfigContextTypeFacePropEnum = append(writableDeviceWithConfigContextTypeFacePropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceWithConfigContext) validateFaceEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceWithConfigContextTypeFacePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceWithConfigContext) validateFace(formats strfmt.Registry) error { + + if swag.IsZero(m.Face) { // not required + return nil + } + + // value enum + if err := m.validateFaceEnum("face", "body", *m.Face); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateParentDevice(formats strfmt.Registry) error { + + if swag.IsZero(m.ParentDevice) { // not required + return nil + } + + if m.ParentDevice != nil { + if err := m.ParentDevice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent_device") + } + return err + } + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validatePosition(formats strfmt.Registry) error { + + if swag.IsZero(m.Position) { // not required + return nil + } + + if err := validate.MinimumInt("position", "body", int64(*m.Position), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("position", "body", int64(*m.Position), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +var writableDeviceWithConfigContextTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,0,2,3,4,5,6]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceWithConfigContextTypeStatusPropEnum = append(writableDeviceWithConfigContextTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceWithConfigContext) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceWithConfigContextTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceWithConfigContext) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateVcPosition(formats strfmt.Registry) error { + + if swag.IsZero(m.VcPosition) { // not required + return nil + } + + if err := validate.MinimumInt("vc_position", "body", int64(*m.VcPosition), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vc_position", "body", int64(*m.VcPosition), 255, false); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceWithConfigContext) validateVcPriority(formats strfmt.Registry) error { + + if swag.IsZero(m.VcPriority) { // not required + return nil + } + + if err := validate.MinimumInt("vc_priority", "body", int64(*m.VcPriority), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vc_priority", "body", int64(*m.VcPriority), 255, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableDeviceWithConfigContext) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDeviceWithConfigContext) UnmarshalBinary(b []byte) error { + var res WritableDeviceWithConfigContext + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_export_template.go b/netbox/models/writable_export_template.go new file mode 100644 index 0000000000000000000000000000000000000000..e58627219571ad047c7632c13e99252109f35077 --- /dev/null +++ b/netbox/models/writable_export_template.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableExportTemplate writable export template +// swagger:model WritableExportTemplate +type WritableExportTemplate struct { + + // Content type + // Required: true + ContentType *int64 `json:"content_type"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // File extension + // Max Length: 15 + FileExtension string `json:"file_extension,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Mime type + // Max Length: 50 + MimeType string `json:"mime_type,omitempty"` + + // Name + // Required: true + // Max Length: 100 + // Min Length: 1 + Name *string `json:"name"` + + // Template code + // Required: true + // Min Length: 1 + TemplateCode *string `json:"template_code"` + + // Template language + // Enum: [10 20] + TemplateLanguage int64 `json:"template_language,omitempty"` +} + +// Validate validates this writable export template +func (m *WritableExportTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFileExtension(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMimeType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTemplateCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTemplateLanguage(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableExportTemplate) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("content_type", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *WritableExportTemplate) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 200); err != nil { + return err + } + + return nil +} + +func (m *WritableExportTemplate) validateFileExtension(formats strfmt.Registry) error { + + if swag.IsZero(m.FileExtension) { // not required + return nil + } + + if err := validate.MaxLength("file_extension", "body", string(m.FileExtension), 15); err != nil { + return err + } + + return nil +} + +func (m *WritableExportTemplate) validateMimeType(formats strfmt.Registry) error { + + if swag.IsZero(m.MimeType) { // not required + return nil + } + + if err := validate.MaxLength("mime_type", "body", string(m.MimeType), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableExportTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableExportTemplate) validateTemplateCode(formats strfmt.Registry) error { + + if err := validate.Required("template_code", "body", m.TemplateCode); err != nil { + return err + } + + if err := validate.MinLength("template_code", "body", string(*m.TemplateCode), 1); err != nil { + return err + } + + return nil +} + +var writableExportTemplateTypeTemplateLanguagePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[10,20]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableExportTemplateTypeTemplateLanguagePropEnum = append(writableExportTemplateTypeTemplateLanguagePropEnum, v) + } +} + +// prop value enum +func (m *WritableExportTemplate) validateTemplateLanguageEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableExportTemplateTypeTemplateLanguagePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableExportTemplate) validateTemplateLanguage(formats strfmt.Registry) error { + + if swag.IsZero(m.TemplateLanguage) { // not required + return nil + } + + // value enum + if err := m.validateTemplateLanguageEnum("template_language", "body", m.TemplateLanguage); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableExportTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableExportTemplate) UnmarshalBinary(b []byte) error { + var res WritableExportTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_front_port.go b/netbox/models/writable_front_port.go new file mode 100644 index 0000000000000000000000000000000000000000..1acedc53796a8858e61fadd952ee093b80492ef8 --- /dev/null +++ b/netbox/models/writable_front_port.go @@ -0,0 +1,268 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableFrontPort writable front port +// swagger:model WritableFrontPort +type WritableFrontPort struct { + + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // Rear port + // Required: true + RearPort *int64 `json:"rear_port"` + + // Rear port position + // Maximum: 64 + // Minimum: 1 + RearPortPosition int64 `json:"rear_port_position,omitempty"` + + // tags + Tags []string `json:"tags"` + + // Type + // Required: true + // Enum: [1000 1100 2200 2300 2310 2600 2610 2500 2400 2100 2110 2000] + Type *int64 `json:"type"` +} + +// Validate validates this writable front port +func (m *WritableFrontPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRearPort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRearPortPosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableFrontPort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +func (m *WritableFrontPort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableFrontPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableFrontPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableFrontPort) validateRearPort(formats strfmt.Registry) error { + + if err := validate.Required("rear_port", "body", m.RearPort); err != nil { + return err + } + + return nil +} + +func (m *WritableFrontPort) validateRearPortPosition(formats strfmt.Registry) error { + + if swag.IsZero(m.RearPortPosition) { // not required + return nil + } + + if err := validate.MinimumInt("rear_port_position", "body", int64(m.RearPortPosition), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("rear_port_position", "body", int64(m.RearPortPosition), 64, false); err != nil { + return err + } + + return nil +} + +func (m *WritableFrontPort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +var writableFrontPortTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1000,1100,2200,2300,2310,2600,2610,2500,2400,2100,2110,2000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableFrontPortTypeTypePropEnum = append(writableFrontPortTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableFrontPort) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableFrontPortTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableFrontPort) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableFrontPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableFrontPort) UnmarshalBinary(b []byte) error { + var res WritableFrontPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_front_port_template.go b/netbox/models/writable_front_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..317ffc87ca8eb5f1a929c57813aea9dc90e94db4 --- /dev/null +++ b/netbox/models/writable_front_port_template.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableFrontPortTemplate writable front port template +// swagger:model WritableFrontPortTemplate +type WritableFrontPortTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // Rear port + // Required: true + RearPort *int64 `json:"rear_port"` + + // Rear port position + // Maximum: 64 + // Minimum: 1 + RearPortPosition int64 `json:"rear_port_position,omitempty"` + + // Type + // Required: true + // Enum: [1000 1100 2200 2300 2310 2600 2610 2500 2400 2100 2110 2000] + Type *int64 `json:"type"` +} + +// Validate validates this writable front port template +func (m *WritableFrontPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRearPort(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRearPortPosition(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableFrontPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritableFrontPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableFrontPortTemplate) validateRearPort(formats strfmt.Registry) error { + + if err := validate.Required("rear_port", "body", m.RearPort); err != nil { + return err + } + + return nil +} + +func (m *WritableFrontPortTemplate) validateRearPortPosition(formats strfmt.Registry) error { + + if swag.IsZero(m.RearPortPosition) { // not required + return nil + } + + if err := validate.MinimumInt("rear_port_position", "body", int64(m.RearPortPosition), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("rear_port_position", "body", int64(m.RearPortPosition), 64, false); err != nil { + return err + } + + return nil +} + +var writableFrontPortTemplateTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1000,1100,2200,2300,2310,2600,2610,2500,2400,2100,2110,2000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableFrontPortTemplateTypeTypePropEnum = append(writableFrontPortTemplateTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableFrontPortTemplate) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableFrontPortTemplateTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableFrontPortTemplate) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableFrontPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableFrontPortTemplate) UnmarshalBinary(b []byte) error { + var res WritableFrontPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_graph.go b/netbox/models/writable_graph.go index a9863622f3d9776d07ece460a10f09c9ba7cab7d..3e5f5da28f7c1296ae412ac4814a09d1652a1c29 100644 --- a/netbox/models/writable_graph.go +++ b/netbox/models/writable_graph.go @@ -39,20 +39,24 @@ type WritableGraph struct { // Link URL // Max Length: 200 + // Format: uri Link strfmt.URI `json:"link,omitempty"` // Name // Required: true // Max Length: 100 + // Min Length: 1 Name *string `json:"name"` // Source URL // Required: true // Max Length: 500 + // Min Length: 1 Source *string `json:"source"` // Type // Required: true + // Enum: [100 200 300] Type *int64 `json:"type"` // Weight @@ -66,27 +70,22 @@ func (m *WritableGraph) Validate(formats strfmt.Registry) error { var res []error if err := m.validateLink(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSource(formats); err != nil { - // prop res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateWeight(formats); err != nil { - // prop res = append(res, err) } @@ -119,6 +118,10 @@ func (m *WritableGraph) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { return err } @@ -132,6 +135,10 @@ func (m *WritableGraph) validateSource(formats strfmt.Registry) error { return err } + if err := validate.MinLength("source", "body", string(*m.Source), 1); err != nil { + return err + } + if err := validate.MaxLength("source", "body", string(*m.Source), 500); err != nil { return err } diff --git a/netbox/models/writable_image_attachment.go b/netbox/models/writable_image_attachment.go deleted file mode 100644 index a2b07782d974299fbe370c7d801e9632c0de5ac9..0000000000000000000000000000000000000000 --- a/netbox/models/writable_image_attachment.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WritableImageAttachment writable image attachment -// swagger:model WritableImageAttachment -type WritableImageAttachment struct { - - // Content type - // Required: true - ContentType *string `json:"content_type"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Image - // Required: true - // Read Only: true - Image strfmt.URI `json:"image"` - - // Name - // Max Length: 50 - Name string `json:"name,omitempty"` - - // Object id - // Required: true - // Maximum: 2.147483647e+09 - // Minimum: 0 - ObjectID *int64 `json:"object_id"` -} - -// Validate validates this writable image attachment -func (m *WritableImageAttachment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContentType(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateImage(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateObjectID(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WritableImageAttachment) validateContentType(formats strfmt.Registry) error { - - if err := validate.Required("content_type", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *WritableImageAttachment) validateImage(formats strfmt.Registry) error { - - if err := validate.Required("image", "body", strfmt.URI(m.Image)); err != nil { - return err - } - - if err := validate.FormatOf("image", "body", "uri", m.Image.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WritableImageAttachment) validateName(formats strfmt.Registry) error { - - if swag.IsZero(m.Name) { // not required - return nil - } - - if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil { - return err - } - - return nil -} - -func (m *WritableImageAttachment) validateObjectID(formats strfmt.Registry) error { - - if err := validate.Required("object_id", "body", m.ObjectID); err != nil { - return err - } - - if err := validate.MinimumInt("object_id", "body", int64(*m.ObjectID), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("object_id", "body", int64(*m.ObjectID), 2.147483647e+09, false); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WritableImageAttachment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WritableImageAttachment) UnmarshalBinary(b []byte) error { - var res WritableImageAttachment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/writable_interface.go b/netbox/models/writable_interface.go deleted file mode 100644 index caa972f9edcbc9bcb87a2d0da48627c85f024f6f..0000000000000000000000000000000000000000 --- a/netbox/models/writable_interface.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WritableInterface writable interface -// swagger:model WritableInterface -type WritableInterface struct { - - // Description - // Max Length: 100 - Description string `json:"description,omitempty"` - - // Device - // Required: true - Device *int64 `json:"device"` - - // Enabled - Enabled bool `json:"enabled,omitempty"` - - // Form factor - FormFactor int64 `json:"form_factor,omitempty"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Parent LAG - Lag int64 `json:"lag,omitempty"` - - // MAC Address - MacAddress string `json:"mac_address,omitempty"` - - // OOB Management - // - // This interface is used only for out-of-band management - MgmtOnly bool `json:"mgmt_only,omitempty"` - - // Mode - Mode int64 `json:"mode,omitempty"` - - // MTU - // Maximum: 32767 - // Minimum: 0 - Mtu *int64 `json:"mtu,omitempty"` - - // Name - // Required: true - // Max Length: 64 - Name *string `json:"name"` - - // tagged vlans - // Unique: true - TaggedVlans []int64 `json:"tagged_vlans"` - - // Untagged VLAN - UntaggedVlan int64 `json:"untagged_vlan,omitempty"` -} - -// Validate validates this writable interface -func (m *WritableInterface) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDescription(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateDevice(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateFormFactor(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateMode(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateMtu(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateTaggedVlans(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WritableInterface) validateDescription(formats strfmt.Registry) error { - - if swag.IsZero(m.Description) { // not required - return nil - } - - if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { - return err - } - - return nil -} - -func (m *WritableInterface) validateDevice(formats strfmt.Registry) error { - - if err := validate.Required("device", "body", m.Device); err != nil { - return err - } - - return nil -} - -var writableInterfaceTypeFormFactorPropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[0,200,800,1000,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1500,1510,1520,1550,1600,2600,2610,2620,2630,2640,3010,3020,3040,3080,3160,4000,4010,4040,4050,5000,5050,5100,5150,5200,32767]`), &res); err != nil { - panic(err) - } - for _, v := range res { - writableInterfaceTypeFormFactorPropEnum = append(writableInterfaceTypeFormFactorPropEnum, v) - } -} - -// prop value enum -func (m *WritableInterface) validateFormFactorEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, writableInterfaceTypeFormFactorPropEnum); err != nil { - return err - } - return nil -} - -func (m *WritableInterface) validateFormFactor(formats strfmt.Registry) error { - - if swag.IsZero(m.FormFactor) { // not required - return nil - } - - // value enum - if err := m.validateFormFactorEnum("form_factor", "body", m.FormFactor); err != nil { - return err - } - - return nil -} - -var writableInterfaceTypeModePropEnum []interface{} - -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[100,200,300]`), &res); err != nil { - panic(err) - } - for _, v := range res { - writableInterfaceTypeModePropEnum = append(writableInterfaceTypeModePropEnum, v) - } -} - -// prop value enum -func (m *WritableInterface) validateModeEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, writableInterfaceTypeModePropEnum); err != nil { - return err - } - return nil -} - -func (m *WritableInterface) validateMode(formats strfmt.Registry) error { - - if swag.IsZero(m.Mode) { // not required - return nil - } - - // value enum - if err := m.validateModeEnum("mode", "body", m.Mode); err != nil { - return err - } - - return nil -} - -func (m *WritableInterface) validateMtu(formats strfmt.Registry) error { - - if swag.IsZero(m.Mtu) { // not required - return nil - } - - if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { - return err - } - - return nil -} - -func (m *WritableInterface) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { - return err - } - - return nil -} - -func (m *WritableInterface) validateTaggedVlans(formats strfmt.Registry) error { - - if swag.IsZero(m.TaggedVlans) { // not required - return nil - } - - if err := validate.UniqueItems("tagged_vlans", "body", m.TaggedVlans); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WritableInterface) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WritableInterface) UnmarshalBinary(b []byte) error { - var res WritableInterface - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/writable_interface_connection.go b/netbox/models/writable_interface_connection.go deleted file mode 100644 index c65052008ba4c63b69d6946a32e54d20b4622ce2..0000000000000000000000000000000000000000 --- a/netbox/models/writable_interface_connection.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "encoding/json" - - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WritableInterfaceConnection writable interface connection -// swagger:model WritableInterfaceConnection -type WritableInterfaceConnection struct { - - // Status - ConnectionStatus bool `json:"connection_status,omitempty"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Interface a - // Required: true - InterfaceA *int64 `json:"interface_a"` - - // Interface b - // Required: true - InterfaceB *int64 `json:"interface_b"` -} - -// Validate validates this writable interface connection -func (m *WritableInterfaceConnection) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConnectionStatus(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateInterfaceA(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateInterfaceB(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var writableInterfaceConnectionTypeConnectionStatusPropEnum []interface{} - -func init() { - var res []bool - if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { - panic(err) - } - for _, v := range res { - writableInterfaceConnectionTypeConnectionStatusPropEnum = append(writableInterfaceConnectionTypeConnectionStatusPropEnum, v) - } -} - -// prop value enum -func (m *WritableInterfaceConnection) validateConnectionStatusEnum(path, location string, value bool) error { - if err := validate.Enum(path, location, value, writableInterfaceConnectionTypeConnectionStatusPropEnum); err != nil { - return err - } - return nil -} - -func (m *WritableInterfaceConnection) validateConnectionStatus(formats strfmt.Registry) error { - - if swag.IsZero(m.ConnectionStatus) { // not required - return nil - } - - // value enum - if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { - return err - } - - return nil -} - -func (m *WritableInterfaceConnection) validateInterfaceA(formats strfmt.Registry) error { - - if err := validate.Required("interface_a", "body", m.InterfaceA); err != nil { - return err - } - - return nil -} - -func (m *WritableInterfaceConnection) validateInterfaceB(formats strfmt.Registry) error { - - if err := validate.Required("interface_b", "body", m.InterfaceB); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WritableInterfaceConnection) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WritableInterfaceConnection) UnmarshalBinary(b []byte) error { - var res WritableInterfaceConnection - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/writable_interface_template.go b/netbox/models/writable_interface_template.go index 2471de6daadf472e4ec667295f9f4228da2b02c1..2083366e2713f051a35c96bad636acb2ed0797fb 100644 --- a/netbox/models/writable_interface_template.go +++ b/netbox/models/writable_interface_template.go @@ -38,7 +38,8 @@ type WritableInterfaceTemplate struct { DeviceType *int64 `json:"device_type"` // Form factor - FormFactor int64 `json:"form_factor,omitempty"` + // Read Only: true + FormFactor string `json:"form_factor,omitempty"` // ID // Read Only: true @@ -50,7 +51,12 @@ type WritableInterfaceTemplate struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` + + // Type + // Enum: [0 200 800 1000 1120 1130 1150 1170 1050 1100 1200 1300 1310 1320 1350 1400 1420 1500 1510 1650 1520 1550 1600 1700 1750 2600 2610 2620 2630 2640 2810 2820 2830 6100 6200 6300 6400 6500 6600 6700 3010 3020 3040 3080 3160 3320 3400 4000 4010 4040 4050 5000 5050 5100 5150 5200 5300 5310 5320 5330 32767] + Type int64 `json:"type,omitempty"` } // Validate validates this writable interface template @@ -58,17 +64,14 @@ func (m *WritableInterfaceTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop res = append(res, err) } - if err := m.validateFormFactor(formats); err != nil { - // prop + if err := m.validateName(formats); err != nil { res = append(res, err) } - if err := m.validateName(formats); err != nil { - // prop + if err := m.validateType(formats); err != nil { res = append(res, err) } @@ -87,47 +90,51 @@ func (m *WritableInterfaceTemplate) validateDeviceType(formats strfmt.Registry) return nil } -var writableInterfaceTemplateTypeFormFactorPropEnum []interface{} +func (m *WritableInterfaceTemplate) validateName(formats strfmt.Registry) error { -func init() { - var res []int64 - if err := json.Unmarshal([]byte(`[0,200,800,1000,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1500,1510,1520,1550,1600,2600,2610,2620,2630,2640,3010,3020,3040,3080,3160,4000,4010,4040,4050,5000,5050,5100,5150,5200,32767]`), &res); err != nil { - panic(err) + if err := validate.Required("name", "body", m.Name); err != nil { + return err } - for _, v := range res { - writableInterfaceTemplateTypeFormFactorPropEnum = append(writableInterfaceTemplateTypeFormFactorPropEnum, v) + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err } -} -// prop value enum -func (m *WritableInterfaceTemplate) validateFormFactorEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, writableInterfaceTemplateTypeFormFactorPropEnum); err != nil { + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } + return nil } -func (m *WritableInterfaceTemplate) validateFormFactor(formats strfmt.Registry) error { +var writableInterfaceTemplateTypeTypePropEnum []interface{} - if swag.IsZero(m.FormFactor) { // not required - return nil +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,200,800,1000,1120,1130,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1420,1500,1510,1650,1520,1550,1600,1700,1750,2600,2610,2620,2630,2640,2810,2820,2830,6100,6200,6300,6400,6500,6600,6700,3010,3020,3040,3080,3160,3320,3400,4000,4010,4040,4050,5000,5050,5100,5150,5200,5300,5310,5320,5330,32767]`), &res); err != nil { + panic(err) } + for _, v := range res { + writableInterfaceTemplateTypeTypePropEnum = append(writableInterfaceTemplateTypeTypePropEnum, v) + } +} - // value enum - if err := m.validateFormFactorEnum("form_factor", "body", m.FormFactor); err != nil { +// prop value enum +func (m *WritableInterfaceTemplate) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableInterfaceTemplateTypeTypePropEnum); err != nil { return err } - return nil } -func (m *WritableInterfaceTemplate) validateName(formats strfmt.Registry) error { +func (m *WritableInterfaceTemplate) validateType(formats strfmt.Registry) error { - if err := validate.Required("name", "body", m.Name); err != nil { - return err + if swag.IsZero(m.Type) { // not required + return nil } - if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { return err } diff --git a/netbox/models/writable_inventory_item.go b/netbox/models/writable_inventory_item.go index bf646d64cbd0c50d0bfa5d63dab6b85d376b23be..658925233401c27a0204b369d5de1f9d1d784402 100644 --- a/netbox/models/writable_inventory_item.go +++ b/netbox/models/writable_inventory_item.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -35,7 +37,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,omitempty"` // Description // Max Length: 100 @@ -53,15 +55,16 @@ type WritableInventoryItem struct { ID int64 `json:"id,omitempty"` // Manufacturer - Manufacturer int64 `json:"manufacturer,omitempty"` + Manufacturer *int64 `json:"manufacturer,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Parent - Parent int64 `json:"parent,omitempty"` + Parent *int64 `json:"parent,omitempty"` // Part ID // Max Length: 50 @@ -70,6 +73,9 @@ type WritableInventoryItem struct { // Serial number // Max Length: 50 Serial string `json:"serial,omitempty"` + + // tags + Tags []string `json:"tags"` } // Validate validates this writable inventory item @@ -77,32 +83,30 @@ func (m *WritableInventoryItem) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAssetTag(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDevice(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePartID(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSerial(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -118,7 +122,7 @@ func (m *WritableInventoryItem) validateAssetTag(formats strfmt.Registry) error return nil } - if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + if err := validate.MaxLength("asset_tag", "body", string(*m.AssetTag), 50); err != nil { return err } @@ -153,6 +157,10 @@ func (m *WritableInventoryItem) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -186,6 +194,23 @@ func (m *WritableInventoryItem) validateSerial(formats strfmt.Registry) error { return nil } +func (m *WritableInventoryItem) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableInventoryItem) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_ip_address.go b/netbox/models/writable_ip_address.go index c03f79558ebc47a8a9894461a0ae80c7118bc888..7dd9d20b4d809d679e2b7bc28336c4bae09989ab 100644 --- a/netbox/models/writable_ip_address.go +++ b/netbox/models/writable_ip_address.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -41,6 +42,7 @@ type WritableIPAddress struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -50,37 +52,58 @@ type WritableIPAddress struct { // Max Length: 100 Description string `json:"description,omitempty"` + // DNS Name + // + // Hostname or FQDN (not case-sensitive) + // Max Length: 255 + // Pattern: ^[0-9A-Za-z.-]+$ + DNSName string `json:"dns_name,omitempty"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` // Interface - Interface int64 `json:"interface,omitempty"` + Interface *int64 `json:"interface,omitempty"` // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // NAT (Inside) // // The IP for which this address is the "outside" IP - NatInside int64 `json:"nat_inside,omitempty"` + NatInside *int64 `json:"nat_inside,omitempty"` + + // Nat outside + // Required: true + NatOutside *int64 `json:"nat_outside"` // Role // // The functional role of this IP - Role int64 `json:"role,omitempty"` + // Enum: [10 20 30 40 41 42 43 44] + Role *int64 `json:"role,omitempty"` // Status // // The operational status of this IP + // Enum: [1 2 3 5] Status int64 `json:"status,omitempty"` + // tags + Tags []string `json:"tags"` + // Tenant - Tenant int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant,omitempty"` // VRF - Vrf int64 `json:"vrf,omitempty"` + Vrf *int64 `json:"vrf,omitempty"` } // Validate validates this writable IP address @@ -88,22 +111,38 @@ func (m *WritableIPAddress) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAddress(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateDNSName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNatOutside(formats); err != nil { res = append(res, err) } if err := m.validateRole(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -122,6 +161,19 @@ func (m *WritableIPAddress) validateAddress(formats strfmt.Registry) error { return nil } +func (m *WritableIPAddress) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableIPAddress) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -135,6 +187,45 @@ func (m *WritableIPAddress) validateDescription(formats strfmt.Registry) error { return nil } +func (m *WritableIPAddress) validateDNSName(formats strfmt.Registry) error { + + if swag.IsZero(m.DNSName) { // not required + return nil + } + + if err := validate.MaxLength("dns_name", "body", string(m.DNSName), 255); err != nil { + return err + } + + if err := validate.Pattern("dns_name", "body", string(m.DNSName), `^[0-9A-Za-z.-]+$`); err != nil { + return err + } + + return nil +} + +func (m *WritableIPAddress) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableIPAddress) validateNatOutside(formats strfmt.Registry) error { + + if err := validate.Required("nat_outside", "body", m.NatOutside); err != nil { + return err + } + + return nil +} + var writableIpAddressTypeRolePropEnum []interface{} func init() { @@ -162,7 +253,7 @@ func (m *WritableIPAddress) validateRole(formats strfmt.Registry) error { } // value enum - if err := m.validateRoleEnum("role", "body", m.Role); err != nil { + if err := m.validateRoleEnum("role", "body", *m.Role); err != nil { return err } @@ -203,6 +294,23 @@ func (m *WritableIPAddress) validateStatus(formats strfmt.Registry) error { return nil } +func (m *WritableIPAddress) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableIPAddress) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_platform.go b/netbox/models/writable_platform.go index 1b177843886d1e59639e6d8eceb01484a36b007b..72218a03543513ba9a358ec9db6698595f237636 100644 --- a/netbox/models/writable_platform.go +++ b/netbox/models/writable_platform.go @@ -20,8 +20,6 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( - "encoding/json" - strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,6 +31,10 @@ import ( // swagger:model WritablePlatform type WritablePlatform struct { + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -40,27 +42,35 @@ type WritablePlatform struct { // Manufacturer // // Optionally limit this platform to devices of a certain manufacturer - Manufacturer int64 `json:"manufacturer,omitempty"` + Manufacturer *int64 `json:"manufacturer,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // NAPALM arguments + // + // Additional arguments to pass when initiating the NAPALM driver (JSON format) + NapalmArgs *string `json:"napalm_args,omitempty"` + // NAPALM driver // // The name of the NAPALM driver to use when interacting with devices // Max Length: 50 NapalmDriver string `json:"napalm_driver,omitempty"` - // Legacy RPC client - RPCClient string `json:"rpc_client,omitempty"` - // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` } // Validate validates this writable platform @@ -68,22 +78,14 @@ func (m *WritablePlatform) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateNapalmDriver(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateRPCClient(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -99,6 +101,10 @@ func (m *WritablePlatform) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -119,52 +125,13 @@ func (m *WritablePlatform) validateNapalmDriver(formats strfmt.Registry) error { return nil } -var writablePlatformTypeRPCClientPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["juniper-junos","cisco-ios","opengear"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - writablePlatformTypeRPCClientPropEnum = append(writablePlatformTypeRPCClientPropEnum, v) - } -} - -const ( - // WritablePlatformRPCClientJuniperJunos captures enum value "juniper-junos" - WritablePlatformRPCClientJuniperJunos string = "juniper-junos" - // WritablePlatformRPCClientCiscoIos captures enum value "cisco-ios" - WritablePlatformRPCClientCiscoIos string = "cisco-ios" - // WritablePlatformRPCClientOpengear captures enum value "opengear" - WritablePlatformRPCClientOpengear string = "opengear" -) - -// prop value enum -func (m *WritablePlatform) validateRPCClientEnum(path, location string, value string) error { - if err := validate.Enum(path, location, value, writablePlatformTypeRPCClientPropEnum); err != nil { - return err - } - return nil -} - -func (m *WritablePlatform) validateRPCClient(formats strfmt.Registry) error { - - if swag.IsZero(m.RPCClient) { // not required - return nil - } +func (m *WritablePlatform) validateSlug(formats strfmt.Registry) error { - // value enum - if err := m.validateRPCClientEnum("rpc_client", "body", m.RPCClient); err != nil { + if err := validate.Required("slug", "body", m.Slug); err != nil { return err } - return nil -} - -func (m *WritablePlatform) validateSlug(formats strfmt.Registry) error { - - if err := validate.Required("slug", "body", m.Slug); err != nil { + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { return err } diff --git a/netbox/models/writable_power_feed.go b/netbox/models/writable_power_feed.go new file mode 100644 index 0000000000000000000000000000000000000000..6f47a5807bfc28699ae5005e52fa4fed2aedb634 --- /dev/null +++ b/netbox/models/writable_power_feed.go @@ -0,0 +1,437 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritablePowerFeed writable power feed +// swagger:model WritablePowerFeed +type WritablePowerFeed struct { + + // Amperage + // Maximum: 32767 + // Minimum: 1 + Amperage int64 `json:"amperage,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Last updated + // Read Only: true + // Format: date-time + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + + // Max utilization + // + // Maximum permissible draw (percentage) + // Maximum: 100 + // Minimum: 1 + MaxUtilization int64 `json:"max_utilization,omitempty"` + + // Name + // Required: true + // Max Length: 50 + // Min Length: 1 + Name *string `json:"name"` + + // Phase + // Enum: [1 3] + Phase int64 `json:"phase,omitempty"` + + // Power panel + // Required: true + PowerPanel *int64 `json:"power_panel"` + + // Rack + Rack *int64 `json:"rack,omitempty"` + + // Status + // Enum: [1 0 2 4] + Status int64 `json:"status,omitempty"` + + // Supply + // Enum: [1 2] + Supply int64 `json:"supply,omitempty"` + + // tags + Tags []string `json:"tags"` + + // Type + // Enum: [1 2] + Type int64 `json:"type,omitempty"` + + // Voltage + // Maximum: 32767 + // Minimum: 1 + Voltage int64 `json:"voltage,omitempty"` +} + +// Validate validates this writable power feed +func (m *WritablePowerFeed) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAmperage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMaxUtilization(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhase(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePowerPanel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSupply(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVoltage(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerFeed) validateAmperage(formats strfmt.Registry) error { + + if swag.IsZero(m.Amperage) { // not required + return nil + } + + if err := validate.MinimumInt("amperage", "body", int64(m.Amperage), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("amperage", "body", int64(m.Amperage), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerFeed) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerFeed) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerFeed) validateMaxUtilization(formats strfmt.Registry) error { + + if swag.IsZero(m.MaxUtilization) { // not required + return nil + } + + if err := validate.MinimumInt("max_utilization", "body", int64(m.MaxUtilization), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("max_utilization", "body", int64(m.MaxUtilization), 100, false); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerFeed) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +var writablePowerFeedTypePhasePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerFeedTypePhasePropEnum = append(writablePowerFeedTypePhasePropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerFeed) validatePhaseEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writablePowerFeedTypePhasePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerFeed) validatePhase(formats strfmt.Registry) error { + + if swag.IsZero(m.Phase) { // not required + return nil + } + + // value enum + if err := m.validatePhaseEnum("phase", "body", m.Phase); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerFeed) validatePowerPanel(formats strfmt.Registry) error { + + if err := validate.Required("power_panel", "body", m.PowerPanel); err != nil { + return err + } + + return nil +} + +var writablePowerFeedTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,0,2,4]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerFeedTypeStatusPropEnum = append(writablePowerFeedTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerFeed) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writablePowerFeedTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerFeed) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +var writablePowerFeedTypeSupplyPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerFeedTypeSupplyPropEnum = append(writablePowerFeedTypeSupplyPropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerFeed) validateSupplyEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writablePowerFeedTypeSupplyPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerFeed) validateSupply(formats strfmt.Registry) error { + + if swag.IsZero(m.Supply) { // not required + return nil + } + + // value enum + if err := m.validateSupplyEnum("supply", "body", m.Supply); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerFeed) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +var writablePowerFeedTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerFeedTypeTypePropEnum = append(writablePowerFeedTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerFeed) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writablePowerFeedTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerFeed) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerFeed) validateVoltage(formats strfmt.Registry) error { + + if swag.IsZero(m.Voltage) { // not required + return nil + } + + if err := validate.MinimumInt("voltage", "body", int64(m.Voltage), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("voltage", "body", int64(m.Voltage), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerFeed) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerFeed) UnmarshalBinary(b []byte) error { + var res WritablePowerFeed + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_power_outlet.go b/netbox/models/writable_power_outlet.go index 81896b13d71c8e3a8631d1526e509f7d50f93830..0462ac7cebd0ff6f76de3dab24716ac0170ead4d 100644 --- a/netbox/models/writable_power_outlet.go +++ b/netbox/models/writable_power_outlet.go @@ -20,6 +20,9 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -31,10 +34,39 @@ import ( // swagger:model WritablePowerOutlet type WritablePowerOutlet struct { + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + + // Connection status + // Enum: [false true] + ConnectionStatus bool `json:"connection_status,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // Device // Required: true Device *int64 `json:"device"` + // Feed leg + // + // Phase (for three-phase feeds) + // Enum: [1 2 3] + FeedLeg *int64 `json:"feed_leg,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -42,20 +74,45 @@ type WritablePowerOutlet struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // Power port + PowerPort *int64 `json:"power_port,omitempty"` + + // tags + Tags []string `json:"tags"` } // Validate validates this writable power outlet func (m *WritablePowerOutlet) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateConnectionStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateFeedLeg(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -65,6 +122,71 @@ func (m *WritablePowerOutlet) Validate(formats strfmt.Registry) error { return nil } +func (m *WritablePowerOutlet) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +var writablePowerOutletTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerOutletTypeConnectionStatusPropEnum = append(writablePowerOutletTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerOutlet) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writablePowerOutletTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerOutlet) validateConnectionStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.ConnectionStatus) { // not required + return nil + } + + // value enum + if err := m.validateConnectionStatusEnum("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerOutlet) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *WritablePowerOutlet) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -74,12 +196,50 @@ func (m *WritablePowerOutlet) validateDevice(formats strfmt.Registry) error { return nil } +var writablePowerOutletTypeFeedLegPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerOutletTypeFeedLegPropEnum = append(writablePowerOutletTypeFeedLegPropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerOutlet) validateFeedLegEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writablePowerOutletTypeFeedLegPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerOutlet) validateFeedLeg(formats strfmt.Registry) error { + + if swag.IsZero(m.FeedLeg) { // not required + return nil + } + + // value enum + if err := m.validateFeedLegEnum("feed_leg", "body", *m.FeedLeg); err != nil { + return err + } + + return nil +} + func (m *WritablePowerOutlet) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -87,6 +247,23 @@ func (m *WritablePowerOutlet) validateName(formats strfmt.Registry) error { return nil } +func (m *WritablePowerOutlet) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritablePowerOutlet) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_power_outlet_template.go b/netbox/models/writable_power_outlet_template.go index 7ac79b76d5a0a0c15aeafdaa994f03e6bebe5885..c3b3f9db0afa24783e22acb7e0b92fe3d828bfd7 100644 --- a/netbox/models/writable_power_outlet_template.go +++ b/netbox/models/writable_power_outlet_template.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -35,6 +37,12 @@ type WritablePowerOutletTemplate struct { // Required: true DeviceType *int64 `json:"device_type"` + // Feed leg + // + // Phase (for three-phase feeds) + // Enum: [1 2 3] + FeedLeg *int64 `json:"feed_leg,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -42,7 +50,11 @@ type WritablePowerOutletTemplate struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + + // power port + PowerPort *PowerPortTemplate `json:"power_port,omitempty"` } // Validate validates this writable power outlet template @@ -50,12 +62,18 @@ func (m *WritablePowerOutletTemplate) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDeviceType(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateFeedLeg(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validatePowerPort(formats); err != nil { res = append(res, err) } @@ -74,12 +92,50 @@ func (m *WritablePowerOutletTemplate) validateDeviceType(formats strfmt.Registry return nil } +var writablePowerOutletTemplateTypeFeedLegPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerOutletTemplateTypeFeedLegPropEnum = append(writablePowerOutletTemplateTypeFeedLegPropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerOutletTemplate) validateFeedLegEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writablePowerOutletTemplateTypeFeedLegPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerOutletTemplate) validateFeedLeg(formats strfmt.Registry) error { + + if swag.IsZero(m.FeedLeg) { // not required + return nil + } + + // value enum + if err := m.validateFeedLegEnum("feed_leg", "body", *m.FeedLeg); err != nil { + return err + } + + return nil +} + func (m *WritablePowerOutletTemplate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -87,6 +143,24 @@ func (m *WritablePowerOutletTemplate) validateName(formats strfmt.Registry) erro return nil } +func (m *WritablePowerOutletTemplate) validatePowerPort(formats strfmt.Registry) error { + + if swag.IsZero(m.PowerPort) { // not required + return nil + } + + if m.PowerPort != nil { + if err := m.PowerPort.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("power_port") + } + return err + } + } + + return nil +} + // MarshalBinary interface implementation func (m *WritablePowerOutletTemplate) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_power_panel.go b/netbox/models/writable_power_panel.go new file mode 100644 index 0000000000000000000000000000000000000000..5387f87047439427745843cbf988529d907e51e8 --- /dev/null +++ b/netbox/models/writable_power_panel.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritablePowerPanel writable power panel +// swagger:model WritablePowerPanel +type WritablePowerPanel struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + // Min Length: 1 + Name *string `json:"name"` + + // Powerfeed count + // Read Only: true + PowerfeedCount int64 `json:"powerfeed_count,omitempty"` + + // Rack group + RackGroup *int64 `json:"rack_group,omitempty"` + + // Site + // Required: true + Site *int64 `json:"site"` +} + +// Validate validates this writable power panel +func (m *WritablePowerPanel) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerPanel) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerPanel) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerPanel) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerPanel) UnmarshalBinary(b []byte) error { + var res WritablePowerPanel + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_power_port.go b/netbox/models/writable_power_port.go index 1e1ae5935dc8ee479792e53ae492d40772c39c8a..4315dc7c62054469e3bc48ecee3c34644ff1fc87 100644 --- a/netbox/models/writable_power_port.go +++ b/netbox/models/writable_power_port.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -33,9 +34,36 @@ import ( // swagger:model WritablePowerPort type WritablePowerPort struct { + // Allocated draw + // + // Allocated current draw (watts) + // Maximum: 32767 + // Minimum: 1 + AllocatedDraw *int64 `json:"allocated_draw,omitempty"` + + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Connected endpoint + // + // + // Return the appropriate serializer for the type of connected object. + // + // Read Only: true + ConnectedEndpoint map[string]string `json:"connected_endpoint,omitempty"` + + // Connected endpoint type + // Read Only: true + ConnectedEndpointType string `json:"connected_endpoint_type,omitempty"` + // Connection status + // Enum: [false true] ConnectionStatus bool `json:"connection_status,omitempty"` + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // Device // Required: true Device *int64 `json:"device"` @@ -44,31 +72,56 @@ type WritablePowerPort struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Maximum draw + // + // Maximum current draw (watts) + // Maximum: 32767 + // Minimum: 1 + MaximumDraw *int64 `json:"maximum_draw,omitempty"` + // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` - // Power outlet - PowerOutlet int64 `json:"power_outlet,omitempty"` + // tags + Tags []string `json:"tags"` } // Validate validates this writable power port func (m *WritablePowerPort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAllocatedDraw(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + if err := m.validateConnectionStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { res = append(res, err) } if err := m.validateDevice(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateMaximumDraw(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -78,6 +131,41 @@ func (m *WritablePowerPort) Validate(formats strfmt.Registry) error { return nil } +func (m *WritablePowerPort) validateAllocatedDraw(formats strfmt.Registry) error { + + if swag.IsZero(m.AllocatedDraw) { // not required + return nil + } + + if err := validate.MinimumInt("allocated_draw", "body", int64(*m.AllocatedDraw), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("allocated_draw", "body", int64(*m.AllocatedDraw), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerPort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + var writablePowerPortTypeConnectionStatusPropEnum []interface{} func init() { @@ -112,6 +200,19 @@ func (m *WritablePowerPort) validateConnectionStatus(formats strfmt.Registry) er return nil } +func (m *WritablePowerPort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + func (m *WritablePowerPort) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -121,12 +222,33 @@ func (m *WritablePowerPort) validateDevice(formats strfmt.Registry) error { return nil } +func (m *WritablePowerPort) validateMaximumDraw(formats strfmt.Registry) error { + + if swag.IsZero(m.MaximumDraw) { // not required + return nil + } + + if err := validate.MinimumInt("maximum_draw", "body", int64(*m.MaximumDraw), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("maximum_draw", "body", int64(*m.MaximumDraw), 32767, false); err != nil { + return err + } + + return nil +} + func (m *WritablePowerPort) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -134,6 +256,23 @@ func (m *WritablePowerPort) validateName(formats strfmt.Registry) error { return nil } +func (m *WritablePowerPort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritablePowerPort) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_power_port_template.go b/netbox/models/writable_power_port_template.go index 511a27728c62f067c0d067f59315501d534219df..a79c39ef514b76a552a138828a554802be87a032 100644 --- a/netbox/models/writable_power_port_template.go +++ b/netbox/models/writable_power_port_template.go @@ -31,6 +31,13 @@ import ( // swagger:model WritablePowerPortTemplate type WritablePowerPortTemplate struct { + // Allocated draw + // + // Allocated current draw (watts) + // Maximum: 32767 + // Minimum: 1 + AllocatedDraw *int64 `json:"allocated_draw,omitempty"` + // Device type // Required: true DeviceType *int64 `json:"device_type"` @@ -39,9 +46,17 @@ type WritablePowerPortTemplate struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Maximum draw + // + // Maximum current draw (watts) + // Maximum: 32767 + // Minimum: 1 + MaximumDraw *int64 `json:"maximum_draw,omitempty"` + // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` } @@ -49,13 +64,19 @@ type WritablePowerPortTemplate struct { func (m *WritablePowerPortTemplate) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAllocatedDraw(formats); err != nil { + res = append(res, err) + } + if err := m.validateDeviceType(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateMaximumDraw(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } @@ -65,6 +86,23 @@ func (m *WritablePowerPortTemplate) Validate(formats strfmt.Registry) error { return nil } +func (m *WritablePowerPortTemplate) validateAllocatedDraw(formats strfmt.Registry) error { + + if swag.IsZero(m.AllocatedDraw) { // not required + return nil + } + + if err := validate.MinimumInt("allocated_draw", "body", int64(*m.AllocatedDraw), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("allocated_draw", "body", int64(*m.AllocatedDraw), 32767, false); err != nil { + return err + } + + return nil +} + func (m *WritablePowerPortTemplate) validateDeviceType(formats strfmt.Registry) error { if err := validate.Required("device_type", "body", m.DeviceType); err != nil { @@ -74,12 +112,33 @@ func (m *WritablePowerPortTemplate) validateDeviceType(formats strfmt.Registry) return nil } +func (m *WritablePowerPortTemplate) validateMaximumDraw(formats strfmt.Registry) error { + + if swag.IsZero(m.MaximumDraw) { // not required + return nil + } + + if err := validate.MinimumInt("maximum_draw", "body", int64(*m.MaximumDraw), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("maximum_draw", "body", int64(*m.MaximumDraw), 32767, false); err != nil { + return err + } + + return nil +} + func (m *WritablePowerPortTemplate) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } diff --git a/netbox/models/writable_prefix.go b/netbox/models/writable_prefix.go index a777ca6de4498c08c540c9bf1badc5e18eb21bbd..81ce97a6ae2759684ca551c05cff5e3a1ad2ff72 100644 --- a/netbox/models/writable_prefix.go +++ b/netbox/models/writable_prefix.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -35,6 +36,7 @@ type WritablePrefix struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -44,6 +46,10 @@ type WritablePrefix struct { // Max Length: 100 Description string `json:"description,omitempty"` + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + // ID // Read Only: true ID int64 `json:"id,omitempty"` @@ -55,6 +61,7 @@ type WritablePrefix struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Prefix @@ -66,42 +73,55 @@ type WritablePrefix struct { // Role // // The primary function of this prefix - Role int64 `json:"role,omitempty"` + Role *int64 `json:"role,omitempty"` // Site - Site int64 `json:"site,omitempty"` + Site *int64 `json:"site,omitempty"` // Status // // Operational status of this prefix + // Enum: [0 1 2 3] Status int64 `json:"status,omitempty"` + // tags + Tags []string `json:"tags"` + // Tenant - Tenant int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant,omitempty"` // VLAN - Vlan int64 `json:"vlan,omitempty"` + Vlan *int64 `json:"vlan,omitempty"` // VRF - Vrf int64 `json:"vrf,omitempty"` + Vrf *int64 `json:"vrf,omitempty"` } // Validate validates this writable prefix func (m *WritablePrefix) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validatePrefix(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -111,6 +131,19 @@ func (m *WritablePrefix) Validate(formats strfmt.Registry) error { return nil } +func (m *WritablePrefix) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritablePrefix) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -124,6 +157,19 @@ func (m *WritablePrefix) validateDescription(formats strfmt.Registry) error { return nil } +func (m *WritablePrefix) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritablePrefix) validatePrefix(formats strfmt.Registry) error { if err := validate.Required("prefix", "body", m.Prefix); err != nil { @@ -167,6 +213,23 @@ func (m *WritablePrefix) validateStatus(formats strfmt.Registry) error { return nil } +func (m *WritablePrefix) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritablePrefix) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_provider.go b/netbox/models/writable_provider.go deleted file mode 100644 index 65af6ed195239bfad47c3ae526e05a2848217500..0000000000000000000000000000000000000000 --- a/netbox/models/writable_provider.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Copyright 2018 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package models - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - strfmt "github.com/go-openapi/strfmt" - - "github.com/go-openapi/errors" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WritableProvider writable provider -// swagger:model WritableProvider -type WritableProvider struct { - - // Account number - // Max Length: 30 - Account string `json:"account,omitempty"` - - // Admin contact - AdminContact string `json:"admin_contact,omitempty"` - - // ASN - // Maximum: 4.294967295e+09 - // Minimum: 1 - Asn int64 `json:"asn,omitempty"` - - // Comments - Comments string `json:"comments,omitempty"` - - // Created - // Read Only: true - Created strfmt.Date `json:"created,omitempty"` - - // Custom fields - CustomFields interface{} `json:"custom_fields,omitempty"` - - // ID - // Read Only: true - ID int64 `json:"id,omitempty"` - - // Last updated - // Read Only: true - LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` - - // Name - // Required: true - // Max Length: 50 - Name *string `json:"name"` - - // NOC contact - NocContact string `json:"noc_contact,omitempty"` - - // Portal - // Max Length: 200 - PortalURL strfmt.URI `json:"portal_url,omitempty"` - - // Slug - // Required: true - // Max Length: 50 - // Pattern: ^[-a-zA-Z0-9_]+$ - Slug *string `json:"slug"` -} - -// Validate validates this writable provider -func (m *WritableProvider) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAccount(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateAsn(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validatePortalURL(formats); err != nil { - // prop - res = append(res, err) - } - - if err := m.validateSlug(formats); err != nil { - // prop - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WritableProvider) validateAccount(formats strfmt.Registry) error { - - if swag.IsZero(m.Account) { // not required - return nil - } - - if err := validate.MaxLength("account", "body", string(m.Account), 30); err != nil { - return err - } - - return nil -} - -func (m *WritableProvider) validateAsn(formats strfmt.Registry) error { - - if swag.IsZero(m.Asn) { // not required - return nil - } - - if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { - return err - } - - if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { - return err - } - - return nil -} - -func (m *WritableProvider) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { - return err - } - - return nil -} - -func (m *WritableProvider) validatePortalURL(formats strfmt.Registry) error { - - if swag.IsZero(m.PortalURL) { // not required - return nil - } - - if err := validate.MaxLength("portal_url", "body", string(m.PortalURL), 200); err != nil { - return err - } - - if err := validate.FormatOf("portal_url", "body", "uri", m.PortalURL.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WritableProvider) validateSlug(formats strfmt.Registry) error { - - if err := validate.Required("slug", "body", m.Slug); err != nil { - return err - } - - if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { - return err - } - - if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WritableProvider) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WritableProvider) UnmarshalBinary(b []byte) error { - var res WritableProvider - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/netbox/models/writable_rack.go b/netbox/models/writable_rack.go index b3a8d28836261b93a68c8af20ccedd5cc65db02f..ad4d10bd7688ad56f04e809e121f40bffb3fda90 100644 --- a/netbox/models/writable_rack.go +++ b/netbox/models/writable_rack.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -33,11 +34,18 @@ import ( // swagger:model WritableRack type WritableRack struct { + // Asset tag + // + // A unique tag used to identify this rack + // Max Length: 50 + AssetTag *string `json:"asset_tag,omitempty"` + // Comments Comments string `json:"comments,omitempty"` // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -48,12 +56,20 @@ type WritableRack struct { // Units are numbered top-to-bottom DescUnits bool `json:"desc_units,omitempty"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + // Facility ID // Max Length: 50 - FacilityID string `json:"facility_id,omitempty"` + FacilityID *string `json:"facility_id,omitempty"` // Group - Group int64 `json:"group,omitempty"` + Group *int64 `json:"group,omitempty"` // ID // Read Only: true @@ -61,15 +77,35 @@ type WritableRack struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Outer depth + // Maximum: 32767 + // Minimum: 0 + OuterDepth *int64 `json:"outer_depth,omitempty"` + + // Outer unit + // Enum: [1000 2000] + OuterUnit *int64 `json:"outer_unit,omitempty"` + + // Outer width + // Maximum: 32767 + // Minimum: 0 + OuterWidth *int64 `json:"outer_width,omitempty"` + + // Powerfeed count + // Read Only: true + PowerfeedCount int64 `json:"powerfeed_count,omitempty"` + // Role - Role int64 `json:"role,omitempty"` + Role *int64 `json:"role,omitempty"` // Serial number // Max Length: 50 @@ -79,11 +115,19 @@ type WritableRack struct { // Required: true Site *int64 `json:"site"` + // Status + // Enum: [3 2 0 1 4] + Status int64 `json:"status,omitempty"` + + // tags + Tags []string `json:"tags"` + // Tenant - Tenant int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant,omitempty"` // Type - Type int64 `json:"type,omitempty"` + // Enum: [100 200 300 1000 1100] + Type *int64 `json:"type,omitempty"` // Height (U) // Maximum: 100 @@ -93,6 +137,7 @@ type WritableRack struct { // Width // // Rail-to-rail width + // Enum: [19 23] Width int64 `json:"width,omitempty"` } @@ -100,38 +145,63 @@ type WritableRack struct { func (m *WritableRack) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateAssetTag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateFacilityID(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateOuterDepth(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOuterUnit(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOuterWidth(formats); err != nil { res = append(res, err) } if err := m.validateSerial(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateType(formats); err != nil { - // prop res = append(res, err) } if err := m.validateUHeight(formats); err != nil { - // prop res = append(res, err) } if err := m.validateWidth(formats); err != nil { - // prop res = append(res, err) } @@ -141,13 +211,52 @@ func (m *WritableRack) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableRack) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(*m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableRack) validateFacilityID(formats strfmt.Registry) error { if swag.IsZero(m.FacilityID) { // not required return nil } - if err := validate.MaxLength("facility_id", "body", string(m.FacilityID), 50); err != nil { + if err := validate.MaxLength("facility_id", "body", string(*m.FacilityID), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { return err } @@ -160,6 +269,10 @@ func (m *WritableRack) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -167,6 +280,74 @@ func (m *WritableRack) validateName(formats strfmt.Registry) error { return nil } +func (m *WritableRack) validateOuterDepth(formats strfmt.Registry) error { + + if swag.IsZero(m.OuterDepth) { // not required + return nil + } + + if err := validate.MinimumInt("outer_depth", "body", int64(*m.OuterDepth), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("outer_depth", "body", int64(*m.OuterDepth), 32767, false); err != nil { + return err + } + + return nil +} + +var writableRackTypeOuterUnitPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1000,2000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableRackTypeOuterUnitPropEnum = append(writableRackTypeOuterUnitPropEnum, v) + } +} + +// prop value enum +func (m *WritableRack) validateOuterUnitEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableRackTypeOuterUnitPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableRack) validateOuterUnit(formats strfmt.Registry) error { + + if swag.IsZero(m.OuterUnit) { // not required + return nil + } + + // value enum + if err := m.validateOuterUnitEnum("outer_unit", "body", *m.OuterUnit); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateOuterWidth(formats strfmt.Registry) error { + + if swag.IsZero(m.OuterWidth) { // not required + return nil + } + + if err := validate.MinimumInt("outer_width", "body", int64(*m.OuterWidth), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("outer_width", "body", int64(*m.OuterWidth), 32767, false); err != nil { + return err + } + + return nil +} + func (m *WritableRack) validateSerial(formats strfmt.Registry) error { if swag.IsZero(m.Serial) { // not required @@ -189,6 +370,57 @@ func (m *WritableRack) validateSite(formats strfmt.Registry) error { return nil } +var writableRackTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[3,2,0,1,4]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableRackTypeStatusPropEnum = append(writableRackTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableRack) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableRackTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableRack) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + var writableRackTypeTypePropEnum []interface{} func init() { @@ -216,7 +448,7 @@ func (m *WritableRack) validateType(formats strfmt.Registry) error { } // value enum - if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { return err } diff --git a/netbox/models/writable_rack_group.go b/netbox/models/writable_rack_group.go index e409f494d8e2e20463ed24a832c75ac700526612..38766c287a04864f9731f3ca3a3595ff217fe20f 100644 --- a/netbox/models/writable_rack_group.go +++ b/netbox/models/writable_rack_group.go @@ -38,8 +38,13 @@ type WritableRackGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + // Site // Required: true Site *int64 `json:"site"` @@ -47,6 +52,7 @@ type WritableRackGroup struct { // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -56,17 +62,14 @@ func (m *WritableRackGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSite(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -82,6 +85,10 @@ func (m *WritableRackGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -104,6 +111,10 @@ func (m *WritableRackGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/writable_rack_reservation.go b/netbox/models/writable_rack_reservation.go index e66d7c3843439e041e65918193880e8fc93462a9..6963d2a318ca32ac7ad238a5596e901985eb293f 100644 --- a/netbox/models/writable_rack_reservation.go +++ b/netbox/models/writable_rack_reservation.go @@ -33,9 +33,15 @@ import ( // swagger:model WritableRackReservation type WritableRackReservation struct { + // Created + // Read Only: true + // Format: date + Created strfmt.Date `json:"created,omitempty"` + // Description // Required: true // Max Length: 100 + // Min Length: 1 Description *string `json:"description"` // ID @@ -46,6 +52,9 @@ type WritableRackReservation struct { // Required: true Rack *int64 `json:"rack"` + // Tenant + Tenant *int64 `json:"tenant,omitempty"` + // units // Required: true Units []*int64 `json:"units"` @@ -59,23 +68,23 @@ type WritableRackReservation struct { func (m *WritableRackReservation) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRack(formats); err != nil { - // prop res = append(res, err) } if err := m.validateUnits(formats); err != nil { - // prop res = append(res, err) } if err := m.validateUser(formats); err != nil { - // prop res = append(res, err) } @@ -85,12 +94,29 @@ func (m *WritableRackReservation) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableRackReservation) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableRackReservation) validateDescription(formats strfmt.Registry) error { if err := validate.Required("description", "body", m.Description); err != nil { return err } + if err := validate.MinLength("description", "body", string(*m.Description), 1); err != nil { + return err + } + if err := validate.MaxLength("description", "body", string(*m.Description), 100); err != nil { return err } @@ -114,7 +140,6 @@ func (m *WritableRackReservation) validateUnits(formats strfmt.Registry) error { } for i := 0; i < len(m.Units); i++ { - if swag.IsZero(m.Units[i]) { // not required continue } diff --git a/netbox/models/writable_rear_port.go b/netbox/models/writable_rear_port.go new file mode 100644 index 0000000000000000000000000000000000000000..a1802d1fc10d7e0adf1cab20d90bacc4fd0e8985 --- /dev/null +++ b/netbox/models/writable_rear_port.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableRearPort writable rear port +// swagger:model WritableRearPort +type WritableRearPort struct { + + // cable + Cable *NestedCable `json:"cable,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // Positions + // Maximum: 64 + // Minimum: 1 + Positions int64 `json:"positions,omitempty"` + + // tags + Tags []string `json:"tags"` + + // Type + // Required: true + // Enum: [1000 1100 2200 2300 2310 2600 2610 2500 2400 2100 2110 2000] + Type *int64 `json:"type"` +} + +// Validate validates this writable rear port +func (m *WritableRearPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCable(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePositions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRearPort) validateCable(formats strfmt.Registry) error { + + if swag.IsZero(m.Cable) { // not required + return nil + } + + if m.Cable != nil { + if err := m.Cable.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cable") + } + return err + } + } + + return nil +} + +func (m *WritableRearPort) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableRearPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableRearPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableRearPort) validatePositions(formats strfmt.Registry) error { + + if swag.IsZero(m.Positions) { // not required + return nil + } + + if err := validate.MinimumInt("positions", "body", int64(m.Positions), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("positions", "body", int64(m.Positions), 64, false); err != nil { + return err + } + + return nil +} + +func (m *WritableRearPort) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +var writableRearPortTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1000,1100,2200,2300,2310,2600,2610,2500,2400,2100,2110,2000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableRearPortTypeTypePropEnum = append(writableRearPortTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableRearPort) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableRearPortTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableRearPort) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableRearPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRearPort) UnmarshalBinary(b []byte) error { + var res WritableRearPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_rear_port_template.go b/netbox/models/writable_rear_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..38857bc456454adfa2e4ded917b5ed7f30320461 --- /dev/null +++ b/netbox/models/writable_rear_port_template.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableRearPortTemplate writable rear port template +// swagger:model WritableRearPortTemplate +type WritableRearPortTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // Positions + // Maximum: 64 + // Minimum: 1 + Positions int64 `json:"positions,omitempty"` + + // Type + // Required: true + // Enum: [1000 1100 2200 2300 2310 2600 2610 2500 2400 2100 2110 2000] + Type *int64 `json:"type"` +} + +// Validate validates this writable rear port template +func (m *WritableRearPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePositions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRearPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritableRearPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableRearPortTemplate) validatePositions(formats strfmt.Registry) error { + + if swag.IsZero(m.Positions) { // not required + return nil + } + + if err := validate.MinimumInt("positions", "body", int64(m.Positions), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("positions", "body", int64(m.Positions), 64, false); err != nil { + return err + } + + return nil +} + +var writableRearPortTemplateTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1000,1100,2200,2300,2310,2600,2610,2500,2400,2100,2110,2000]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableRearPortTemplateTypeTypePropEnum = append(writableRearPortTemplateTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableRearPortTemplate) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableRearPortTemplateTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableRearPortTemplate) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableRearPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRearPortTemplate) UnmarshalBinary(b []byte) error { + var res WritableRearPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_region.go b/netbox/models/writable_region.go index 95819864fb8726eb7a26081c35b1140502b99a82..877f75124bad7be8f9bc2ee8d10e8a80d7b1606b 100644 --- a/netbox/models/writable_region.go +++ b/netbox/models/writable_region.go @@ -38,14 +38,20 @@ type WritableRegion struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Parent - Parent int64 `json:"parent,omitempty"` + Parent *int64 `json:"parent,omitempty"` + + // Site count + // Read Only: true + SiteCount int64 `json:"site_count,omitempty"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -55,12 +61,10 @@ func (m *WritableRegion) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -76,6 +80,10 @@ func (m *WritableRegion) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -89,6 +97,10 @@ func (m *WritableRegion) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/writable_secret.go b/netbox/models/writable_secret.go index e06864915514ff92bf0e1ceebecbe6ef509ef54d..62760a9d3804dafb4261fb83650e95dca3e063ef 100644 --- a/netbox/models/writable_secret.go +++ b/netbox/models/writable_secret.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,14 +35,19 @@ type WritableSecret struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + // Device // Required: true Device *int64 `json:"device"` // Hash // Read Only: true + // Min Length: 1 Hash string `json:"hash,omitempty"` // ID @@ -49,6 +56,7 @@ type WritableSecret struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name @@ -57,34 +65,50 @@ type WritableSecret struct { // Plaintext // Required: true + // Min Length: 1 Plaintext *string `json:"plaintext"` // Role // Required: true Role *int64 `json:"role"` + + // tags + Tags []string `json:"tags"` } // Validate validates this writable secret func (m *WritableSecret) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateHash(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePlaintext(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRole(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -94,6 +118,19 @@ func (m *WritableSecret) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableSecret) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableSecret) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -103,6 +140,32 @@ func (m *WritableSecret) validateDevice(formats strfmt.Registry) error { return nil } +func (m *WritableSecret) validateHash(formats strfmt.Registry) error { + + if swag.IsZero(m.Hash) { // not required + return nil + } + + if err := validate.MinLength("hash", "body", string(m.Hash), 1); err != nil { + return err + } + + return nil +} + +func (m *WritableSecret) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableSecret) validateName(formats strfmt.Registry) error { if swag.IsZero(m.Name) { // not required @@ -122,6 +185,10 @@ func (m *WritableSecret) validatePlaintext(formats strfmt.Registry) error { return err } + if err := validate.MinLength("plaintext", "body", string(*m.Plaintext), 1); err != nil { + return err + } + return nil } @@ -134,6 +201,23 @@ func (m *WritableSecret) validateRole(formats strfmt.Registry) error { return nil } +func (m *WritableSecret) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableSecret) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_service.go b/netbox/models/writable_service.go index fc4ea39cf34742a042272b6fa18c6045e80efbdf..779e720ddfcef4d46854b1342bede4e7c44f05d2 100644 --- a/netbox/models/writable_service.go +++ b/netbox/models/writable_service.go @@ -35,14 +35,18 @@ type WritableService struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + // Description // Max Length: 100 Description string `json:"description,omitempty"` // Device - Device int64 `json:"device,omitempty"` + Device *int64 `json:"device,omitempty"` // ID // Read Only: true @@ -54,11 +58,13 @@ type WritableService struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 30 + // Min Length: 1 Name *string `json:"name"` // Port number @@ -69,38 +75,42 @@ type WritableService struct { // Protocol // Required: true + // Enum: [6 17] Protocol *int64 `json:"protocol"` // Virtual machine - VirtualMachine int64 `json:"virtual_machine,omitempty"` + VirtualMachine *int64 `json:"virtual_machine,omitempty"` } // Validate validates this writable service func (m *WritableService) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateIpaddresses(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePort(formats); err != nil { - // prop res = append(res, err) } if err := m.validateProtocol(formats); err != nil { - // prop res = append(res, err) } @@ -110,6 +120,19 @@ func (m *WritableService) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableService) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableService) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -136,12 +159,29 @@ func (m *WritableService) validateIpaddresses(formats strfmt.Registry) error { return nil } +func (m *WritableService) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableService) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { return err } diff --git a/netbox/models/writable_site.go b/netbox/models/writable_site.go index 85e1c5fd2961ac92d59a85d29f3d0eb6ba4dc05b..59fe0214580bc9a2d56c1a5ee0285bf090d68329 100644 --- a/netbox/models/writable_site.go +++ b/netbox/models/writable_site.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -36,13 +37,18 @@ type WritableSite struct { // ASN // Maximum: 4.294967295e+09 // Minimum: 1 - Asn int64 `json:"asn,omitempty"` + Asn *int64 `json:"asn,omitempty"` + + // Circuit count + // Read Only: true + CircuitCount int64 `json:"circuit_count,omitempty"` // Comments Comments string `json:"comments,omitempty"` // Contact E-mail // Max Length: 254 + // Format: email ContactEmail strfmt.Email `json:"contact_email,omitempty"` // Contact name @@ -55,6 +61,7 @@ type WritableSite struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -64,6 +71,10 @@ type WritableSite struct { // Max Length: 100 Description string `json:"description,omitempty"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // Facility // Max Length: 50 Facility string `json:"facility,omitempty"` @@ -74,19 +85,35 @@ type WritableSite struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Latitude + Latitude *string `json:"latitude,omitempty"` + + // Longitude + Longitude *string `json:"longitude,omitempty"` + // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Physical address // Max Length: 200 PhysicalAddress string `json:"physical_address,omitempty"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + // Region - Region int64 `json:"region,omitempty"` + Region *int64 `json:"region,omitempty"` // Shipping address // Max Length: 200 @@ -95,17 +122,30 @@ type WritableSite struct { // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` // Status + // Enum: [1 2 4] Status int64 `json:"status,omitempty"` + // tags + Tags []string `json:"tags"` + // Tenant - Tenant int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant,omitempty"` // Time zone TimeZone string `json:"time_zone,omitempty"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` + + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` } // Validate validates this writable site @@ -113,57 +153,58 @@ func (m *WritableSite) Validate(formats strfmt.Registry) error { var res []error if err := m.validateAsn(formats); err != nil { - // prop res = append(res, err) } if err := m.validateContactEmail(formats); err != nil { - // prop res = append(res, err) } if err := m.validateContactName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateContactPhone(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateFacility(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validatePhysicalAddress(formats); err != nil { - // prop res = append(res, err) } if err := m.validateShippingAddress(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -179,11 +220,11 @@ func (m *WritableSite) validateAsn(formats strfmt.Registry) error { return nil } - if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + if err := validate.MinimumInt("asn", "body", int64(*m.Asn), 1, false); err != nil { return err } - if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + if err := validate.MaximumInt("asn", "body", int64(*m.Asn), 4.294967295e+09, false); err != nil { return err } @@ -233,6 +274,19 @@ func (m *WritableSite) validateContactPhone(formats strfmt.Registry) error { return nil } +func (m *WritableSite) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableSite) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -259,12 +313,29 @@ func (m *WritableSite) validateFacility(formats strfmt.Registry) error { return nil } +func (m *WritableSite) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableSite) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -304,6 +375,10 @@ func (m *WritableSite) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -349,6 +424,23 @@ func (m *WritableSite) validateStatus(formats strfmt.Registry) error { return nil } +func (m *WritableSite) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableSite) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_tenant.go b/netbox/models/writable_tenant.go index f430ea526af1bca2577291f70fca6a361e431cf8..bc483e232f572fe8fd727ca0bb10c85680e99474 100644 --- a/netbox/models/writable_tenant.go +++ b/netbox/models/writable_tenant.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -31,11 +33,16 @@ import ( // swagger:model WritableTenant type WritableTenant struct { + // Circuit count + // Read Only: true + CircuitCount int64 `json:"circuit_count,omitempty"` + // Comments Comments string `json:"comments,omitempty"` // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -47,45 +54,92 @@ type WritableTenant struct { // Max Length: 100 Description string `json:"description,omitempty"` + // Device count + // Read Only: true + DeviceCount int64 `json:"device_count,omitempty"` + // Group - Group int64 `json:"group,omitempty"` + Group *int64 `json:"group,omitempty"` // ID // Read Only: true ID int64 `json:"id,omitempty"` + // Ipaddress count + // Read Only: true + IpaddressCount int64 `json:"ipaddress_count,omitempty"` + // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 30 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + + // Rack count + // Read Only: true + RackCount int64 `json:"rack_count,omitempty"` + + // Site count + // Read Only: true + SiteCount int64 `json:"site_count,omitempty"` + // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + + // tags + Tags []string `json:"tags"` + + // Virtualmachine count + // Read Only: true + VirtualmachineCount int64 `json:"virtualmachine_count,omitempty"` + + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` + + // Vrf count + // Read Only: true + VrfCount int64 `json:"vrf_count,omitempty"` } // Validate validates this writable tenant func (m *WritableTenant) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -95,6 +149,19 @@ func (m *WritableTenant) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableTenant) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableTenant) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -108,12 +175,29 @@ func (m *WritableTenant) validateDescription(formats strfmt.Registry) error { return nil } +func (m *WritableTenant) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableTenant) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { return err } @@ -127,6 +211,10 @@ func (m *WritableTenant) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } @@ -138,6 +226,23 @@ func (m *WritableTenant) validateSlug(formats strfmt.Registry) error { return nil } +func (m *WritableTenant) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableTenant) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_topology_map.go b/netbox/models/writable_topology_map.go index c78e654fde1efbe55890352201cc50f3131d54af..b308d83506609ab8e590277d35f234d9827e4b82 100644 --- a/netbox/models/writable_topology_map.go +++ b/netbox/models/writable_topology_map.go @@ -39,6 +39,7 @@ type WritableTopologyMap struct { // // Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined. // Required: true + // Min Length: 1 DevicePatterns *string `json:"device_patterns"` // ID @@ -48,14 +49,16 @@ type WritableTopologyMap struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Site - Site int64 `json:"site,omitempty"` + Site *int64 `json:"site,omitempty"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` } @@ -65,22 +68,18 @@ func (m *WritableTopologyMap) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDescription(formats); err != nil { - // prop res = append(res, err) } if err := m.validateDevicePatterns(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -109,6 +108,10 @@ func (m *WritableTopologyMap) validateDevicePatterns(formats strfmt.Registry) er return err } + if err := validate.MinLength("device_patterns", "body", string(*m.DevicePatterns), 1); err != nil { + return err + } + return nil } @@ -118,6 +121,10 @@ func (m *WritableTopologyMap) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -131,6 +138,10 @@ func (m *WritableTopologyMap) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/writable_vlan.go b/netbox/models/writable_v_l_a_n.go similarity index 72% rename from netbox/models/writable_vlan.go rename to netbox/models/writable_v_l_a_n.go index 9a0feabcdcbff04bbab6cc747dbb8b66b7c90dc6..41e306b40775ba870e284b697c99b0d1324c6b03 100644 --- a/netbox/models/writable_vlan.go +++ b/netbox/models/writable_v_l_a_n.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -35,6 +36,7 @@ type WritableVLAN struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -44,8 +46,12 @@ type WritableVLAN struct { // Max Length: 100 Description string `json:"description,omitempty"` + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + // Group - Group int64 `json:"group,omitempty"` + Group *int64 `json:"group,omitempty"` // ID // Read Only: true @@ -53,24 +59,34 @@ type WritableVLAN struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + // Role - Role int64 `json:"role,omitempty"` + Role *int64 `json:"role,omitempty"` // Site - Site int64 `json:"site,omitempty"` + Site *int64 `json:"site,omitempty"` // Status + // Enum: [1 2 3] Status int64 `json:"status,omitempty"` + // tags + Tags []string `json:"tags"` + // Tenant - Tenant int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant,omitempty"` // ID // Required: true @@ -83,23 +99,31 @@ type WritableVLAN struct { func (m *WritableVLAN) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateVid(formats); err != nil { - // prop res = append(res, err) } @@ -109,6 +133,19 @@ func (m *WritableVLAN) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableVLAN) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableVLAN) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -122,12 +159,29 @@ func (m *WritableVLAN) validateDescription(formats strfmt.Registry) error { return nil } +func (m *WritableVLAN) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableVLAN) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -169,6 +223,23 @@ func (m *WritableVLAN) validateStatus(formats strfmt.Registry) error { return nil } +func (m *WritableVLAN) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + func (m *WritableVLAN) validateVid(formats strfmt.Registry) error { if err := validate.Required("vid", "body", m.Vid); err != nil { diff --git a/netbox/models/writable_vlangroup.go b/netbox/models/writable_v_l_a_n_group.go similarity index 88% rename from netbox/models/writable_vlangroup.go rename to netbox/models/writable_v_l_a_n_group.go index 1e55728c840b1a4d7b9ace2b425fccf33d5c1898..f83a1611599ad656e696da662a6198be7db168d3 100644 --- a/netbox/models/writable_vlangroup.go +++ b/netbox/models/writable_v_l_a_n_group.go @@ -38,16 +38,22 @@ type WritableVLANGroup struct { // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` // Site - Site int64 `json:"site,omitempty"` + Site *int64 `json:"site,omitempty"` // Slug // Required: true // Max Length: 50 + // Min Length: 1 // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + + // Vlan count + // Read Only: true + VlanCount int64 `json:"vlan_count,omitempty"` } // Validate validates this writable v l a n group @@ -55,12 +61,10 @@ func (m *WritableVLANGroup) Validate(formats strfmt.Registry) error { var res []error if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateSlug(formats); err != nil { - // prop res = append(res, err) } @@ -76,6 +80,10 @@ func (m *WritableVLANGroup) validateName(formats strfmt.Registry) error { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -89,6 +97,10 @@ func (m *WritableVLANGroup) validateSlug(formats strfmt.Registry) error { return err } + if err := validate.MinLength("slug", "body", string(*m.Slug), 1); err != nil { + return err + } + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { return err } diff --git a/netbox/models/writable_vrf.go b/netbox/models/writable_v_r_f.go similarity index 65% rename from netbox/models/writable_vrf.go rename to netbox/models/writable_v_r_f.go index 546f47e5307c7edf3dd971f1ad1ab93b9fb85361..1b51db6f8a5bcfd7b6796748ae3e7c1aeb4c4ded 100644 --- a/netbox/models/writable_vrf.go +++ b/netbox/models/writable_v_r_f.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -33,6 +35,7 @@ type WritableVRF struct { // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -42,6 +45,10 @@ type WritableVRF struct { // Max Length: 100 Description string `json:"description,omitempty"` + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + // Enforce unique space // // Prevent duplicate prefixes/IP addresses within this VRF @@ -51,40 +58,61 @@ type WritableVRF struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Ipaddress count + // Read Only: true + IpaddressCount int64 `json:"ipaddress_count,omitempty"` + // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` // Name // Required: true // Max Length: 50 + // Min Length: 1 Name *string `json:"name"` + // Prefix count + // Read Only: true + PrefixCount int64 `json:"prefix_count,omitempty"` + // Route distinguisher - // Required: true // Max Length: 21 - Rd *string `json:"rd"` + Rd *string `json:"rd,omitempty"` + + // tags + Tags []string `json:"tags"` // Tenant - Tenant int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant,omitempty"` } // Validate validates this writable v r f func (m *WritableVRF) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCreated(formats); err != nil { + res = append(res, err) + } + if err := m.validateDescription(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateRd(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -94,6 +122,19 @@ func (m *WritableVRF) Validate(formats strfmt.Registry) error { return nil } +func (m *WritableVRF) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableVRF) validateDescription(formats strfmt.Registry) error { if swag.IsZero(m.Description) { // not required @@ -107,12 +148,29 @@ func (m *WritableVRF) validateDescription(formats strfmt.Registry) error { return nil } +func (m *WritableVRF) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + func (m *WritableVRF) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { return err } @@ -122,8 +180,8 @@ func (m *WritableVRF) validateName(formats strfmt.Registry) error { func (m *WritableVRF) validateRd(formats strfmt.Registry) error { - if err := validate.Required("rd", "body", m.Rd); err != nil { - return err + if swag.IsZero(m.Rd) { // not required + return nil } if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { @@ -133,6 +191,23 @@ func (m *WritableVRF) validateRd(formats strfmt.Registry) error { return nil } +func (m *WritableVRF) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableVRF) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_virtual_chassis.go b/netbox/models/writable_virtual_chassis.go index e20436172e5595e7fc4b0e00a5e0c5ef047d9a70..6581198b7f120f730caa243c38240594d19f4459 100644 --- a/netbox/models/writable_virtual_chassis.go +++ b/netbox/models/writable_virtual_chassis.go @@ -20,6 +20,8 @@ package models // Editing this file might prove futile when you re-run the swagger generate command import ( + "strconv" + strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" @@ -42,6 +44,13 @@ type WritableVirtualChassis struct { // Master // Required: true Master *int64 `json:"master"` + + // Member count + // Read Only: true + MemberCount int64 `json:"member_count,omitempty"` + + // tags + Tags []string `json:"tags"` } // Validate validates this writable virtual chassis @@ -49,12 +58,14 @@ func (m *WritableVirtualChassis) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDomain(formats); err != nil { - // prop res = append(res, err) } if err := m.validateMaster(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } @@ -86,6 +97,23 @@ func (m *WritableVirtualChassis) validateMaster(formats strfmt.Registry) error { return nil } +func (m *WritableVirtualChassis) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + // MarshalBinary interface implementation func (m *WritableVirtualChassis) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/writable_virtual_machine_interface.go b/netbox/models/writable_virtual_machine_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..f016b695086a5a371b3474ad5e2f3de97a1178fe --- /dev/null +++ b/netbox/models/writable_virtual_machine_interface.go @@ -0,0 +1,283 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Copyright 2018 The go-netbox Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "encoding/json" + "strconv" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/go-openapi/errors" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WritableVirtualMachineInterface writable virtual machine interface +// swagger:model WritableVirtualMachineInterface +type WritableVirtualMachineInterface struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // MAC Address + MacAddress *string `json:"mac_address,omitempty"` + + // Mode + // Enum: [100 200 300] + Mode *int64 `json:"mode,omitempty"` + + // MTU + // Maximum: 65536 + // Minimum: 1 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + // Min Length: 1 + Name *string `json:"name"` + + // tagged vlans + // Unique: true + TaggedVlans []int64 `json:"tagged_vlans"` + + // tags + Tags []string `json:"tags"` + + // Type + // Enum: [0 200 800 1000 1120 1130 1150 1170 1050 1100 1200 1300 1310 1320 1350 1400 1420 1500 1510 1650 1520 1550 1600 1700 1750 2600 2610 2620 2630 2640 2810 2820 2830 6100 6200 6300 6400 6500 6600 6700 3010 3020 3040 3080 3160 3320 3400 4000 4010 4040 4050 5000 5050 5100 5150 5200 5300 5310 5320 5330 32767] + Type int64 `json:"type,omitempty"` + + // Untagged VLAN + UntaggedVlan *int64 `json:"untagged_vlan,omitempty"` + + // Virtual machine + VirtualMachine *int64 `json:"virtual_machine,omitempty"` +} + +// Validate validates this writable virtual machine interface +func (m *WritableVirtualMachineInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTaggedVlans(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVirtualMachineInterface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +var writableVirtualMachineInterfaceTypeModePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[100,200,300]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableVirtualMachineInterfaceTypeModePropEnum = append(writableVirtualMachineInterfaceTypeModePropEnum, v) + } +} + +// prop value enum +func (m *WritableVirtualMachineInterface) validateModeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableVirtualMachineInterfaceTypeModePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableVirtualMachineInterface) validateMode(formats strfmt.Registry) error { + + if swag.IsZero(m.Mode) { // not required + return nil + } + + // value enum + if err := m.validateModeEnum("mode", "body", *m.Mode); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachineInterface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 65536, false); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachineInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachineInterface) validateTaggedVlans(formats strfmt.Registry) error { + + if swag.IsZero(m.TaggedVlans) { // not required + return nil + } + + if err := validate.UniqueItems("tagged_vlans", "body", m.TaggedVlans); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachineInterface) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +var writableVirtualMachineInterfaceTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,200,800,1000,1120,1130,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1420,1500,1510,1650,1520,1550,1600,1700,1750,2600,2610,2620,2630,2640,2810,2820,2830,6100,6200,6300,6400,6500,6600,6700,3010,3020,3040,3080,3160,3320,3400,4000,4010,4040,4050,5000,5050,5100,5150,5200,5300,5310,5320,5330,32767]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableVirtualMachineInterfaceTypeTypePropEnum = append(writableVirtualMachineInterfaceTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableVirtualMachineInterface) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableVirtualMachineInterfaceTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableVirtualMachineInterface) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVirtualMachineInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVirtualMachineInterface) UnmarshalBinary(b []byte) error { + var res WritableVirtualMachineInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_virtual_machine.go b/netbox/models/writable_virtual_machine_with_config_context.go similarity index 55% rename from netbox/models/writable_virtual_machine.go rename to netbox/models/writable_virtual_machine_with_config_context.go index 4ba7fe767675b7d79b0b874e538b539b436489c2..a3fe8ade6af5dc674d2529b075463dd172e6d378 100644 --- a/netbox/models/writable_virtual_machine.go +++ b/netbox/models/writable_virtual_machine_with_config_context.go @@ -21,6 +21,7 @@ package models import ( "encoding/json" + "strconv" strfmt "github.com/go-openapi/strfmt" @@ -29,9 +30,9 @@ import ( "github.com/go-openapi/validate" ) -// WritableVirtualMachine writable virtual machine -// swagger:model WritableVirtualMachine -type WritableVirtualMachine struct { +// WritableVirtualMachineWithConfigContext writable virtual machine with config context +// swagger:model WritableVirtualMachineWithConfigContext +type WritableVirtualMachineWithConfigContext struct { // Cluster // Required: true @@ -40,8 +41,13 @@ type WritableVirtualMachine struct { // Comments Comments string `json:"comments,omitempty"` + // Config context + // Read Only: true + ConfigContext map[string]string `json:"config_context,omitempty"` + // Created // Read Only: true + // Format: date Created strfmt.Date `json:"created,omitempty"` // Custom fields @@ -58,8 +64,12 @@ type WritableVirtualMachine struct { // Last updated // Read Only: true + // Format: date-time LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Local context data + LocalContextData *string `json:"local_context_data,omitempty"` + // Memory (MB) // Maximum: 2.147483647e+09 // Minimum: 0 @@ -68,25 +78,38 @@ type WritableVirtualMachine struct { // Name // Required: true // Max Length: 64 + // Min Length: 1 Name *string `json:"name"` // Platform - Platform int64 `json:"platform,omitempty"` + Platform *int64 `json:"platform,omitempty"` + + // Primary ip + // Read Only: true + PrimaryIP string `json:"primary_ip,omitempty"` // Primary IPv4 - PrimaryIp4 int64 `json:"primary_ip4,omitempty"` + PrimaryIp4 *int64 `json:"primary_ip4,omitempty"` // Primary IPv6 - PrimaryIp6 int64 `json:"primary_ip6,omitempty"` + PrimaryIp6 *int64 `json:"primary_ip6,omitempty"` // Role - Role int64 `json:"role,omitempty"` + Role *int64 `json:"role,omitempty"` + + // Site + // Read Only: true + Site string `json:"site,omitempty"` // Status + // Enum: [1 0 3] Status int64 `json:"status,omitempty"` + // tags + Tags []string `json:"tags"` + // Tenant - Tenant int64 `json:"tenant,omitempty"` + Tenant *int64 `json:"tenant,omitempty"` // VCPUs // Maximum: 32767 @@ -94,37 +117,43 @@ type WritableVirtualMachine struct { Vcpus *int64 `json:"vcpus,omitempty"` } -// Validate validates this writable virtual machine -func (m *WritableVirtualMachine) Validate(formats strfmt.Registry) error { +// Validate validates this writable virtual machine with config context +func (m *WritableVirtualMachineWithConfigContext) Validate(formats strfmt.Registry) error { var res []error if err := m.validateCluster(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateCreated(formats); err != nil { res = append(res, err) } if err := m.validateDisk(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateLastUpdated(formats); err != nil { res = append(res, err) } if err := m.validateMemory(formats); err != nil { - // prop res = append(res, err) } if err := m.validateName(formats); err != nil { - // prop res = append(res, err) } if err := m.validateStatus(formats); err != nil { - // prop + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { res = append(res, err) } if err := m.validateVcpus(formats); err != nil { - // prop res = append(res, err) } @@ -134,7 +163,7 @@ func (m *WritableVirtualMachine) Validate(formats strfmt.Registry) error { return nil } -func (m *WritableVirtualMachine) validateCluster(formats strfmt.Registry) error { +func (m *WritableVirtualMachineWithConfigContext) validateCluster(formats strfmt.Registry) error { if err := validate.Required("cluster", "body", m.Cluster); err != nil { return err @@ -143,7 +172,20 @@ func (m *WritableVirtualMachine) validateCluster(formats strfmt.Registry) error return nil } -func (m *WritableVirtualMachine) validateDisk(formats strfmt.Registry) error { +func (m *WritableVirtualMachineWithConfigContext) validateCreated(formats strfmt.Registry) error { + + if swag.IsZero(m.Created) { // not required + return nil + } + + if err := validate.FormatOf("created", "body", "date", m.Created.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachineWithConfigContext) validateDisk(formats strfmt.Registry) error { if swag.IsZero(m.Disk) { // not required return nil @@ -160,7 +202,20 @@ func (m *WritableVirtualMachine) validateDisk(formats strfmt.Registry) error { return nil } -func (m *WritableVirtualMachine) validateMemory(formats strfmt.Registry) error { +func (m *WritableVirtualMachineWithConfigContext) validateLastUpdated(formats strfmt.Registry) error { + + if swag.IsZero(m.LastUpdated) { // not required + return nil + } + + if err := validate.FormatOf("last_updated", "body", "date-time", m.LastUpdated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachineWithConfigContext) validateMemory(formats strfmt.Registry) error { if swag.IsZero(m.Memory) { // not required return nil @@ -177,12 +232,16 @@ func (m *WritableVirtualMachine) validateMemory(formats strfmt.Registry) error { return nil } -func (m *WritableVirtualMachine) validateName(formats strfmt.Registry) error { +func (m *WritableVirtualMachineWithConfigContext) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { return err } + if err := validate.MinLength("name", "body", string(*m.Name), 1); err != nil { + return err + } + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { return err } @@ -190,7 +249,7 @@ func (m *WritableVirtualMachine) validateName(formats strfmt.Registry) error { return nil } -var writableVirtualMachineTypeStatusPropEnum []interface{} +var writableVirtualMachineWithConfigContextTypeStatusPropEnum []interface{} func init() { var res []int64 @@ -198,19 +257,19 @@ func init() { panic(err) } for _, v := range res { - writableVirtualMachineTypeStatusPropEnum = append(writableVirtualMachineTypeStatusPropEnum, v) + writableVirtualMachineWithConfigContextTypeStatusPropEnum = append(writableVirtualMachineWithConfigContextTypeStatusPropEnum, v) } } // prop value enum -func (m *WritableVirtualMachine) validateStatusEnum(path, location string, value int64) error { - if err := validate.Enum(path, location, value, writableVirtualMachineTypeStatusPropEnum); err != nil { +func (m *WritableVirtualMachineWithConfigContext) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableVirtualMachineWithConfigContextTypeStatusPropEnum); err != nil { return err } return nil } -func (m *WritableVirtualMachine) validateStatus(formats strfmt.Registry) error { +func (m *WritableVirtualMachineWithConfigContext) validateStatus(formats strfmt.Registry) error { if swag.IsZero(m.Status) { // not required return nil @@ -224,7 +283,24 @@ func (m *WritableVirtualMachine) validateStatus(formats strfmt.Registry) error { return nil } -func (m *WritableVirtualMachine) validateVcpus(formats strfmt.Registry) error { +func (m *WritableVirtualMachineWithConfigContext) validateTags(formats strfmt.Registry) error { + + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + + if err := validate.MinLength("tags"+"."+strconv.Itoa(i), "body", string(m.Tags[i]), 1); err != nil { + return err + } + + } + + return nil +} + +func (m *WritableVirtualMachineWithConfigContext) validateVcpus(formats strfmt.Registry) error { if swag.IsZero(m.Vcpus) { // not required return nil @@ -242,7 +318,7 @@ func (m *WritableVirtualMachine) validateVcpus(formats strfmt.Registry) error { } // MarshalBinary interface implementation -func (m *WritableVirtualMachine) MarshalBinary() ([]byte, error) { +func (m *WritableVirtualMachineWithConfigContext) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } @@ -250,8 +326,8 @@ func (m *WritableVirtualMachine) MarshalBinary() ([]byte, error) { } // UnmarshalBinary interface implementation -func (m *WritableVirtualMachine) UnmarshalBinary(b []byte) error { - var res WritableVirtualMachine +func (m *WritableVirtualMachineWithConfigContext) UnmarshalBinary(b []byte) error { + var res WritableVirtualMachineWithConfigContext if err := swag.ReadJSON(b, &res); err != nil { return err } diff --git a/swagger.json b/swagger.json index a38cecf25537ef98797134e9c897445896cddcc7..fd3c6a8de97e2565683974b39f5a477f96bd1422 100644 --- a/swagger.json +++ b/swagger.json @@ -10,7 +10,7 @@ "license": { "name": "Apache v2 License" }, - "version": "2.3" + "version": "2.6" }, "host": "localhost:8000", "schemes": [ @@ -24,13 +24,15 @@ "application/json" ], "securityDefinitions": { - "basic": { - "type": "basic" + "Bearer": { + "in": "header", + "name": "Authorization", + "type": "apiKey" } }, "security": [ { - "basic": [] + "Bearer": [] } ], "paths": { @@ -76,7 +78,7 @@ "/circuits/circuit-terminations/": { "get": { "operationId": "circuits_circuit-terminations_list", - "description": "", + "description": "Call to super to allow for caching", "parameters": [ { "name": "term_side", @@ -90,14 +92,14 @@ "in": "query", "description": "", "required": false, - "type": "number" + "type": "string" }, { "name": "upstream_speed", "in": "query", "description": "", "required": false, - "type": "number" + "type": "string" }, { "name": "xconnect_id", @@ -203,7 +205,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableCircuitTermination" + "$ref": "#/definitions/CircuitTermination" } } }, @@ -216,7 +218,7 @@ "/circuits/circuit-terminations/{id}/": { "get": { "operationId": "circuits_circuit-terminations_read", - "description": "", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { @@ -247,7 +249,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableCircuitTermination" + "$ref": "#/definitions/CircuitTermination" } } }, @@ -272,7 +274,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableCircuitTermination" + "$ref": "#/definitions/CircuitTermination" } } }, @@ -306,8 +308,15 @@ "/circuits/circuit-types/": { "get": { "operationId": "circuits_circuit-types_list", - "description": "", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -322,6 +331,13 @@ "required": false, "type": "string" }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -404,7 +420,7 @@ "/circuits/circuit-types/{id}/": { "get": { "operationId": "circuits_circuit-types_read", - "description": "", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { @@ -494,7 +510,7 @@ "/circuits/circuits/": { "get": { "operationId": "circuits_circuits_list", - "description": "", + "description": "Call to super to allow for caching", "parameters": [ { "name": "cid", @@ -515,66 +531,80 @@ "in": "query", "description": "", "required": false, - "type": "number" + "type": "string" }, { - "name": "id__in", + "name": "tenant_group_id", "in": "query", - "description": "Multiple values may be separated by commas.", + "description": "", "required": false, "type": "string" }, { - "name": "q", + "name": "tenant_group", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "provider_id", + "name": "tenant_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "provider", + "name": "tenant", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "type_id", + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "type", + "name": "provider_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "status", + "name": "provider", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant_id", + "name": "type_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant", + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", "in": "query", "description": "", "required": false, @@ -594,6 +624,13 @@ "required": false, "type": "string" }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -663,7 +700,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableCircuit" + "$ref": "#/definitions/Circuit" } } }, @@ -676,7 +713,7 @@ "/circuits/circuits/{id}/": { "get": { "operationId": "circuits_circuits_read", - "description": "", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { @@ -707,7 +744,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableCircuit" + "$ref": "#/definitions/Circuit" } } }, @@ -732,7 +769,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableCircuit" + "$ref": "#/definitions/Circuit" } } }, @@ -766,7 +803,7 @@ "/circuits/providers/": { "get": { "operationId": "circuits_providers_list", - "description": "", + "description": "Call to super to allow for caching", "parameters": [ { "name": "name", @@ -787,7 +824,7 @@ "in": "query", "description": "", "required": false, - "type": "number" + "type": "string" }, { "name": "account", @@ -824,6 +861,13 @@ "required": false, "type": "string" }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -885,7 +929,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableProvider" + "$ref": "#/definitions/Provider" } } ], @@ -893,7 +937,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableProvider" + "$ref": "#/definitions/Provider" } } }, @@ -906,7 +950,7 @@ "/circuits/providers/{id}/": { "get": { "operationId": "circuits_providers_read", - "description": "", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { @@ -929,7 +973,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableProvider" + "$ref": "#/definitions/Provider" } } ], @@ -937,7 +981,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableProvider" + "$ref": "#/definitions/Provider" } } }, @@ -954,7 +998,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableProvider" + "$ref": "#/definitions/Provider" } } ], @@ -962,7 +1006,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableProvider" + "$ref": "#/definitions/Provider" } } }, @@ -1059,141 +1103,76 @@ } ] }, - "/dcim/connected-device/": { + "/dcim/cables/": { "get": { - "operationId": "dcim_connected-device_list", - "description": "This endpoint allows a user to determine what device (if any) is connected to a given peer device and peer\ninterface. This is useful in a situation where a device boots with no configuration, but can detect its neighbors\nvia a protocol such as LLDP. Two query parameters must be included in the request:\n\n* `peer-device`: The name of the peer device\n* `peer-interface`: The name of the peer interface", + "operationId": "dcim_cables_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "peer-device", + "name": "id", "in": "query", - "description": "The name of the peer device", - "required": true, + "description": "", + "required": false, "type": "string" }, { - "name": "peer-interface", + "name": "label", "in": "query", - "description": "The name of the peer interface", - "required": true, - "type": "string" - } - ], - "responses": { - "200": { "description": "", - "schema": { - "$ref": "#/definitions/Device" - } - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [] - }, - "/dcim/console-connections/": { - "get": { - "operationId": "dcim_console-connections_list", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "name", + "name": "length", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "connection_status", + "name": "length_unit", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "type", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "limit", + "name": "status", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "color", "in": "query", - "description": "The initial index from which to return the results.", - "required": false, - "type": "integer" - } - ], - "responses": { - "200": { "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "next": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "previous": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/ConsolePort" - } - } - } - } - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [] - }, - "/dcim/console-port-templates/": { - "get": { - "operationId": "dcim_console-port-templates_list", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "name", + "name": "device", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "devicetype_id", + "name": "device_id", "in": "query", "description": "", "required": false, @@ -1240,7 +1219,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/ConsolePortTemplate" + "$ref": "#/definitions/Cable" } } } @@ -1252,7 +1231,7 @@ ] }, "post": { - "operationId": "dcim_console-port-templates_create", + "operationId": "dcim_cables_create", "description": "", "parameters": [ { @@ -1260,7 +1239,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsolePortTemplate" + "$ref": "#/definitions/WritableCable" } } ], @@ -1268,7 +1247,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsolePortTemplate" + "$ref": "#/definitions/Cable" } } }, @@ -1278,16 +1257,16 @@ }, "parameters": [] }, - "/dcim/console-port-templates/{id}/": { + "/dcim/cables/{id}/": { "get": { - "operationId": "dcim_console-port-templates_read", - "description": "", + "operationId": "dcim_cables_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/ConsolePortTemplate" + "$ref": "#/definitions/Cable" } } }, @@ -1296,7 +1275,7 @@ ] }, "put": { - "operationId": "dcim_console-port-templates_update", + "operationId": "dcim_cables_update", "description": "", "parameters": [ { @@ -1304,7 +1283,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsolePortTemplate" + "$ref": "#/definitions/WritableCable" } } ], @@ -1312,7 +1291,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsolePortTemplate" + "$ref": "#/definitions/Cable" } } }, @@ -1321,7 +1300,7 @@ ] }, "patch": { - "operationId": "dcim_console-port-templates_partial_update", + "operationId": "dcim_cables_partial_update", "description": "", "parameters": [ { @@ -1329,7 +1308,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsolePortTemplate" + "$ref": "#/definitions/WritableCable" } } ], @@ -1337,7 +1316,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsolePortTemplate" + "$ref": "#/definitions/Cable" } } }, @@ -1346,7 +1325,7 @@ ] }, "delete": { - "operationId": "dcim_console-port-templates_delete", + "operationId": "dcim_cables_delete", "description": "", "parameters": [], "responses": { @@ -1362,15 +1341,49 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this console port template.", + "description": "A unique integer value identifying this cable.", "required": true, "type": "integer" } ] }, - "/dcim/console-ports/": { + "/dcim/connected-device/": { "get": { - "operationId": "dcim_console-ports_list", + "operationId": "dcim_connected-device_list", + "description": "This endpoint allows a user to determine what device (if any) is connected to a given peer device and peer\ninterface. This is useful in a situation where a device boots with no configuration, but can detect its neighbors\nvia a protocol such as LLDP. Two query parameters must be included in the request:\n\n* `peer_device`: The name of the peer device\n* `peer_interface`: The name of the peer interface", + "parameters": [ + { + "name": "peer_device", + "in": "query", + "description": "The name of the peer device", + "required": true, + "type": "string" + }, + { + "name": "peer_interface", + "in": "query", + "description": "The name of the peer interface", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Device" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/console-connections/": { + "get": { + "operationId": "dcim_console-connections_list", "description": "", "parameters": [ { @@ -1381,7 +1394,14 @@ "type": "string" }, { - "name": "device_id", + "name": "connection_status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", "in": "query", "description": "", "required": false, @@ -1446,16 +1466,103 @@ "dcim" ] }, - "post": { - "operationId": "dcim_console-ports_create", - "description": "", - "parameters": [ + "parameters": [] + }, + "/dcim/console-port-templates/": { + "get": { + "operationId": "dcim_console-port-templates_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsolePortTemplate" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_console-port-templates_create", + "description": "", + "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsolePort" + "$ref": "#/definitions/WritableConsolePortTemplate" } } ], @@ -1463,7 +1570,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsolePort" + "$ref": "#/definitions/ConsolePortTemplate" } } }, @@ -1473,16 +1580,16 @@ }, "parameters": [] }, - "/dcim/console-ports/{id}/": { + "/dcim/console-port-templates/{id}/": { "get": { - "operationId": "dcim_console-ports_read", - "description": "", + "operationId": "dcim_console-port-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/ConsolePort" + "$ref": "#/definitions/ConsolePortTemplate" } } }, @@ -1491,7 +1598,7 @@ ] }, "put": { - "operationId": "dcim_console-ports_update", + "operationId": "dcim_console-port-templates_update", "description": "", "parameters": [ { @@ -1499,7 +1606,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsolePort" + "$ref": "#/definitions/WritableConsolePortTemplate" } } ], @@ -1507,7 +1614,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsolePort" + "$ref": "#/definitions/ConsolePortTemplate" } } }, @@ -1516,7 +1623,7 @@ ] }, "patch": { - "operationId": "dcim_console-ports_partial_update", + "operationId": "dcim_console-port-templates_partial_update", "description": "", "parameters": [ { @@ -1524,7 +1631,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsolePort" + "$ref": "#/definitions/WritableConsolePortTemplate" } } ], @@ -1532,7 +1639,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsolePort" + "$ref": "#/definitions/ConsolePortTemplate" } } }, @@ -1541,7 +1648,7 @@ ] }, "delete": { - "operationId": "dcim_console-ports_delete", + "operationId": "dcim_console-port-templates_delete", "description": "", "parameters": [], "responses": { @@ -1557,17 +1664,24 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this console port.", + "description": "A unique integer value identifying this console port template.", "required": true, "type": "integer" } ] }, - "/dcim/console-server-port-templates/": { + "/dcim/console-ports/": { "get": { - "operationId": "dcim_console-server-port-templates_list", - "description": "", + "operationId": "dcim_console-ports_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -1576,7 +1690,49 @@ "type": "string" }, { - "name": "devicetype_id", + "name": "description", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "connection_status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cabled", "in": "query", "description": "", "required": false, @@ -1623,7 +1779,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/ConsoleServerPortTemplate" + "$ref": "#/definitions/ConsolePort" } } } @@ -1635,7 +1791,7 @@ ] }, "post": { - "operationId": "dcim_console-server-port-templates_create", + "operationId": "dcim_console-ports_create", "description": "", "parameters": [ { @@ -1643,7 +1799,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsoleServerPortTemplate" + "$ref": "#/definitions/WritableConsolePort" } } ], @@ -1651,7 +1807,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsoleServerPortTemplate" + "$ref": "#/definitions/ConsolePort" } } }, @@ -1661,16 +1817,16 @@ }, "parameters": [] }, - "/dcim/console-server-port-templates/{id}/": { + "/dcim/console-ports/{id}/": { "get": { - "operationId": "dcim_console-server-port-templates_read", - "description": "", + "operationId": "dcim_console-ports_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/ConsoleServerPortTemplate" + "$ref": "#/definitions/ConsolePort" } } }, @@ -1679,7 +1835,7 @@ ] }, "put": { - "operationId": "dcim_console-server-port-templates_update", + "operationId": "dcim_console-ports_update", "description": "", "parameters": [ { @@ -1687,7 +1843,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsoleServerPortTemplate" + "$ref": "#/definitions/WritableConsolePort" } } ], @@ -1695,7 +1851,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsoleServerPortTemplate" + "$ref": "#/definitions/ConsolePort" } } }, @@ -1704,7 +1860,7 @@ ] }, "patch": { - "operationId": "dcim_console-server-port-templates_partial_update", + "operationId": "dcim_console-ports_partial_update", "description": "", "parameters": [ { @@ -1712,7 +1868,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsoleServerPortTemplate" + "$ref": "#/definitions/WritableConsolePort" } } ], @@ -1720,7 +1876,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsoleServerPortTemplate" + "$ref": "#/definitions/ConsolePort" } } }, @@ -1729,7 +1885,7 @@ ] }, "delete": { - "operationId": "dcim_console-server-port-templates_delete", + "operationId": "dcim_console-ports_delete", "description": "", "parameters": [], "responses": { @@ -1745,17 +1901,51 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this console server port template.", + "description": "A unique integer value identifying this console port.", "required": true, "type": "integer" } ] }, - "/dcim/console-server-ports/": { + "/dcim/console-ports/{id}/trace/": { "get": { - "operationId": "dcim_console-server-ports_list", - "description": "", + "operationId": "dcim_console-ports_trace", + "description": "Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination).", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ConsolePort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this console port.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/console-server-port-templates/": { + "get": { + "operationId": "dcim_console-server-port-templates_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -1764,14 +1954,14 @@ "type": "string" }, { - "name": "device_id", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "devicetype_id", "in": "query", "description": "", "required": false, @@ -1818,7 +2008,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/ConsoleServerPort" + "$ref": "#/definitions/ConsoleServerPortTemplate" } } } @@ -1830,7 +2020,7 @@ ] }, "post": { - "operationId": "dcim_console-server-ports_create", + "operationId": "dcim_console-server-port-templates_create", "description": "", "parameters": [ { @@ -1838,7 +2028,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsoleServerPort" + "$ref": "#/definitions/WritableConsoleServerPortTemplate" } } ], @@ -1846,7 +2036,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsoleServerPort" + "$ref": "#/definitions/ConsoleServerPortTemplate" } } }, @@ -1856,16 +2046,16 @@ }, "parameters": [] }, - "/dcim/console-server-ports/{id}/": { + "/dcim/console-server-port-templates/{id}/": { "get": { - "operationId": "dcim_console-server-ports_read", - "description": "", + "operationId": "dcim_console-server-port-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/ConsoleServerPort" + "$ref": "#/definitions/ConsoleServerPortTemplate" } } }, @@ -1874,7 +2064,7 @@ ] }, "put": { - "operationId": "dcim_console-server-ports_update", + "operationId": "dcim_console-server-port-templates_update", "description": "", "parameters": [ { @@ -1882,7 +2072,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsoleServerPort" + "$ref": "#/definitions/WritableConsoleServerPortTemplate" } } ], @@ -1890,7 +2080,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsoleServerPort" + "$ref": "#/definitions/ConsoleServerPortTemplate" } } }, @@ -1899,7 +2089,7 @@ ] }, "patch": { - "operationId": "dcim_console-server-ports_partial_update", + "operationId": "dcim_console-server-port-templates_partial_update", "description": "", "parameters": [ { @@ -1907,7 +2097,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableConsoleServerPort" + "$ref": "#/definitions/WritableConsoleServerPortTemplate" } } ], @@ -1915,7 +2105,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableConsoleServerPort" + "$ref": "#/definitions/ConsoleServerPortTemplate" } } }, @@ -1924,7 +2114,7 @@ ] }, "delete": { - "operationId": "dcim_console-server-ports_delete", + "operationId": "dcim_console-server-port-templates_delete", "description": "", "parameters": [], "responses": { @@ -1940,17 +2130,24 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this console server port.", + "description": "A unique integer value identifying this console server port template.", "required": true, "type": "integer" } ] }, - "/dcim/device-bay-templates/": { + "/dcim/console-server-ports/": { "get": { - "operationId": "dcim_device-bay-templates_list", - "description": "", + "operationId": "dcim_console-server-ports_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -1959,7 +2156,49 @@ "type": "string" }, { - "name": "devicetype_id", + "name": "description", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "connection_status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cabled", "in": "query", "description": "", "required": false, @@ -2006,7 +2245,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/DeviceBayTemplate" + "$ref": "#/definitions/ConsoleServerPort" } } } @@ -2018,7 +2257,7 @@ ] }, "post": { - "operationId": "dcim_device-bay-templates_create", + "operationId": "dcim_console-server-ports_create", "description": "", "parameters": [ { @@ -2026,7 +2265,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceBayTemplate" + "$ref": "#/definitions/WritableConsoleServerPort" } } ], @@ -2034,7 +2273,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceBayTemplate" + "$ref": "#/definitions/ConsoleServerPort" } } }, @@ -2044,16 +2283,16 @@ }, "parameters": [] }, - "/dcim/device-bay-templates/{id}/": { + "/dcim/console-server-ports/{id}/": { "get": { - "operationId": "dcim_device-bay-templates_read", - "description": "", + "operationId": "dcim_console-server-ports_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/DeviceBayTemplate" + "$ref": "#/definitions/ConsoleServerPort" } } }, @@ -2062,7 +2301,7 @@ ] }, "put": { - "operationId": "dcim_device-bay-templates_update", + "operationId": "dcim_console-server-ports_update", "description": "", "parameters": [ { @@ -2070,7 +2309,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceBayTemplate" + "$ref": "#/definitions/WritableConsoleServerPort" } } ], @@ -2078,7 +2317,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceBayTemplate" + "$ref": "#/definitions/ConsoleServerPort" } } }, @@ -2087,7 +2326,7 @@ ] }, "patch": { - "operationId": "dcim_device-bay-templates_partial_update", + "operationId": "dcim_console-server-ports_partial_update", "description": "", "parameters": [ { @@ -2095,7 +2334,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceBayTemplate" + "$ref": "#/definitions/WritableConsoleServerPort" } } ], @@ -2103,7 +2342,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceBayTemplate" + "$ref": "#/definitions/ConsoleServerPort" } } }, @@ -2112,7 +2351,7 @@ ] }, "delete": { - "operationId": "dcim_device-bay-templates_delete", + "operationId": "dcim_console-server-ports_delete", "description": "", "parameters": [], "responses": { @@ -2128,17 +2367,51 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this device bay template.", + "description": "A unique integer value identifying this console server port.", "required": true, "type": "integer" } ] }, - "/dcim/device-bays/": { + "/dcim/console-server-ports/{id}/trace/": { "get": { - "operationId": "dcim_device-bays_list", - "description": "", + "operationId": "dcim_console-server-ports_trace", + "description": "Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination).", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ConsoleServerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this console server port.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/device-bay-templates/": { + "get": { + "operationId": "dcim_device-bay-templates_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -2147,14 +2420,14 @@ "type": "string" }, { - "name": "device_id", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "devicetype_id", "in": "query", "description": "", "required": false, @@ -2201,7 +2474,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/DeviceBay" + "$ref": "#/definitions/DeviceBayTemplate" } } } @@ -2213,7 +2486,7 @@ ] }, "post": { - "operationId": "dcim_device-bays_create", + "operationId": "dcim_device-bay-templates_create", "description": "", "parameters": [ { @@ -2221,7 +2494,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceBay" + "$ref": "#/definitions/WritableDeviceBayTemplate" } } ], @@ -2229,7 +2502,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceBay" + "$ref": "#/definitions/DeviceBayTemplate" } } }, @@ -2239,16 +2512,16 @@ }, "parameters": [] }, - "/dcim/device-bays/{id}/": { + "/dcim/device-bay-templates/{id}/": { "get": { - "operationId": "dcim_device-bays_read", - "description": "", + "operationId": "dcim_device-bay-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/DeviceBay" + "$ref": "#/definitions/DeviceBayTemplate" } } }, @@ -2257,7 +2530,7 @@ ] }, "put": { - "operationId": "dcim_device-bays_update", + "operationId": "dcim_device-bay-templates_update", "description": "", "parameters": [ { @@ -2265,7 +2538,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceBay" + "$ref": "#/definitions/WritableDeviceBayTemplate" } } ], @@ -2273,7 +2546,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceBay" + "$ref": "#/definitions/DeviceBayTemplate" } } }, @@ -2282,7 +2555,7 @@ ] }, "patch": { - "operationId": "dcim_device-bays_partial_update", + "operationId": "dcim_device-bay-templates_partial_update", "description": "", "parameters": [ { @@ -2290,7 +2563,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceBay" + "$ref": "#/definitions/WritableDeviceBayTemplate" } } ], @@ -2298,7 +2571,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceBay" + "$ref": "#/definitions/DeviceBayTemplate" } } }, @@ -2307,7 +2580,7 @@ ] }, "delete": { - "operationId": "dcim_device-bays_delete", + "operationId": "dcim_device-bay-templates_delete", "description": "", "parameters": [], "responses": { @@ -2323,17 +2596,24 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this device bay.", + "description": "A unique integer value identifying this device bay template.", "required": true, "type": "integer" } ] }, - "/dcim/device-roles/": { + "/dcim/device-bays/": { "get": { - "operationId": "dcim_device-roles_list", - "description": "", + "operationId": "dcim_device-bays_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -2342,21 +2622,35 @@ "type": "string" }, { - "name": "slug", + "name": "description", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "color", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "vm_role", + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", "in": "query", "description": "", "required": false, @@ -2403,7 +2697,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/DeviceRole" + "$ref": "#/definitions/DeviceBay" } } } @@ -2415,7 +2709,7 @@ ] }, "post": { - "operationId": "dcim_device-roles_create", + "operationId": "dcim_device-bays_create", "description": "", "parameters": [ { @@ -2423,7 +2717,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DeviceRole" + "$ref": "#/definitions/WritableDeviceBay" } } ], @@ -2431,7 +2725,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/DeviceRole" + "$ref": "#/definitions/DeviceBay" } } }, @@ -2441,16 +2735,16 @@ }, "parameters": [] }, - "/dcim/device-roles/{id}/": { + "/dcim/device-bays/{id}/": { "get": { - "operationId": "dcim_device-roles_read", - "description": "", + "operationId": "dcim_device-bays_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/DeviceRole" + "$ref": "#/definitions/DeviceBay" } } }, @@ -2459,7 +2753,7 @@ ] }, "put": { - "operationId": "dcim_device-roles_update", + "operationId": "dcim_device-bays_update", "description": "", "parameters": [ { @@ -2467,7 +2761,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DeviceRole" + "$ref": "#/definitions/WritableDeviceBay" } } ], @@ -2475,7 +2769,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/DeviceRole" + "$ref": "#/definitions/DeviceBay" } } }, @@ -2484,7 +2778,7 @@ ] }, "patch": { - "operationId": "dcim_device-roles_partial_update", + "operationId": "dcim_device-bays_partial_update", "description": "", "parameters": [ { @@ -2492,7 +2786,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DeviceRole" + "$ref": "#/definitions/WritableDeviceBay" } } ], @@ -2500,7 +2794,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/DeviceRole" + "$ref": "#/definitions/DeviceBay" } } }, @@ -2509,7 +2803,7 @@ ] }, "delete": { - "operationId": "dcim_device-roles_delete", + "operationId": "dcim_device-bays_delete", "description": "", "parameters": [], "responses": { @@ -2525,119 +2819,70 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this device role.", + "description": "A unique integer value identifying this device bay.", "required": true, "type": "integer" } ] }, - "/dcim/device-types/": { + "/dcim/device-roles/": { "get": { - "operationId": "dcim_device-types_list", - "description": "", + "operationId": "dcim_device-roles_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "model", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "slug", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "part_number", + "name": "slug", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "u_height", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "is_full_depth", + "name": "color", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "is_console_server", + "name": "vm_role", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "is_pdu", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "is_network_device", + "name": "limit", "in": "query", - "description": "", + "description": "Number of results to return per page.", "required": false, - "type": "string" + "type": "integer" }, { - "name": "subdevice_role", + "name": "offset", "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "manufacturer_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "manufacturer", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "description": "Number of results to return per page.", - "required": false, - "type": "integer" - }, - { - "name": "offset", - "in": "query", - "description": "The initial index from which to return the results.", + "description": "The initial index from which to return the results.", "required": false, "type": "integer" } @@ -2668,7 +2913,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/DeviceType" + "$ref": "#/definitions/DeviceRole" } } } @@ -2680,7 +2925,7 @@ ] }, "post": { - "operationId": "dcim_device-types_create", + "operationId": "dcim_device-roles_create", "description": "", "parameters": [ { @@ -2688,7 +2933,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceType" + "$ref": "#/definitions/DeviceRole" } } ], @@ -2696,7 +2941,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceType" + "$ref": "#/definitions/DeviceRole" } } }, @@ -2706,16 +2951,16 @@ }, "parameters": [] }, - "/dcim/device-types/{id}/": { + "/dcim/device-roles/{id}/": { "get": { - "operationId": "dcim_device-types_read", - "description": "", + "operationId": "dcim_device-roles_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/DeviceType" + "$ref": "#/definitions/DeviceRole" } } }, @@ -2724,7 +2969,7 @@ ] }, "put": { - "operationId": "dcim_device-types_update", + "operationId": "dcim_device-roles_update", "description": "", "parameters": [ { @@ -2732,7 +2977,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceType" + "$ref": "#/definitions/DeviceRole" } } ], @@ -2740,7 +2985,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceType" + "$ref": "#/definitions/DeviceRole" } } }, @@ -2749,7 +2994,7 @@ ] }, "patch": { - "operationId": "dcim_device-types_partial_update", + "operationId": "dcim_device-roles_partial_update", "description": "", "parameters": [ { @@ -2757,7 +3002,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDeviceType" + "$ref": "#/definitions/DeviceRole" } } ], @@ -2765,7 +3010,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableDeviceType" + "$ref": "#/definitions/DeviceRole" } } }, @@ -2774,7 +3019,7 @@ ] }, "delete": { - "operationId": "dcim_device-types_delete", + "operationId": "dcim_device-roles_delete", "description": "", "parameters": [], "responses": { @@ -2790,215 +3035,131 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this device type.", + "description": "A unique integer value identifying this device role.", "required": true, "type": "integer" } ] }, - "/dcim/devices/": { + "/dcim/device-types/": { "get": { - "operationId": "dcim_devices_list", - "description": "", + "operationId": "dcim_device-types_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "serial", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "position", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "manufacturer_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "manufacturer", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "device_type_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "role_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "role", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "tenant_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "tenant", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "platform_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "platform", + "name": "model", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "name", + "name": "slug", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "asset_tag", + "name": "part_number", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site_id", + "name": "u_height", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site", + "name": "is_full_depth", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "rack_group_id", + "name": "subdevice_role", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "rack_id", + "name": "id__in", "in": "query", - "description": "", + "description": "Multiple values may be separated by commas.", "required": false, "type": "string" }, { - "name": "cluster_id", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "model", + "name": "manufacturer_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "status", + "name": "manufacturer", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "is_full_depth", + "name": "console_ports", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "is_console_server", + "name": "console_server_ports", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "is_pdu", + "name": "power_ports", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "is_network_device", + "name": "power_outlets", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "mac_address", + "name": "interfaces", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "has_primary_ip", + "name": "pass_through_ports", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "virtual_chassis_id", + "name": "tag", "in": "query", "description": "", "required": false, @@ -3045,7 +3206,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Device" + "$ref": "#/definitions/DeviceType" } } } @@ -3057,7 +3218,7 @@ ] }, "post": { - "operationId": "dcim_devices_create", + "operationId": "dcim_device-types_create", "description": "", "parameters": [ { @@ -3065,7 +3226,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDevice" + "$ref": "#/definitions/WritableDeviceType" } } ], @@ -3073,7 +3234,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableDevice" + "$ref": "#/definitions/DeviceType" } } }, @@ -3083,16 +3244,16 @@ }, "parameters": [] }, - "/dcim/devices/{id}/": { + "/dcim/device-types/{id}/": { "get": { - "operationId": "dcim_devices_read", - "description": "", + "operationId": "dcim_device-types_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Device" + "$ref": "#/definitions/DeviceType" } } }, @@ -3101,7 +3262,7 @@ ] }, "put": { - "operationId": "dcim_devices_update", + "operationId": "dcim_device-types_update", "description": "", "parameters": [ { @@ -3109,7 +3270,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDevice" + "$ref": "#/definitions/WritableDeviceType" } } ], @@ -3117,7 +3278,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableDevice" + "$ref": "#/definitions/DeviceType" } } }, @@ -3126,7 +3287,7 @@ ] }, "patch": { - "operationId": "dcim_devices_partial_update", + "operationId": "dcim_device-types_partial_update", "description": "", "parameters": [ { @@ -3134,7 +3295,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableDevice" + "$ref": "#/definitions/WritableDeviceType" } } ], @@ -3142,7 +3303,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableDevice" + "$ref": "#/definitions/DeviceType" } } }, @@ -3151,7 +3312,7 @@ ] }, "delete": { - "operationId": "dcim_devices_delete", + "operationId": "dcim_device-types_delete", "description": "", "parameters": [], "responses": { @@ -3167,499 +3328,229 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this device.", - "required": true, - "type": "integer" - } - ] - }, - "/dcim/devices/{id}/napalm/": { - "get": { - "operationId": "dcim_devices_napalm", - "description": "Execute a NAPALM method on a Device", - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/Device" - } - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "A unique integer value identifying this device.", + "description": "A unique integer value identifying this device type.", "required": true, "type": "integer" } ] }, - "/dcim/interface-connections/": { + "/dcim/devices/": { "get": { - "operationId": "dcim_interface-connections_list", - "description": "", + "operationId": "dcim_devices_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "connection_status", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "serial", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "limit", + "name": "asset_tag", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "face", "in": "query", - "description": "The initial index from which to return the results.", + "description": "", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "position", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "next": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "previous": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/InterfaceConnection" - } - } - } - } - } - }, - "tags": [ - "dcim" - ] - }, - "post": { - "operationId": "dcim_interface-connections_create", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableInterfaceConnection" - } - } - ], - "responses": { - "201": { + "name": "vc_position", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableInterfaceConnection" - } - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [] - }, - "/dcim/interface-connections/{id}/": { - "get": { - "operationId": "dcim_interface-connections_read", - "description": "", - "parameters": [], - "responses": { - "200": { + "required": false, + "type": "string" + }, + { + "name": "vc_priority", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/InterfaceConnection" - } - } - }, - "tags": [ - "dcim" - ] - }, - "put": { - "operationId": "dcim_interface-connections_update", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableInterfaceConnection" - } - } - ], - "responses": { - "200": { + "name": "tenant_group_id", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableInterfaceConnection" - } - } - }, - "tags": [ - "dcim" - ] - }, - "patch": { - "operationId": "dcim_interface-connections_partial_update", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableInterfaceConnection" - } - } - ], - "responses": { - "200": { + "name": "tenant_group", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableInterfaceConnection" - } - } - }, - "tags": [ - "dcim" - ] - }, - "delete": { - "operationId": "dcim_interface-connections_delete", - "description": "", - "parameters": [], - "responses": { - "204": { - "description": "" - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "A unique integer value identifying this interface connection.", - "required": true, - "type": "integer" - } - ] - }, - "/dcim/interface-templates/": { - "get": { - "operationId": "dcim_interface-templates_list", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "name", + "name": "tenant_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "form_factor", + "name": "tenant", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "mgmt_only", + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "devicetype_id", + "name": "manufacturer_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "limit", + "name": "manufacturer", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "device_type_id", "in": "query", - "description": "The initial index from which to return the results.", + "description": "", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "role_id", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "next": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "previous": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/InterfaceTemplate" - } - } - } - } - } - }, - "tags": [ - "dcim" - ] - }, - "post": { - "operationId": "dcim_interface-templates_create", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableInterfaceTemplate" - } - } - ], - "responses": { - "201": { + "name": "role", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableInterfaceTemplate" - } - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [] - }, - "/dcim/interface-templates/{id}/": { - "get": { - "operationId": "dcim_interface-templates_read", - "description": "", - "parameters": [], - "responses": { - "200": { + "required": false, + "type": "string" + }, + { + "name": "platform_id", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/InterfaceTemplate" - } - } - }, - "tags": [ - "dcim" - ] - }, - "put": { - "operationId": "dcim_interface-templates_update", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableInterfaceTemplate" - } - } - ], - "responses": { - "200": { + "name": "platform", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableInterfaceTemplate" - } - } - }, - "tags": [ - "dcim" - ] - }, - "patch": { - "operationId": "dcim_interface-templates_partial_update", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableInterfaceTemplate" - } - } - ], - "responses": { - "200": { + "name": "region_id", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableInterfaceTemplate" - } - } - }, - "tags": [ - "dcim" - ] - }, - "delete": { - "operationId": "dcim_interface-templates_delete", - "description": "", - "parameters": [], - "responses": { - "204": { - "description": "" - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "A unique integer value identifying this interface template.", - "required": true, - "type": "integer" - } - ] - }, - "/dcim/interfaces/": { - "get": { - "operationId": "dcim_interfaces_list", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "name", + "name": "region", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "form_factor", + "name": "site_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "enabled", + "name": "site", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "mtu", + "name": "rack_group_id", "in": "query", "description": "", "required": false, - "type": "number" + "type": "string" }, { - "name": "mgmt_only", + "name": "rack_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "cluster_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device_id", + "name": "model", "in": "query", "description": "", "required": false, - "type": "number" + "type": "string" }, { - "name": "type", + "name": "status", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "lag_id", + "name": "is_full_depth", "in": "query", "description": "", "required": false, @@ -3672,6 +3563,76 @@ "required": false, "type": "string" }, + { + "name": "has_primary_ip", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_chassis_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_chassis_member", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "console_ports", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "console_server_ports", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "power_ports", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "power_outlets", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "interfaces", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "pass_through_ports", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -3713,7 +3674,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Interface" + "$ref": "#/definitions/DeviceWithConfigContext" } } } @@ -3725,7 +3686,7 @@ ] }, "post": { - "operationId": "dcim_interfaces_create", + "operationId": "dcim_devices_create", "description": "", "parameters": [ { @@ -3733,7 +3694,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/WritableDeviceWithConfigContext" } } ], @@ -3741,7 +3702,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/DeviceWithConfigContext" } } }, @@ -3751,16 +3712,16 @@ }, "parameters": [] }, - "/dcim/interfaces/{id}/": { + "/dcim/devices/{id}/": { "get": { - "operationId": "dcim_interfaces_read", - "description": "", + "operationId": "dcim_devices_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Interface" + "$ref": "#/definitions/DeviceWithConfigContext" } } }, @@ -3769,7 +3730,7 @@ ] }, "put": { - "operationId": "dcim_interfaces_update", + "operationId": "dcim_devices_update", "description": "", "parameters": [ { @@ -3777,7 +3738,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/WritableDeviceWithConfigContext" } } ], @@ -3785,7 +3746,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/DeviceWithConfigContext" } } }, @@ -3794,7 +3755,7 @@ ] }, "patch": { - "operationId": "dcim_interfaces_partial_update", + "operationId": "dcim_devices_partial_update", "description": "", "parameters": [ { @@ -3802,7 +3763,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/WritableDeviceWithConfigContext" } } ], @@ -3810,7 +3771,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/DeviceWithConfigContext" } } }, @@ -3819,7 +3780,7 @@ ] }, "delete": { - "operationId": "dcim_interfaces_delete", + "operationId": "dcim_devices_delete", "description": "", "parameters": [], "responses": { @@ -3835,22 +3796,22 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this interface.", + "description": "A unique integer value identifying this device.", "required": true, "type": "integer" } ] }, - "/dcim/interfaces/{id}/graphs/": { + "/dcim/devices/{id}/napalm/": { "get": { - "operationId": "dcim_interfaces_graphs", - "description": "A convenience method for rendering graphs for a particular interface.", + "operationId": "dcim_devices_napalm", + "description": "Execute a NAPALM method on a Device", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Interface" + "$ref": "#/definitions/DeviceWithConfigContext" } } }, @@ -3862,111 +3823,69 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this interface.", + "description": "A unique integer value identifying this device.", "required": true, "type": "integer" } ] }, - "/dcim/inventory-items/": { + "/dcim/front-port-templates/": { "get": { - "operationId": "dcim_inventory-items_list", - "description": "", + "operationId": "dcim_front-port-templates_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "part_id", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "serial", + "name": "type", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "asset_tag", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "discovered", + "name": "devicetype_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device_id", + "name": "limit", "in": "query", - "description": "", + "description": "Number of results to return per page.", "required": false, - "type": "string" + "type": "integer" }, { - "name": "device", + "name": "offset", "in": "query", - "description": "", + "description": "The initial index from which to return the results.", "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "parent_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "manufacturer_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "manufacturer", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "description": "Number of results to return per page.", - "required": false, - "type": "integer" - }, - { - "name": "offset", - "in": "query", - "description": "The initial index from which to return the results.", - "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "integer" + } + ], + "responses": { + "200": { "description": "", "schema": { "required": [ @@ -3991,7 +3910,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/InventoryItem" + "$ref": "#/definitions/FrontPortTemplate" } } } @@ -4003,7 +3922,7 @@ ] }, "post": { - "operationId": "dcim_inventory-items_create", + "operationId": "dcim_front-port-templates_create", "description": "", "parameters": [ { @@ -4011,7 +3930,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInventoryItem" + "$ref": "#/definitions/WritableFrontPortTemplate" } } ], @@ -4019,7 +3938,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableInventoryItem" + "$ref": "#/definitions/FrontPortTemplate" } } }, @@ -4029,16 +3948,16 @@ }, "parameters": [] }, - "/dcim/inventory-items/{id}/": { + "/dcim/front-port-templates/{id}/": { "get": { - "operationId": "dcim_inventory-items_read", - "description": "", + "operationId": "dcim_front-port-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/InventoryItem" + "$ref": "#/definitions/FrontPortTemplate" } } }, @@ -4047,7 +3966,7 @@ ] }, "put": { - "operationId": "dcim_inventory-items_update", + "operationId": "dcim_front-port-templates_update", "description": "", "parameters": [ { @@ -4055,7 +3974,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInventoryItem" + "$ref": "#/definitions/WritableFrontPortTemplate" } } ], @@ -4063,7 +3982,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableInventoryItem" + "$ref": "#/definitions/FrontPortTemplate" } } }, @@ -4072,7 +3991,7 @@ ] }, "patch": { - "operationId": "dcim_inventory-items_partial_update", + "operationId": "dcim_front-port-templates_partial_update", "description": "", "parameters": [ { @@ -4080,7 +3999,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInventoryItem" + "$ref": "#/definitions/WritableFrontPortTemplate" } } ], @@ -4088,7 +4007,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableInventoryItem" + "$ref": "#/definitions/FrontPortTemplate" } } }, @@ -4097,7 +4016,7 @@ ] }, "delete": { - "operationId": "dcim_inventory-items_delete", + "operationId": "dcim_front-port-templates_delete", "description": "", "parameters": [], "responses": { @@ -4113,17 +4032,24 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this inventory item.", + "description": "A unique integer value identifying this front port template.", "required": true, "type": "integer" } ] }, - "/dcim/manufacturers/": { + "/dcim/front-ports/": { "get": { - "operationId": "dcim_manufacturers_list", - "description": "", + "operationId": "dcim_front-ports_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -4132,7 +4058,49 @@ "type": "string" }, { - "name": "slug", + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "description", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cabled", "in": "query", "description": "", "required": false, @@ -4179,7 +4147,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Manufacturer" + "$ref": "#/definitions/FrontPort" } } } @@ -4191,7 +4159,7 @@ ] }, "post": { - "operationId": "dcim_manufacturers_create", + "operationId": "dcim_front-ports_create", "description": "", "parameters": [ { @@ -4199,7 +4167,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Manufacturer" + "$ref": "#/definitions/WritableFrontPort" } } ], @@ -4207,7 +4175,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/Manufacturer" + "$ref": "#/definitions/FrontPort" } } }, @@ -4217,16 +4185,16 @@ }, "parameters": [] }, - "/dcim/manufacturers/{id}/": { + "/dcim/front-ports/{id}/": { "get": { - "operationId": "dcim_manufacturers_read", - "description": "", + "operationId": "dcim_front-ports_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Manufacturer" + "$ref": "#/definitions/FrontPort" } } }, @@ -4235,7 +4203,7 @@ ] }, "put": { - "operationId": "dcim_manufacturers_update", + "operationId": "dcim_front-ports_update", "description": "", "parameters": [ { @@ -4243,7 +4211,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Manufacturer" + "$ref": "#/definitions/WritableFrontPort" } } ], @@ -4251,7 +4219,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/Manufacturer" + "$ref": "#/definitions/FrontPort" } } }, @@ -4260,7 +4228,7 @@ ] }, "patch": { - "operationId": "dcim_manufacturers_partial_update", + "operationId": "dcim_front-ports_partial_update", "description": "", "parameters": [ { @@ -4268,7 +4236,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Manufacturer" + "$ref": "#/definitions/WritableFrontPort" } } ], @@ -4276,7 +4244,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/Manufacturer" + "$ref": "#/definitions/FrontPort" } } }, @@ -4285,7 +4253,7 @@ ] }, "delete": { - "operationId": "dcim_manufacturers_delete", + "operationId": "dcim_front-ports_delete", "description": "", "parameters": [], "responses": { @@ -4301,17 +4269,104 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this manufacturer.", + "description": "A unique integer value identifying this front port.", "required": true, "type": "integer" } ] }, - "/dcim/platforms/": { + "/dcim/interface-connections/": { "get": { - "operationId": "dcim_platforms_list", + "operationId": "dcim_interface-connections_list", "description": "", "parameters": [ + { + "name": "connection_status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InterfaceConnection" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/interface-templates/": { + "get": { + "operationId": "dcim_interface-templates_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -4320,21 +4375,28 @@ "type": "string" }, { - "name": "slug", + "name": "type", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "manufacturer_id", + "name": "mgmt_only", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "manufacturer", + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", "in": "query", "description": "", "required": false, @@ -4381,7 +4443,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Platform" + "$ref": "#/definitions/InterfaceTemplate" } } } @@ -4393,7 +4455,7 @@ ] }, "post": { - "operationId": "dcim_platforms_create", + "operationId": "dcim_interface-templates_create", "description": "", "parameters": [ { @@ -4401,7 +4463,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePlatform" + "$ref": "#/definitions/WritableInterfaceTemplate" } } ], @@ -4409,7 +4471,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritablePlatform" + "$ref": "#/definitions/InterfaceTemplate" } } }, @@ -4419,16 +4481,16 @@ }, "parameters": [] }, - "/dcim/platforms/{id}/": { + "/dcim/interface-templates/{id}/": { "get": { - "operationId": "dcim_platforms_read", - "description": "", + "operationId": "dcim_interface-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Platform" + "$ref": "#/definitions/InterfaceTemplate" } } }, @@ -4437,7 +4499,7 @@ ] }, "put": { - "operationId": "dcim_platforms_update", + "operationId": "dcim_interface-templates_update", "description": "", "parameters": [ { @@ -4445,7 +4507,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePlatform" + "$ref": "#/definitions/WritableInterfaceTemplate" } } ], @@ -4453,7 +4515,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePlatform" + "$ref": "#/definitions/InterfaceTemplate" } } }, @@ -4462,7 +4524,7 @@ ] }, "patch": { - "operationId": "dcim_platforms_partial_update", + "operationId": "dcim_interface-templates_partial_update", "description": "", "parameters": [ { @@ -4470,7 +4532,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePlatform" + "$ref": "#/definitions/WritableInterfaceTemplate" } } ], @@ -4478,7 +4540,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePlatform" + "$ref": "#/definitions/InterfaceTemplate" } } }, @@ -4487,7 +4549,7 @@ ] }, "delete": { - "operationId": "dcim_platforms_delete", + "operationId": "dcim_interface-templates_delete", "description": "", "parameters": [], "responses": { @@ -4503,17 +4565,24 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this platform.", + "description": "A unique integer value identifying this interface template.", "required": true, "type": "integer" } ] }, - "/dcim/power-connections/": { + "/dcim/interfaces/": { "get": { - "operationId": "dcim_power-connections_list", - "description": "", + "operationId": "dcim_interfaces_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -4529,7 +4598,49 @@ "type": "string" }, { - "name": "site", + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "enabled", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mtu", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mgmt_only", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mode", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "description", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", "in": "query", "description": "", "required": false, @@ -4543,73 +4654,56 @@ "type": "string" }, { - "name": "limit", + "name": "device_id", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "number" }, { - "name": "offset", + "name": "cabled", "in": "query", - "description": "The initial index from which to return the results.", + "description": "", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "kind", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "next": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "previous": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/PowerPort" - } - } - } - } - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [] - }, - "/dcim/power-outlet-templates/": { - "get": { - "operationId": "dcim_power-outlet-templates_list", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "name", + "name": "lag_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "devicetype_id", + "name": "mac_address", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vlan_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vlan", "in": "query", "description": "", "required": false, @@ -4656,7 +4750,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/PowerOutletTemplate" + "$ref": "#/definitions/DeviceInterface" } } } @@ -4668,7 +4762,7 @@ ] }, "post": { - "operationId": "dcim_power-outlet-templates_create", + "operationId": "dcim_interfaces_create", "description": "", "parameters": [ { @@ -4676,7 +4770,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerOutletTemplate" + "$ref": "#/definitions/WritableDeviceInterface" } } ], @@ -4684,7 +4778,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerOutletTemplate" + "$ref": "#/definitions/DeviceInterface" } } }, @@ -4694,16 +4788,16 @@ }, "parameters": [] }, - "/dcim/power-outlet-templates/{id}/": { + "/dcim/interfaces/{id}/": { "get": { - "operationId": "dcim_power-outlet-templates_read", - "description": "", + "operationId": "dcim_interfaces_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/PowerOutletTemplate" + "$ref": "#/definitions/DeviceInterface" } } }, @@ -4712,7 +4806,7 @@ ] }, "put": { - "operationId": "dcim_power-outlet-templates_update", + "operationId": "dcim_interfaces_update", "description": "", "parameters": [ { @@ -4720,7 +4814,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerOutletTemplate" + "$ref": "#/definitions/WritableDeviceInterface" } } ], @@ -4728,7 +4822,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerOutletTemplate" + "$ref": "#/definitions/DeviceInterface" } } }, @@ -4737,7 +4831,7 @@ ] }, "patch": { - "operationId": "dcim_power-outlet-templates_partial_update", + "operationId": "dcim_interfaces_partial_update", "description": "", "parameters": [ { @@ -4745,7 +4839,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerOutletTemplate" + "$ref": "#/definitions/WritableDeviceInterface" } } ], @@ -4753,7 +4847,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerOutletTemplate" + "$ref": "#/definitions/DeviceInterface" } } }, @@ -4762,7 +4856,7 @@ ] }, "delete": { - "operationId": "dcim_power-outlet-templates_delete", + "operationId": "dcim_interfaces_delete", "description": "", "parameters": [], "responses": { @@ -4778,17 +4872,78 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this power outlet template.", + "description": "A unique integer value identifying this interface.", "required": true, "type": "integer" } ] }, - "/dcim/power-outlets/": { + "/dcim/interfaces/{id}/graphs/": { "get": { - "operationId": "dcim_power-outlets_list", - "description": "", + "operationId": "dcim_interfaces_graphs", + "description": "A convenience method for rendering graphs for a particular interface.", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceInterface" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this interface.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/interfaces/{id}/trace/": { + "get": { + "operationId": "dcim_interfaces_trace", + "description": "Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination).", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceInterface" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this interface.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/inventory-items/": { + "get": { + "operationId": "dcim_inventory-items_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -4797,47 +4952,110 @@ "type": "string" }, { - "name": "device_id", + "name": "part_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "serial", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "limit", + "name": "asset_tag", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "discovered", "in": "query", - "description": "The initial index from which to return the results.", + "description": "", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "q", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "parent_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, "next": { "type": "string", "format": "uri", @@ -4851,7 +5069,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/PowerOutlet" + "$ref": "#/definitions/InventoryItem" } } } @@ -4863,7 +5081,7 @@ ] }, "post": { - "operationId": "dcim_power-outlets_create", + "operationId": "dcim_inventory-items_create", "description": "", "parameters": [ { @@ -4871,7 +5089,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerOutlet" + "$ref": "#/definitions/WritableInventoryItem" } } ], @@ -4879,7 +5097,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerOutlet" + "$ref": "#/definitions/InventoryItem" } } }, @@ -4889,16 +5107,16 @@ }, "parameters": [] }, - "/dcim/power-outlets/{id}/": { + "/dcim/inventory-items/{id}/": { "get": { - "operationId": "dcim_power-outlets_read", - "description": "", + "operationId": "dcim_inventory-items_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/PowerOutlet" + "$ref": "#/definitions/InventoryItem" } } }, @@ -4907,7 +5125,7 @@ ] }, "put": { - "operationId": "dcim_power-outlets_update", + "operationId": "dcim_inventory-items_update", "description": "", "parameters": [ { @@ -4915,7 +5133,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerOutlet" + "$ref": "#/definitions/WritableInventoryItem" } } ], @@ -4923,7 +5141,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerOutlet" + "$ref": "#/definitions/InventoryItem" } } }, @@ -4932,7 +5150,7 @@ ] }, "patch": { - "operationId": "dcim_power-outlets_partial_update", + "operationId": "dcim_inventory-items_partial_update", "description": "", "parameters": [ { @@ -4940,7 +5158,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerOutlet" + "$ref": "#/definitions/WritableInventoryItem" } } ], @@ -4948,7 +5166,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerOutlet" + "$ref": "#/definitions/InventoryItem" } } }, @@ -4957,7 +5175,7 @@ ] }, "delete": { - "operationId": "dcim_power-outlets_delete", + "operationId": "dcim_inventory-items_delete", "description": "", "parameters": [], "responses": { @@ -4973,17 +5191,24 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this power outlet.", + "description": "A unique integer value identifying this inventory item.", "required": true, "type": "integer" } ] }, - "/dcim/power-port-templates/": { + "/dcim/manufacturers/": { "get": { - "operationId": "dcim_power-port-templates_list", - "description": "", + "operationId": "dcim_manufacturers_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -4992,7 +5217,14 @@ "type": "string" }, { - "name": "devicetype_id", + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", "in": "query", "description": "", "required": false, @@ -5039,7 +5271,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/PowerPortTemplate" + "$ref": "#/definitions/Manufacturer" } } } @@ -5051,7 +5283,7 @@ ] }, "post": { - "operationId": "dcim_power-port-templates_create", + "operationId": "dcim_manufacturers_create", "description": "", "parameters": [ { @@ -5059,7 +5291,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerPortTemplate" + "$ref": "#/definitions/Manufacturer" } } ], @@ -5067,7 +5299,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerPortTemplate" + "$ref": "#/definitions/Manufacturer" } } }, @@ -5077,16 +5309,16 @@ }, "parameters": [] }, - "/dcim/power-port-templates/{id}/": { + "/dcim/manufacturers/{id}/": { "get": { - "operationId": "dcim_power-port-templates_read", - "description": "", + "operationId": "dcim_manufacturers_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/PowerPortTemplate" + "$ref": "#/definitions/Manufacturer" } } }, @@ -5095,7 +5327,7 @@ ] }, "put": { - "operationId": "dcim_power-port-templates_update", + "operationId": "dcim_manufacturers_update", "description": "", "parameters": [ { @@ -5103,7 +5335,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerPortTemplate" + "$ref": "#/definitions/Manufacturer" } } ], @@ -5111,7 +5343,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerPortTemplate" + "$ref": "#/definitions/Manufacturer" } } }, @@ -5120,7 +5352,7 @@ ] }, "patch": { - "operationId": "dcim_power-port-templates_partial_update", + "operationId": "dcim_manufacturers_partial_update", "description": "", "parameters": [ { @@ -5128,7 +5360,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerPortTemplate" + "$ref": "#/definitions/Manufacturer" } } ], @@ -5136,7 +5368,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerPortTemplate" + "$ref": "#/definitions/Manufacturer" } } }, @@ -5145,7 +5377,7 @@ ] }, "delete": { - "operationId": "dcim_power-port-templates_delete", + "operationId": "dcim_manufacturers_delete", "description": "", "parameters": [], "responses": { @@ -5161,17 +5393,24 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this power port template.", + "description": "A unique integer value identifying this manufacturer.", "required": true, "type": "integer" } ] }, - "/dcim/power-ports/": { + "/dcim/platforms/": { "get": { - "operationId": "dcim_power-ports_list", - "description": "", + "operationId": "dcim_platforms_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -5180,14 +5419,35 @@ "type": "string" }, { - "name": "device_id", + "name": "slug", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "napalm_driver", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer", "in": "query", "description": "", "required": false, @@ -5234,7 +5494,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/PowerPort" + "$ref": "#/definitions/Platform" } } } @@ -5246,7 +5506,7 @@ ] }, "post": { - "operationId": "dcim_power-ports_create", + "operationId": "dcim_platforms_create", "description": "", "parameters": [ { @@ -5254,7 +5514,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerPort" + "$ref": "#/definitions/WritablePlatform" } } ], @@ -5262,7 +5522,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerPort" + "$ref": "#/definitions/Platform" } } }, @@ -5272,16 +5532,16 @@ }, "parameters": [] }, - "/dcim/power-ports/{id}/": { + "/dcim/platforms/{id}/": { "get": { - "operationId": "dcim_power-ports_read", - "description": "", + "operationId": "dcim_platforms_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/PowerPort" + "$ref": "#/definitions/Platform" } } }, @@ -5290,7 +5550,7 @@ ] }, "put": { - "operationId": "dcim_power-ports_update", + "operationId": "dcim_platforms_update", "description": "", "parameters": [ { @@ -5298,7 +5558,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerPort" + "$ref": "#/definitions/WritablePlatform" } } ], @@ -5306,7 +5566,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerPort" + "$ref": "#/definitions/Platform" } } }, @@ -5315,7 +5575,7 @@ ] }, "patch": { - "operationId": "dcim_power-ports_partial_update", + "operationId": "dcim_platforms_partial_update", "description": "", "parameters": [ { @@ -5323,7 +5583,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePowerPort" + "$ref": "#/definitions/WritablePlatform" } } ], @@ -5331,7 +5591,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePowerPort" + "$ref": "#/definitions/Platform" } } }, @@ -5340,7 +5600,7 @@ ] }, "delete": { - "operationId": "dcim_power-ports_delete", + "operationId": "dcim_platforms_delete", "description": "", "parameters": [], "responses": { @@ -5356,40 +5616,40 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this power port.", + "description": "A unique integer value identifying this platform.", "required": true, "type": "integer" } ] }, - "/dcim/rack-groups/": { + "/dcim/power-connections/": { "get": { - "operationId": "dcim_rack-groups_list", + "operationId": "dcim_power-connections_list", "description": "", "parameters": [ { - "name": "site_id", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "name", + "name": "connection_status", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "slug", + "name": "site", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site", + "name": "device", "in": "query", "description": "", "required": false, @@ -5436,7 +5696,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/RackGroup" + "$ref": "#/definitions/PowerPort" } } } @@ -5447,207 +5707,113 @@ "dcim" ] }, - "post": { - "operationId": "dcim_rack-groups_create", - "description": "", + "parameters": [] + }, + "/dcim/power-feeds/": { + "get": { + "operationId": "dcim_power-feeds_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableRackGroup" - } - } - ], - "responses": { - "201": { + "name": "name", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableRackGroup" - } - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [] - }, - "/dcim/rack-groups/{id}/": { - "get": { - "operationId": "dcim_rack-groups_read", - "description": "", - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/RackGroup" - } - } - }, - "tags": [ - "dcim" - ] - }, - "put": { - "operationId": "dcim_rack-groups_update", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableRackGroup" - } - } - ], - "responses": { - "200": { + "name": "status", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableRackGroup" - } - } - }, - "tags": [ - "dcim" - ] - }, - "patch": { - "operationId": "dcim_rack-groups_partial_update", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WritableRackGroup" - } - } - ], - "responses": { - "200": { + "name": "type", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/WritableRackGroup" - } - } - }, - "tags": [ - "dcim" - ] - }, - "delete": { - "operationId": "dcim_rack-groups_delete", - "description": "", - "parameters": [], - "responses": { - "204": { - "description": "" - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "A unique integer value identifying this rack group.", - "required": true, - "type": "integer" - } - ] - }, - "/dcim/rack-reservations/": { - "get": { - "operationId": "dcim_rack-reservations_list", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "created", + "name": "supply", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "id__in", + "name": "phase", "in": "query", - "description": "Multiple values may be separated by commas.", + "description": "", "required": false, "type": "string" }, { - "name": "q", + "name": "voltage", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "rack_id", + "name": "amperage", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site_id", + "name": "max_utilization", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site", + "name": "id__in", "in": "query", - "description": "", + "description": "Multiple values may be separated by commas.", "required": false, "type": "string" }, { - "name": "group_id", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "group", + "name": "site_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant_id", + "name": "site", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant", + "name": "power_panel_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "user_id", + "name": "rack_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "user", + "name": "tag", "in": "query", "description": "", "required": false, @@ -5694,7 +5860,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/RackReservation" + "$ref": "#/definitions/PowerFeed" } } } @@ -5706,7 +5872,7 @@ ] }, "post": { - "operationId": "dcim_rack-reservations_create", + "operationId": "dcim_power-feeds_create", "description": "", "parameters": [ { @@ -5714,7 +5880,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRackReservation" + "$ref": "#/definitions/WritablePowerFeed" } } ], @@ -5722,7 +5888,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableRackReservation" + "$ref": "#/definitions/PowerFeed" } } }, @@ -5732,16 +5898,16 @@ }, "parameters": [] }, - "/dcim/rack-reservations/{id}/": { + "/dcim/power-feeds/{id}/": { "get": { - "operationId": "dcim_rack-reservations_read", - "description": "", + "operationId": "dcim_power-feeds_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/RackReservation" + "$ref": "#/definitions/PowerFeed" } } }, @@ -5750,7 +5916,7 @@ ] }, "put": { - "operationId": "dcim_rack-reservations_update", + "operationId": "dcim_power-feeds_update", "description": "", "parameters": [ { @@ -5758,7 +5924,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRackReservation" + "$ref": "#/definitions/WritablePowerFeed" } } ], @@ -5766,7 +5932,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableRackReservation" + "$ref": "#/definitions/PowerFeed" } } }, @@ -5775,7 +5941,7 @@ ] }, "patch": { - "operationId": "dcim_rack-reservations_partial_update", + "operationId": "dcim_power-feeds_partial_update", "description": "", "parameters": [ { @@ -5783,7 +5949,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRackReservation" + "$ref": "#/definitions/WritablePowerFeed" } } ], @@ -5791,7 +5957,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableRackReservation" + "$ref": "#/definitions/PowerFeed" } } }, @@ -5800,7 +5966,7 @@ ] }, "delete": { - "operationId": "dcim_rack-reservations_delete", + "operationId": "dcim_power-feeds_delete", "description": "", "parameters": [], "responses": { @@ -5816,17 +5982,24 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this rack reservation.", + "description": "A unique integer value identifying this power feed.", "required": true, "type": "integer" } ] }, - "/dcim/rack-roles/": { + "/dcim/power-outlet-templates/": { "get": { - "operationId": "dcim_rack-roles_list", - "description": "", + "operationId": "dcim_power-outlet-templates_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "name", "in": "query", @@ -5835,14 +6008,21 @@ "type": "string" }, { - "name": "slug", + "name": "feed_leg", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "color", + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", "in": "query", "description": "", "required": false, @@ -5889,7 +6069,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/RackRole" + "$ref": "#/definitions/PowerOutletTemplate" } } } @@ -5901,7 +6081,7 @@ ] }, "post": { - "operationId": "dcim_rack-roles_create", + "operationId": "dcim_power-outlet-templates_create", "description": "", "parameters": [ { @@ -5909,7 +6089,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RackRole" + "$ref": "#/definitions/WritablePowerOutletTemplate" } } ], @@ -5917,7 +6097,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/RackRole" + "$ref": "#/definitions/PowerOutletTemplate" } } }, @@ -5927,16 +6107,16 @@ }, "parameters": [] }, - "/dcim/rack-roles/{id}/": { + "/dcim/power-outlet-templates/{id}/": { "get": { - "operationId": "dcim_rack-roles_read", - "description": "", + "operationId": "dcim_power-outlet-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/RackRole" + "$ref": "#/definitions/PowerOutletTemplate" } } }, @@ -5945,7 +6125,7 @@ ] }, "put": { - "operationId": "dcim_rack-roles_update", + "operationId": "dcim_power-outlet-templates_update", "description": "", "parameters": [ { @@ -5953,7 +6133,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RackRole" + "$ref": "#/definitions/WritablePowerOutletTemplate" } } ], @@ -5961,7 +6141,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/RackRole" + "$ref": "#/definitions/PowerOutletTemplate" } } }, @@ -5970,7 +6150,7 @@ ] }, "patch": { - "operationId": "dcim_rack-roles_partial_update", + "operationId": "dcim_power-outlet-templates_partial_update", "description": "", "parameters": [ { @@ -5978,7 +6158,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RackRole" + "$ref": "#/definitions/WritablePowerOutletTemplate" } } ], @@ -5986,7 +6166,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/RackRole" + "$ref": "#/definitions/PowerOutletTemplate" } } }, @@ -5995,7 +6175,7 @@ ] }, "delete": { - "operationId": "dcim_rack-roles_delete", + "operationId": "dcim_power-outlet-templates_delete", "description": "", "parameters": [], "responses": { @@ -6011,66 +6191,52 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this rack role.", + "description": "A unique integer value identifying this power outlet template.", "required": true, "type": "integer" } ] }, - "/dcim/racks/": { + "/dcim/power-outlets/": { "get": { - "operationId": "dcim_racks_list", - "description": "", + "operationId": "dcim_power-outlets_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "serial", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "type", + "name": "feed_leg", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "width", + "name": "description", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "u_height", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "desc_units", + "name": "connection_status", "in": "query", "description": "", "required": false, "type": "string" }, - { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, { "name": "q", "in": "query", @@ -6079,85 +6245,50 @@ "type": "string" }, { - "name": "facility_id", + "name": "device_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site_id", + "name": "device", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site", + "name": "tag", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "group_id", + "name": "cabled", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "group", + "name": "limit", "in": "query", - "description": "", + "description": "Number of results to return per page.", "required": false, - "type": "string" + "type": "integer" }, { - "name": "tenant_id", + "name": "offset", "in": "query", - "description": "", + "description": "The initial index from which to return the results.", "required": false, - "type": "string" - }, - { - "name": "tenant", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "role_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "role", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "description": "Number of results to return per page.", - "required": false, - "type": "integer" - }, - { - "name": "offset", - "in": "query", - "description": "The initial index from which to return the results.", - "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "integer" + } + ], + "responses": { + "200": { "description": "", "schema": { "required": [ @@ -6182,7 +6313,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Rack" + "$ref": "#/definitions/PowerOutlet" } } } @@ -6194,7 +6325,7 @@ ] }, "post": { - "operationId": "dcim_racks_create", + "operationId": "dcim_power-outlets_create", "description": "", "parameters": [ { @@ -6202,7 +6333,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRack" + "$ref": "#/definitions/WritablePowerOutlet" } } ], @@ -6210,7 +6341,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableRack" + "$ref": "#/definitions/PowerOutlet" } } }, @@ -6220,16 +6351,16 @@ }, "parameters": [] }, - "/dcim/racks/{id}/": { + "/dcim/power-outlets/{id}/": { "get": { - "operationId": "dcim_racks_read", - "description": "", + "operationId": "dcim_power-outlets_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Rack" + "$ref": "#/definitions/PowerOutlet" } } }, @@ -6238,7 +6369,7 @@ ] }, "put": { - "operationId": "dcim_racks_update", + "operationId": "dcim_power-outlets_update", "description": "", "parameters": [ { @@ -6246,7 +6377,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRack" + "$ref": "#/definitions/WritablePowerOutlet" } } ], @@ -6254,7 +6385,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableRack" + "$ref": "#/definitions/PowerOutlet" } } }, @@ -6263,7 +6394,7 @@ ] }, "patch": { - "operationId": "dcim_racks_partial_update", + "operationId": "dcim_power-outlets_partial_update", "description": "", "parameters": [ { @@ -6271,7 +6402,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRack" + "$ref": "#/definitions/WritablePowerOutlet" } } ], @@ -6279,7 +6410,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableRack" + "$ref": "#/definitions/PowerOutlet" } } }, @@ -6288,7 +6419,7 @@ ] }, "delete": { - "operationId": "dcim_racks_delete", + "operationId": "dcim_power-outlets_delete", "description": "", "parameters": [], "responses": { @@ -6304,22 +6435,22 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this rack.", + "description": "A unique integer value identifying this power outlet.", "required": true, "type": "integer" } ] }, - "/dcim/racks/{id}/units/": { + "/dcim/power-outlets/{id}/trace/": { "get": { - "operationId": "dcim_racks_units", - "description": "List rack units (by rack)", + "operationId": "dcim_power-outlets_trace", + "description": "Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination).", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Rack" + "$ref": "#/definitions/PowerOutlet" } } }, @@ -6331,16 +6462,16 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this rack.", + "description": "A unique integer value identifying this power outlet.", "required": true, "type": "integer" } ] }, - "/dcim/regions/": { + "/dcim/power-panels/": { "get": { - "operationId": "dcim_regions_list", - "description": "", + "operationId": "dcim_power-panels_list", + "description": "Call to super to allow for caching", "parameters": [ { "name": "name", @@ -6350,9 +6481,9 @@ "type": "string" }, { - "name": "slug", + "name": "id__in", "in": "query", - "description": "", + "description": "Multiple values may be separated by commas.", "required": false, "type": "string" }, @@ -6364,14 +6495,21 @@ "type": "string" }, { - "name": "parent_id", + "name": "site_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "parent", + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rack_group_id", "in": "query", "description": "", "required": false, @@ -6418,7 +6556,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Region" + "$ref": "#/definitions/PowerPanel" } } } @@ -6430,7 +6568,7 @@ ] }, "post": { - "operationId": "dcim_regions_create", + "operationId": "dcim_power-panels_create", "description": "", "parameters": [ { @@ -6438,7 +6576,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRegion" + "$ref": "#/definitions/WritablePowerPanel" } } ], @@ -6446,7 +6584,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableRegion" + "$ref": "#/definitions/PowerPanel" } } }, @@ -6456,16 +6594,16 @@ }, "parameters": [] }, - "/dcim/regions/{id}/": { + "/dcim/power-panels/{id}/": { "get": { - "operationId": "dcim_regions_read", - "description": "", + "operationId": "dcim_power-panels_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Region" + "$ref": "#/definitions/PowerPanel" } } }, @@ -6474,7 +6612,7 @@ ] }, "put": { - "operationId": "dcim_regions_update", + "operationId": "dcim_power-panels_update", "description": "", "parameters": [ { @@ -6482,7 +6620,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRegion" + "$ref": "#/definitions/WritablePowerPanel" } } ], @@ -6490,7 +6628,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableRegion" + "$ref": "#/definitions/PowerPanel" } } }, @@ -6499,7 +6637,7 @@ ] }, "patch": { - "operationId": "dcim_regions_partial_update", + "operationId": "dcim_power-panels_partial_update", "description": "", "parameters": [ { @@ -6507,7 +6645,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableRegion" + "$ref": "#/definitions/WritablePowerPanel" } } ], @@ -6515,7 +6653,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableRegion" + "$ref": "#/definitions/PowerPanel" } } }, @@ -6524,7 +6662,7 @@ ] }, "delete": { - "operationId": "dcim_regions_delete", + "operationId": "dcim_power-panels_delete", "description": "", "parameters": [], "responses": { @@ -6540,19 +6678,19 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this region.", + "description": "A unique integer value identifying this power panel.", "required": true, "type": "integer" } ] }, - "/dcim/sites/": { + "/dcim/power-port-templates/": { "get": { - "operationId": "dcim_sites_list", - "description": "", + "operationId": "dcim_power-port-templates_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "q", + "name": "id", "in": "query", "description": "", "required": false, @@ -6566,84 +6704,28 @@ "type": "string" }, { - "name": "slug", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "facility", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "asn", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "contact_name", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "contact_phone", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "contact_email", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, - { - "name": "status", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "region_id", + "name": "maximum_draw", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "region", + "name": "allocated_draw", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant_id", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant", + "name": "devicetype_id", "in": "query", "description": "", "required": false, @@ -6690,7 +6772,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Site" + "$ref": "#/definitions/PowerPortTemplate" } } } @@ -6702,7 +6784,7 @@ ] }, "post": { - "operationId": "dcim_sites_create", + "operationId": "dcim_power-port-templates_create", "description": "", "parameters": [ { @@ -6710,7 +6792,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableSite" + "$ref": "#/definitions/WritablePowerPortTemplate" } } ], @@ -6718,7 +6800,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableSite" + "$ref": "#/definitions/PowerPortTemplate" } } }, @@ -6728,16 +6810,16 @@ }, "parameters": [] }, - "/dcim/sites/{id}/": { + "/dcim/power-port-templates/{id}/": { "get": { - "operationId": "dcim_sites_read", - "description": "", + "operationId": "dcim_power-port-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Site" + "$ref": "#/definitions/PowerPortTemplate" } } }, @@ -6746,7 +6828,7 @@ ] }, "put": { - "operationId": "dcim_sites_update", + "operationId": "dcim_power-port-templates_update", "description": "", "parameters": [ { @@ -6754,7 +6836,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableSite" + "$ref": "#/definitions/WritablePowerPortTemplate" } } ], @@ -6762,7 +6844,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableSite" + "$ref": "#/definitions/PowerPortTemplate" } } }, @@ -6771,7 +6853,7 @@ ] }, "patch": { - "operationId": "dcim_sites_partial_update", + "operationId": "dcim_power-port-templates_partial_update", "description": "", "parameters": [ { @@ -6779,7 +6861,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableSite" + "$ref": "#/definitions/WritablePowerPortTemplate" } } ], @@ -6787,7 +6869,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableSite" + "$ref": "#/definitions/PowerPortTemplate" } } }, @@ -6796,7 +6878,7 @@ ] }, "delete": { - "operationId": "dcim_sites_delete", + "operationId": "dcim_power-port-templates_delete", "description": "", "parameters": [], "responses": { @@ -6812,66 +6894,116 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this site.", - "required": true, - "type": "integer" - } - ] - }, - "/dcim/sites/{id}/graphs/": { - "get": { - "operationId": "dcim_sites_graphs", - "description": "A convenience method for rendering graphs for a particular site.", - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/Site" - } - } - }, - "tags": [ - "dcim" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "A unique integer value identifying this site.", + "description": "A unique integer value identifying this power port template.", "required": true, "type": "integer" } ] }, - "/dcim/virtual-chassis/": { + "/dcim/power-ports/": { "get": { - "operationId": "dcim_virtual-chassis_list", - "description": "", + "operationId": "dcim_power-ports_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "limit", + "name": "id", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "name", "in": "query", - "description": "The initial index from which to return the results.", + "description": "", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "maximum_draw", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" + "required": false, + "type": "string" + }, + { + "name": "allocated_draw", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "description", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "connection_status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cabled", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" ], "type": "object", "properties": { @@ -6891,7 +7023,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/VirtualChassis" + "$ref": "#/definitions/PowerPort" } } } @@ -6903,7 +7035,7 @@ ] }, "post": { - "operationId": "dcim_virtual-chassis_create", + "operationId": "dcim_power-ports_create", "description": "", "parameters": [ { @@ -6911,7 +7043,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVirtualChassis" + "$ref": "#/definitions/WritablePowerPort" } } ], @@ -6919,7 +7051,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableVirtualChassis" + "$ref": "#/definitions/PowerPort" } } }, @@ -6929,16 +7061,16 @@ }, "parameters": [] }, - "/dcim/virtual-chassis/{id}/": { + "/dcim/power-ports/{id}/": { "get": { - "operationId": "dcim_virtual-chassis_read", - "description": "", + "operationId": "dcim_power-ports_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/VirtualChassis" + "$ref": "#/definitions/PowerPort" } } }, @@ -6947,7 +7079,7 @@ ] }, "put": { - "operationId": "dcim_virtual-chassis_update", + "operationId": "dcim_power-ports_update", "description": "", "parameters": [ { @@ -6955,7 +7087,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVirtualChassis" + "$ref": "#/definitions/WritablePowerPort" } } ], @@ -6963,7 +7095,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVirtualChassis" + "$ref": "#/definitions/PowerPort" } } }, @@ -6972,7 +7104,7 @@ ] }, "patch": { - "operationId": "dcim_virtual-chassis_partial_update", + "operationId": "dcim_power-ports_partial_update", "description": "", "parameters": [ { @@ -6980,7 +7112,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVirtualChassis" + "$ref": "#/definitions/WritablePowerPort" } } ], @@ -6988,7 +7120,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVirtualChassis" + "$ref": "#/definitions/PowerPort" } } }, @@ -6997,7 +7129,7 @@ ] }, "delete": { - "operationId": "dcim_virtual-chassis_delete", + "operationId": "dcim_power-ports_delete", "description": "", "parameters": [], "responses": { @@ -7013,58 +7145,46 @@ { "name": "id", "in": "path", - "description": "A unique integer value identifying this virtual chassis.", + "description": "A unique integer value identifying this power port.", "required": true, "type": "integer" } ] }, - "/extras/_choices/": { - "get": { - "operationId": "extras__choices_list", - "description": "", - "parameters": [], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "extras" - ] - }, - "parameters": [] - }, - "/extras/_choices/{id}/": { + "/dcim/power-ports/{id}/trace/": { "get": { - "operationId": "extras__choices_read", - "description": "", + "operationId": "dcim_power-ports_trace", + "description": "Trace a complete cable path and return each segment as a three-tuple of (termination, cable, termination).", "parameters": [], "responses": { "200": { - "description": "" + "description": "", + "schema": { + "$ref": "#/definitions/PowerPort" + } } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", + "description": "A unique integer value identifying this power port.", "required": true, - "type": "string" + "type": "integer" } ] }, - "/extras/export-templates/": { + "/dcim/rack-groups/": { "get": { - "operationId": "extras_export-templates_list", - "description": "", + "operationId": "dcim_rack-groups_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "content_type", + "name": "id", "in": "query", "description": "", "required": false, @@ -7077,6 +7197,34 @@ "required": false, "type": "string" }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -7118,7 +7266,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/ExportTemplate" + "$ref": "#/definitions/RackGroup" } } } @@ -7126,11 +7274,11 @@ } }, "tags": [ - "extras" + "dcim" ] }, "post": { - "operationId": "extras_export-templates_create", + "operationId": "dcim_rack-groups_create", "description": "", "parameters": [ { @@ -7138,7 +7286,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ExportTemplate" + "$ref": "#/definitions/WritableRackGroup" } } ], @@ -7146,35 +7294,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/ExportTemplate" + "$ref": "#/definitions/RackGroup" } } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [] }, - "/extras/export-templates/{id}/": { + "/dcim/rack-groups/{id}/": { "get": { - "operationId": "extras_export-templates_read", - "description": "", + "operationId": "dcim_rack-groups_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/ExportTemplate" + "$ref": "#/definitions/RackGroup" } } }, "tags": [ - "extras" + "dcim" ] }, "put": { - "operationId": "extras_export-templates_update", + "operationId": "dcim_rack-groups_update", "description": "", "parameters": [ { @@ -7182,7 +7330,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ExportTemplate" + "$ref": "#/definitions/WritableRackGroup" } } ], @@ -7190,16 +7338,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/ExportTemplate" + "$ref": "#/definitions/RackGroup" } } }, "tags": [ - "extras" + "dcim" ] }, "patch": { - "operationId": "extras_export-templates_partial_update", + "operationId": "dcim_rack-groups_partial_update", "description": "", "parameters": [ { @@ -7207,7 +7355,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ExportTemplate" + "$ref": "#/definitions/WritableRackGroup" } } ], @@ -7215,16 +7363,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/ExportTemplate" + "$ref": "#/definitions/RackGroup" } } }, "tags": [ - "extras" + "dcim" ] }, "delete": { - "operationId": "extras_export-templates_delete", + "operationId": "dcim_rack-groups_delete", "description": "", "parameters": [], "responses": { @@ -7233,71 +7381,155 @@ } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this export template.", + "description": "A unique integer value identifying this rack group.", "required": true, "type": "integer" } ] }, - "/extras/graphs/": { + "/dcim/rack-reservations/": { "get": { - "operationId": "extras_graphs_list", - "description": "", + "operationId": "dcim_rack-reservations_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "type", + "name": "created", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "name", + "name": "tenant_group_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "limit", + "name": "tenant_group", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "tenant_id", "in": "query", - "description": "The initial index from which to return the results.", + "description": "", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "tenant", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "next": { - "type": "string", - "format": "uri", - "x-nullable": true - }, + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rack_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "user", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, "previous": { "type": "string", "format": "uri", @@ -7306,7 +7538,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Graph" + "$ref": "#/definitions/RackReservation" } } } @@ -7314,11 +7546,11 @@ } }, "tags": [ - "extras" + "dcim" ] }, "post": { - "operationId": "extras_graphs_create", + "operationId": "dcim_rack-reservations_create", "description": "", "parameters": [ { @@ -7326,7 +7558,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableGraph" + "$ref": "#/definitions/WritableRackReservation" } } ], @@ -7334,35 +7566,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableGraph" + "$ref": "#/definitions/RackReservation" } } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [] }, - "/extras/graphs/{id}/": { + "/dcim/rack-reservations/{id}/": { "get": { - "operationId": "extras_graphs_read", - "description": "", + "operationId": "dcim_rack-reservations_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Graph" + "$ref": "#/definitions/RackReservation" } } }, "tags": [ - "extras" + "dcim" ] }, "put": { - "operationId": "extras_graphs_update", + "operationId": "dcim_rack-reservations_update", "description": "", "parameters": [ { @@ -7370,7 +7602,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableGraph" + "$ref": "#/definitions/WritableRackReservation" } } ], @@ -7378,16 +7610,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableGraph" + "$ref": "#/definitions/RackReservation" } } }, "tags": [ - "extras" + "dcim" ] }, "patch": { - "operationId": "extras_graphs_partial_update", + "operationId": "dcim_rack-reservations_partial_update", "description": "", "parameters": [ { @@ -7395,7 +7627,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableGraph" + "$ref": "#/definitions/WritableRackReservation" } } ], @@ -7403,16 +7635,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableGraph" + "$ref": "#/definitions/RackReservation" } } }, "tags": [ - "extras" + "dcim" ] }, "delete": { - "operationId": "extras_graphs_delete", + "operationId": "dcim_rack-reservations_delete", "description": "", "parameters": [], "responses": { @@ -7421,24 +7653,59 @@ } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this graph.", + "description": "A unique integer value identifying this rack reservation.", "required": true, "type": "integer" } ] }, - "/extras/image-attachments/": { + "/dcim/rack-roles/": { "get": { - "operationId": "extras_image-attachments_list", - "description": "", + "operationId": "dcim_rack-roles_list", + "description": "Call to super to allow for caching", "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "color", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -7480,7 +7747,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/ImageAttachment" + "$ref": "#/definitions/RackRole" } } } @@ -7488,11 +7755,11 @@ } }, "tags": [ - "extras" + "dcim" ] }, "post": { - "operationId": "extras_image-attachments_create", + "operationId": "dcim_rack-roles_create", "description": "", "parameters": [ { @@ -7500,7 +7767,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableImageAttachment" + "$ref": "#/definitions/RackRole" } } ], @@ -7508,35 +7775,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableImageAttachment" + "$ref": "#/definitions/RackRole" } } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [] }, - "/extras/image-attachments/{id}/": { + "/dcim/rack-roles/{id}/": { "get": { - "operationId": "extras_image-attachments_read", - "description": "", + "operationId": "dcim_rack-roles_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/ImageAttachment" + "$ref": "#/definitions/RackRole" } } }, "tags": [ - "extras" + "dcim" ] }, "put": { - "operationId": "extras_image-attachments_update", + "operationId": "dcim_rack-roles_update", "description": "", "parameters": [ { @@ -7544,7 +7811,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableImageAttachment" + "$ref": "#/definitions/RackRole" } } ], @@ -7552,16 +7819,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableImageAttachment" + "$ref": "#/definitions/RackRole" } } }, "tags": [ - "extras" + "dcim" ] }, "patch": { - "operationId": "extras_image-attachments_partial_update", + "operationId": "dcim_rack-roles_partial_update", "description": "", "parameters": [ { @@ -7569,7 +7836,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableImageAttachment" + "$ref": "#/definitions/RackRole" } } ], @@ -7577,16 +7844,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableImageAttachment" + "$ref": "#/definitions/RackRole" } } }, "tags": [ - "extras" + "dcim" ] }, "delete": { - "operationId": "extras_image-attachments_delete", + "operationId": "dcim_rack-roles_delete", "description": "", "parameters": [], "responses": { @@ -7595,133 +7862,145 @@ } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this image attachment.", + "description": "A unique integer value identifying this rack role.", "required": true, "type": "integer" } ] }, - "/extras/recent-activity/": { + "/dcim/racks/": { "get": { - "operationId": "extras_recent-activity_list", - "description": "List all UserActions to provide a log of recent activity.", + "operationId": "dcim_racks_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "user", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "username", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "limit", + "name": "facility_id", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "serial", "in": "query", - "description": "The initial index from which to return the results.", + "description": "", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "asset_tag", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "next": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "previous": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/UserAction" - } - } - } - } - } - }, - "tags": [ - "extras" - ] - }, - "parameters": [] - }, - "/extras/recent-activity/{id}/": { - "get": { - "operationId": "extras_recent-activity_read", - "description": "List all UserActions to provide a log of recent activity.", - "parameters": [], - "responses": { - "200": { + "required": false, + "type": "string" + }, + { + "name": "type", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/UserAction" - } - } - }, - "tags": [ - "extras" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "A unique integer value identifying this user action.", - "required": true, - "type": "integer" - } - ] - }, - "/extras/topology-maps/": { - "get": { - "operationId": "extras_topology-maps_list", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "name", + "name": "width", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "slug", + "name": "u_height", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "desc_units", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "outer_width", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "outer_depth", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "outer_unit", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", "in": "query", "description": "", "required": false, @@ -7741,6 +8020,48 @@ "required": false, "type": "string" }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -7782,7 +8103,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/TopologyMap" + "$ref": "#/definitions/Rack" } } } @@ -7790,11 +8111,11 @@ } }, "tags": [ - "extras" + "dcim" ] }, "post": { - "operationId": "extras_topology-maps_create", + "operationId": "dcim_racks_create", "description": "", "parameters": [ { @@ -7802,7 +8123,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableTopologyMap" + "$ref": "#/definitions/WritableRack" } } ], @@ -7810,35 +8131,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableTopologyMap" + "$ref": "#/definitions/Rack" } } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [] }, - "/extras/topology-maps/{id}/": { + "/dcim/racks/{id}/": { "get": { - "operationId": "extras_topology-maps_read", - "description": "", + "operationId": "dcim_racks_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/TopologyMap" + "$ref": "#/definitions/Rack" } } }, "tags": [ - "extras" + "dcim" ] }, "put": { - "operationId": "extras_topology-maps_update", + "operationId": "dcim_racks_update", "description": "", "parameters": [ { @@ -7846,7 +8167,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableTopologyMap" + "$ref": "#/definitions/WritableRack" } } ], @@ -7854,16 +8175,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableTopologyMap" + "$ref": "#/definitions/Rack" } } }, "tags": [ - "extras" + "dcim" ] }, "patch": { - "operationId": "extras_topology-maps_partial_update", + "operationId": "dcim_racks_partial_update", "description": "", "parameters": [ { @@ -7871,7 +8192,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableTopologyMap" + "$ref": "#/definitions/WritableRack" } } ], @@ -7879,16 +8200,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableTopologyMap" + "$ref": "#/definitions/Rack" } } }, "tags": [ - "extras" + "dcim" ] }, "delete": { - "operationId": "extras_topology-maps_delete", + "operationId": "dcim_racks_delete", "description": "", "parameters": [], "responses": { @@ -7897,127 +8218,88 @@ } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this topology map.", + "description": "A unique integer value identifying this rack.", "required": true, "type": "integer" } ] }, - "/extras/topology-maps/{id}/render/": { + "/dcim/racks/{id}/units/": { "get": { - "operationId": "extras_topology-maps_render", - "description": "", + "operationId": "dcim_racks_units", + "description": "List rack units (by rack)", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/TopologyMap" + "$ref": "#/definitions/Rack" } } }, "tags": [ - "extras" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this topology map.", + "description": "A unique integer value identifying this rack.", "required": true, "type": "integer" } ] }, - "/ipam/_choices/": { - "get": { - "operationId": "ipam__choices_list", - "description": "", - "parameters": [], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "ipam" - ] - }, - "parameters": [] - }, - "/ipam/_choices/{id}/": { + "/dcim/rear-port-templates/": { "get": { - "operationId": "ipam__choices_read", - "description": "", - "parameters": [], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "ipam" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ] - }, - "/ipam/aggregates/": { - "get": { - "operationId": "ipam_aggregates_list", - "description": "", + "operationId": "dcim_rear-port-templates_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "family", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "date_added", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "id__in", + "name": "type", "in": "query", - "description": "Multiple values may be separated by commas.", + "description": "", "required": false, "type": "string" }, { - "name": "q", + "name": "positions", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "rir_id", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "rir", + "name": "devicetype_id", "in": "query", "description": "", "required": false, @@ -8064,7 +8346,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Aggregate" + "$ref": "#/definitions/RearPortTemplate" } } } @@ -8072,11 +8354,11 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "post": { - "operationId": "ipam_aggregates_create", + "operationId": "dcim_rear-port-templates_create", "description": "", "parameters": [ { @@ -8084,7 +8366,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableAggregate" + "$ref": "#/definitions/WritableRearPortTemplate" } } ], @@ -8092,35 +8374,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableAggregate" + "$ref": "#/definitions/RearPortTemplate" } } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [] }, - "/ipam/aggregates/{id}/": { + "/dcim/rear-port-templates/{id}/": { "get": { - "operationId": "ipam_aggregates_read", - "description": "", + "operationId": "dcim_rear-port-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Aggregate" + "$ref": "#/definitions/RearPortTemplate" } } }, "tags": [ - "ipam" + "dcim" ] }, "put": { - "operationId": "ipam_aggregates_update", + "operationId": "dcim_rear-port-templates_update", "description": "", "parameters": [ { @@ -8128,7 +8410,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableAggregate" + "$ref": "#/definitions/WritableRearPortTemplate" } } ], @@ -8136,16 +8418,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableAggregate" + "$ref": "#/definitions/RearPortTemplate" } } }, "tags": [ - "ipam" + "dcim" ] }, "patch": { - "operationId": "ipam_aggregates_partial_update", + "operationId": "dcim_rear-port-templates_partial_update", "description": "", "parameters": [ { @@ -8153,7 +8435,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableAggregate" + "$ref": "#/definitions/WritableRearPortTemplate" } } ], @@ -8161,16 +8443,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableAggregate" + "$ref": "#/definitions/RearPortTemplate" } } }, "tags": [ - "ipam" + "dcim" ] }, "delete": { - "operationId": "ipam_aggregates_delete", + "operationId": "dcim_rear-port-templates_delete", "description": "", "parameters": [], "responses": { @@ -8179,89 +8461,61 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this aggregate.", + "description": "A unique integer value identifying this rear port template.", "required": true, "type": "integer" } ] }, - "/ipam/ip-addresses/": { + "/dcim/rear-ports/": { "get": { - "operationId": "ipam_ip-addresses_list", - "description": "", + "operationId": "dcim_rear-ports_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "family", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "parent", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "mask_length", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "vrf_id", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "vrf", + "name": "type", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant_id", + "name": "positions", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant", + "name": "description", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "q", "in": "query", "description": "", "required": false, @@ -8272,38 +8526,24 @@ "in": "query", "description": "", "required": false, - "type": "number" - }, - { - "name": "virtual_machine_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "virtual_machine", - "in": "query", - "description": "", - "required": false, "type": "string" }, { - "name": "interface_id", + "name": "device", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "status", + "name": "tag", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "role", + "name": "cabled", "in": "query", "description": "", "required": false, @@ -8350,7 +8590,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/IPAddress" + "$ref": "#/definitions/RearPort" } } } @@ -8358,11 +8598,11 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "post": { - "operationId": "ipam_ip-addresses_create", + "operationId": "dcim_rear-ports_create", "description": "", "parameters": [ { @@ -8370,7 +8610,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableIPAddress" + "$ref": "#/definitions/WritableRearPort" } } ], @@ -8378,35 +8618,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableIPAddress" + "$ref": "#/definitions/RearPort" } } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [] }, - "/ipam/ip-addresses/{id}/": { + "/dcim/rear-ports/{id}/": { "get": { - "operationId": "ipam_ip-addresses_read", - "description": "", + "operationId": "dcim_rear-ports_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/IPAddress" + "$ref": "#/definitions/RearPort" } } }, "tags": [ - "ipam" + "dcim" ] }, "put": { - "operationId": "ipam_ip-addresses_update", + "operationId": "dcim_rear-ports_update", "description": "", "parameters": [ { @@ -8414,7 +8654,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableIPAddress" + "$ref": "#/definitions/WritableRearPort" } } ], @@ -8422,16 +8662,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableIPAddress" + "$ref": "#/definitions/RearPort" } } }, "tags": [ - "ipam" + "dcim" ] }, "patch": { - "operationId": "ipam_ip-addresses_partial_update", + "operationId": "dcim_rear-ports_partial_update", "description": "", "parameters": [ { @@ -8439,7 +8679,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableIPAddress" + "$ref": "#/definitions/WritableRearPort" } } ], @@ -8447,16 +8687,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableIPAddress" + "$ref": "#/definitions/RearPort" } } }, "tags": [ - "ipam" + "dcim" ] }, "delete": { - "operationId": "ipam_ip-addresses_delete", + "operationId": "dcim_rear-ports_delete", "description": "", "parameters": [], "responses": { @@ -8465,152 +8705,61 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this IP address.", + "description": "A unique integer value identifying this rear port.", "required": true, "type": "integer" } ] }, - "/ipam/prefixes/": { + "/dcim/regions/": { "get": { - "operationId": "ipam_prefixes_list", - "description": "", + "operationId": "dcim_regions_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "family", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "is_pool", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "within", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "within_include", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "contains", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "mask_length", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "vrf_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "vrf", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "tenant_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "tenant", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "site", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "vlan_id", + "name": "slug", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "vlan_vid", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "role_id", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "role", + "name": "parent_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "status", + "name": "parent", "in": "query", "description": "", "required": false, @@ -8657,7 +8806,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Prefix" + "$ref": "#/definitions/Region" } } } @@ -8665,11 +8814,11 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "post": { - "operationId": "ipam_prefixes_create", + "operationId": "dcim_regions_create", "description": "", "parameters": [ { @@ -8677,7 +8826,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePrefix" + "$ref": "#/definitions/WritableRegion" } } ], @@ -8685,35 +8834,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritablePrefix" + "$ref": "#/definitions/Region" } } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [] }, - "/ipam/prefixes/{id}/": { + "/dcim/regions/{id}/": { "get": { - "operationId": "ipam_prefixes_read", - "description": "", + "operationId": "dcim_regions_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Prefix" + "$ref": "#/definitions/Region" } } }, "tags": [ - "ipam" + "dcim" ] }, "put": { - "operationId": "ipam_prefixes_update", + "operationId": "dcim_regions_update", "description": "", "parameters": [ { @@ -8721,7 +8870,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePrefix" + "$ref": "#/definitions/WritableRegion" } } ], @@ -8729,16 +8878,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePrefix" + "$ref": "#/definitions/Region" } } }, "tags": [ - "ipam" + "dcim" ] }, "patch": { - "operationId": "ipam_prefixes_partial_update", + "operationId": "dcim_regions_partial_update", "description": "", "parameters": [ { @@ -8746,7 +8895,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritablePrefix" + "$ref": "#/definitions/WritableRegion" } } ], @@ -8754,16 +8903,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritablePrefix" + "$ref": "#/definitions/Region" } } }, "tags": [ - "ipam" + "dcim" ] }, "delete": { - "operationId": "ipam_prefixes_delete", + "operationId": "dcim_regions_delete", "description": "", "parameters": [], "responses": { @@ -8772,144 +8921,117 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this prefix.", + "description": "A unique integer value identifying this region.", "required": true, "type": "integer" } ] }, - "/ipam/prefixes/{id}/available-ips/": { + "/dcim/sites/": { "get": { - "operationId": "ipam_prefixes_available-ips_read", - "description": "A convenience method for returning available IP addresses within a prefix. By default, the number of IPs\nreturned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be passed,\nhowever results will not be paginated.", - "parameters": [], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/Prefix" - } - } - }, - "tags": [ - "ipam" - ] - }, - "post": { - "operationId": "ipam_prefixes_available-ips_create", - "description": "A convenience method for returning available IP addresses within a prefix. By default, the number of IPs\nreturned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be passed,\nhowever results will not be paginated.", + "operationId": "dcim_sites_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Prefix" - } - } - ], - "responses": { - "201": { + "name": "id", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/Prefix" - } - } - }, - "tags": [ - "ipam" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "A unique integer value identifying this prefix.", - "required": true, - "type": "integer" - } - ] - }, - "/ipam/prefixes/{id}/available-prefixes/": { - "get": { - "operationId": "ipam_prefixes_available-prefixes_read", - "description": "A convenience method for returning available child prefixes within a parent.", - "parameters": [], - "responses": { - "200": { + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/Prefix" - } - } - }, - "tags": [ - "ipam" - ] - }, - "post": { - "operationId": "ipam_prefixes_available-prefixes_create", - "description": "A convenience method for returning available child prefixes within a parent.", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Prefix" - } - } - ], - "responses": { - "201": { + "name": "slug", + "in": "query", "description": "", - "schema": { - "$ref": "#/definitions/Prefix" - } - } - }, - "tags": [ - "ipam" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "description": "A unique integer value identifying this prefix.", - "required": true, - "type": "integer" - } - ] - }, - "/ipam/rirs/": { - "get": { - "operationId": "ipam_rirs_list", - "description": "", - "parameters": [ + "required": false, + "type": "string" + }, { - "name": "name", + "name": "facility", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "slug", + "name": "asn", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "is_private", + "name": "latitude", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "longitude", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "contact_name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "contact_phone", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "contact_email", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", "in": "query", "description": "", "required": false, @@ -8922,6 +9044,41 @@ "required": false, "type": "string" }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "region_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "region", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -8963,7 +9120,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/RIR" + "$ref": "#/definitions/Site" } } } @@ -8971,11 +9128,11 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "post": { - "operationId": "ipam_rirs_create", + "operationId": "dcim_sites_create", "description": "", "parameters": [ { @@ -8983,7 +9140,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RIR" + "$ref": "#/definitions/WritableSite" } } ], @@ -8991,35 +9148,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/RIR" + "$ref": "#/definitions/Site" } } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [] }, - "/ipam/rirs/{id}/": { + "/dcim/sites/{id}/": { "get": { - "operationId": "ipam_rirs_read", - "description": "", + "operationId": "dcim_sites_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/RIR" + "$ref": "#/definitions/Site" } } }, "tags": [ - "ipam" + "dcim" ] }, "put": { - "operationId": "ipam_rirs_update", + "operationId": "dcim_sites_update", "description": "", "parameters": [ { @@ -9027,7 +9184,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RIR" + "$ref": "#/definitions/WritableSite" } } ], @@ -9035,16 +9192,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/RIR" + "$ref": "#/definitions/Site" } } }, "tags": [ - "ipam" + "dcim" ] }, "patch": { - "operationId": "ipam_rirs_partial_update", + "operationId": "dcim_sites_partial_update", "description": "", "parameters": [ { @@ -9052,7 +9209,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/RIR" + "$ref": "#/definitions/WritableSite" } } ], @@ -9060,16 +9217,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/RIR" + "$ref": "#/definitions/Site" } } }, "tags": [ - "ipam" + "dcim" ] }, "delete": { - "operationId": "ipam_rirs_delete", + "operationId": "dcim_sites_delete", "description": "", "parameters": [], "responses": { @@ -9078,38 +9235,51 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this RIR.", + "description": "A unique integer value identifying this site.", "required": true, "type": "integer" } ] }, - "/ipam/roles/": { + "/dcim/sites/{id}/graphs/": { "get": { - "operationId": "ipam_roles_list", - "description": "", - "parameters": [ - { - "name": "name", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "slug", - "in": "query", + "operationId": "dcim_sites_graphs", + "description": "A convenience method for rendering graphs for a particular site.", + "parameters": [], + "responses": { + "200": { "description": "", - "required": false, - "type": "string" - }, + "schema": { + "$ref": "#/definitions/Site" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this site.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/virtual-chassis/": { + "get": { + "operationId": "dcim_virtual-chassis_list", + "description": "Call to super to allow for caching", + "parameters": [ { "name": "limit", "in": "query", @@ -9151,7 +9321,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Role" + "$ref": "#/definitions/VirtualChassis" } } } @@ -9159,11 +9329,11 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "post": { - "operationId": "ipam_roles_create", + "operationId": "dcim_virtual-chassis_create", "description": "", "parameters": [ { @@ -9171,7 +9341,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Role" + "$ref": "#/definitions/WritableVirtualChassis" } } ], @@ -9179,35 +9349,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/Role" + "$ref": "#/definitions/VirtualChassis" } } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [] }, - "/ipam/roles/{id}/": { + "/dcim/virtual-chassis/{id}/": { "get": { - "operationId": "ipam_roles_read", - "description": "", + "operationId": "dcim_virtual-chassis_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Role" + "$ref": "#/definitions/VirtualChassis" } } }, "tags": [ - "ipam" + "dcim" ] }, "put": { - "operationId": "ipam_roles_update", + "operationId": "dcim_virtual-chassis_update", "description": "", "parameters": [ { @@ -9215,7 +9385,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Role" + "$ref": "#/definitions/WritableVirtualChassis" } } ], @@ -9223,16 +9393,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/Role" + "$ref": "#/definitions/VirtualChassis" } } }, "tags": [ - "ipam" + "dcim" ] }, "patch": { - "operationId": "ipam_roles_partial_update", + "operationId": "dcim_virtual-chassis_partial_update", "description": "", "parameters": [ { @@ -9240,7 +9410,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Role" + "$ref": "#/definitions/WritableVirtualChassis" } } ], @@ -9248,16 +9418,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/Role" + "$ref": "#/definitions/VirtualChassis" } } }, "tags": [ - "ipam" + "dcim" ] }, "delete": { - "operationId": "ipam_roles_delete", + "operationId": "dcim_virtual-chassis_delete", "description": "", "parameters": [], "responses": { @@ -9266,23 +9436,101 @@ } }, "tags": [ - "ipam" + "dcim" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this role.", + "description": "A unique integer value identifying this virtual chassis.", "required": true, "type": "integer" } ] }, - "/ipam/services/": { + "/extras/_choices/": { "get": { - "operationId": "ipam_services_list", + "operationId": "extras__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [] + }, + "/extras/_choices/{id}/": { + "get": { + "operationId": "extras__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/extras/_custom_field_choices/": { + "get": { + "operationId": "extras__custom_field_choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [] + }, + "/extras/_custom_field_choices/{id}/": { + "get": { + "operationId": "extras__custom_field_choices_read", "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/extras/config-contexts/": { + "get": { + "operationId": "extras_config-contexts_list", + "description": "Call to super to allow for caching", "parameters": [ { "name": "name", @@ -9292,42 +9540,98 @@ "type": "string" }, { - "name": "protocol", + "name": "is_active", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "port", + "name": "q", "in": "query", "description": "", "required": false, - "type": "number" + "type": "string" }, { - "name": "device_id", + "name": "region_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "region", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "virtual_machine_id", + "name": "site_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "virtual_machine", + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "platform_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "platform", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", "in": "query", "description": "", "required": false, @@ -9374,7 +9678,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Service" + "$ref": "#/definitions/ConfigContext" } } } @@ -9382,11 +9686,11 @@ } }, "tags": [ - "ipam" + "extras" ] }, "post": { - "operationId": "ipam_services_create", + "operationId": "extras_config-contexts_create", "description": "", "parameters": [ { @@ -9394,7 +9698,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableService" + "$ref": "#/definitions/WritableConfigContext" } } ], @@ -9402,35 +9706,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableService" + "$ref": "#/definitions/ConfigContext" } } }, "tags": [ - "ipam" + "extras" ] }, "parameters": [] }, - "/ipam/services/{id}/": { + "/extras/config-contexts/{id}/": { "get": { - "operationId": "ipam_services_read", - "description": "", + "operationId": "extras_config-contexts_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Service" + "$ref": "#/definitions/ConfigContext" } } }, "tags": [ - "ipam" + "extras" ] }, "put": { - "operationId": "ipam_services_update", + "operationId": "extras_config-contexts_update", "description": "", "parameters": [ { @@ -9438,7 +9742,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableService" + "$ref": "#/definitions/WritableConfigContext" } } ], @@ -9446,16 +9750,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableService" + "$ref": "#/definitions/ConfigContext" } } }, "tags": [ - "ipam" + "extras" ] }, "patch": { - "operationId": "ipam_services_partial_update", + "operationId": "extras_config-contexts_partial_update", "description": "", "parameters": [ { @@ -9463,7 +9767,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableService" + "$ref": "#/definitions/WritableConfigContext" } } ], @@ -9471,16 +9775,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableService" + "$ref": "#/definitions/ConfigContext" } } }, "tags": [ - "ipam" + "extras" ] }, "delete": { - "operationId": "ipam_services_delete", + "operationId": "extras_config-contexts_delete", "description": "", "parameters": [], "responses": { @@ -9489,47 +9793,40 @@ } }, "tags": [ - "ipam" + "extras" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this service.", + "description": "A unique integer value identifying this config context.", "required": true, "type": "integer" } ] }, - "/ipam/vlan-groups/": { + "/extras/export-templates/": { "get": { - "operationId": "ipam_vlan-groups_list", - "description": "", + "operationId": "extras_export-templates_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "slug", + "name": "content_type", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site_id", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site", + "name": "template_language", "in": "query", "description": "", "required": false, @@ -9576,7 +9873,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/VLANGroup" + "$ref": "#/definitions/ExportTemplate" } } } @@ -9584,11 +9881,11 @@ } }, "tags": [ - "ipam" + "extras" ] }, "post": { - "operationId": "ipam_vlan-groups_create", + "operationId": "extras_export-templates_create", "description": "", "parameters": [ { @@ -9596,7 +9893,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVLANGroup" + "$ref": "#/definitions/WritableExportTemplate" } } ], @@ -9604,35 +9901,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableVLANGroup" + "$ref": "#/definitions/ExportTemplate" } } }, "tags": [ - "ipam" + "extras" ] }, "parameters": [] }, - "/ipam/vlan-groups/{id}/": { + "/extras/export-templates/{id}/": { "get": { - "operationId": "ipam_vlan-groups_read", - "description": "", + "operationId": "extras_export-templates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/VLANGroup" + "$ref": "#/definitions/ExportTemplate" } } }, "tags": [ - "ipam" + "extras" ] }, "put": { - "operationId": "ipam_vlan-groups_update", + "operationId": "extras_export-templates_update", "description": "", "parameters": [ { @@ -9640,7 +9937,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVLANGroup" + "$ref": "#/definitions/WritableExportTemplate" } } ], @@ -9648,16 +9945,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVLANGroup" + "$ref": "#/definitions/ExportTemplate" } } }, "tags": [ - "ipam" + "extras" ] }, "patch": { - "operationId": "ipam_vlan-groups_partial_update", + "operationId": "extras_export-templates_partial_update", "description": "", "parameters": [ { @@ -9665,7 +9962,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVLANGroup" + "$ref": "#/definitions/WritableExportTemplate" } } ], @@ -9673,16 +9970,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVLANGroup" + "$ref": "#/definitions/ExportTemplate" } } }, "tags": [ - "ipam" + "extras" ] }, "delete": { - "operationId": "ipam_vlan-groups_delete", + "operationId": "extras_export-templates_delete", "description": "", "parameters": [], "responses": { @@ -9691,110 +9988,33 @@ } }, "tags": [ - "ipam" + "extras" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this VLAN group.", + "description": "A unique integer value identifying this export template.", "required": true, "type": "integer" } ] }, - "/ipam/vlans/": { + "/extras/graphs/": { "get": { - "operationId": "ipam_vlans_list", - "description": "", + "operationId": "extras_graphs_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "vid", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "name", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "site_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "site", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "group_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "group", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "tenant_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "tenant", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "role_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "role", + "name": "type", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "status", + "name": "name", "in": "query", "description": "", "required": false, @@ -9841,7 +10061,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/VLAN" + "$ref": "#/definitions/Graph" } } } @@ -9849,11 +10069,11 @@ } }, "tags": [ - "ipam" + "extras" ] }, "post": { - "operationId": "ipam_vlans_create", + "operationId": "extras_graphs_create", "description": "", "parameters": [ { @@ -9861,7 +10081,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVLAN" + "$ref": "#/definitions/WritableGraph" } } ], @@ -9869,35 +10089,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableVLAN" + "$ref": "#/definitions/Graph" } } }, "tags": [ - "ipam" + "extras" ] }, "parameters": [] }, - "/ipam/vlans/{id}/": { + "/extras/graphs/{id}/": { "get": { - "operationId": "ipam_vlans_read", - "description": "", + "operationId": "extras_graphs_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/VLAN" + "$ref": "#/definitions/Graph" } } }, "tags": [ - "ipam" + "extras" ] }, "put": { - "operationId": "ipam_vlans_update", + "operationId": "extras_graphs_update", "description": "", "parameters": [ { @@ -9905,7 +10125,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVLAN" + "$ref": "#/definitions/WritableGraph" } } ], @@ -9913,16 +10133,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVLAN" + "$ref": "#/definitions/Graph" } } }, "tags": [ - "ipam" + "extras" ] }, "patch": { - "operationId": "ipam_vlans_partial_update", + "operationId": "extras_graphs_partial_update", "description": "", "parameters": [ { @@ -9930,7 +10150,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVLAN" + "$ref": "#/definitions/WritableGraph" } } ], @@ -9938,16 +10158,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVLAN" + "$ref": "#/definitions/Graph" } } }, "tags": [ - "ipam" + "extras" ] }, "delete": { - "operationId": "ipam_vlans_delete", + "operationId": "extras_graphs_delete", "description": "", "parameters": [], "responses": { @@ -9956,90 +10176,41 @@ } }, "tags": [ - "ipam" + "extras" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this VLAN.", + "description": "A unique integer value identifying this graph.", "required": true, "type": "integer" } ] }, - "/ipam/vrfs/": { + "/extras/image-attachments/": { "get": { - "operationId": "ipam_vrfs_list", - "description": "", + "operationId": "extras_image-attachments_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "rd", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "enforce_unique", + "name": "limit", "in": "query", - "description": "", + "description": "Number of results to return per page.", "required": false, - "type": "string" + "type": "integer" }, { - "name": "id__in", + "name": "offset", "in": "query", - "description": "Multiple values may be separated by commas.", + "description": "The initial index from which to return the results.", "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "tenant_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "tenant", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "description": "Number of results to return per page.", - "required": false, - "type": "integer" - }, - { - "name": "offset", - "in": "query", - "description": "The initial index from which to return the results.", - "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "integer" + } + ], + "responses": { + "200": { "description": "", "schema": { "required": [ @@ -10064,7 +10235,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/VRF" + "$ref": "#/definitions/ImageAttachment" } } } @@ -10072,11 +10243,11 @@ } }, "tags": [ - "ipam" + "extras" ] }, "post": { - "operationId": "ipam_vrfs_create", + "operationId": "extras_image-attachments_create", "description": "", "parameters": [ { @@ -10084,7 +10255,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVRF" + "$ref": "#/definitions/ImageAttachment" } } ], @@ -10092,35 +10263,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableVRF" + "$ref": "#/definitions/ImageAttachment" } } }, "tags": [ - "ipam" + "extras" ] }, "parameters": [] }, - "/ipam/vrfs/{id}/": { + "/extras/image-attachments/{id}/": { "get": { - "operationId": "ipam_vrfs_read", - "description": "", + "operationId": "extras_image-attachments_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/VRF" + "$ref": "#/definitions/ImageAttachment" } } }, "tags": [ - "ipam" + "extras" ] }, "put": { - "operationId": "ipam_vrfs_update", + "operationId": "extras_image-attachments_update", "description": "", "parameters": [ { @@ -10128,7 +10299,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVRF" + "$ref": "#/definitions/ImageAttachment" } } ], @@ -10136,16 +10307,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVRF" + "$ref": "#/definitions/ImageAttachment" } } }, "tags": [ - "ipam" + "extras" ] }, "patch": { - "operationId": "ipam_vrfs_partial_update", + "operationId": "extras_image-attachments_partial_update", "description": "", "parameters": [ { @@ -10153,7 +10324,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVRF" + "$ref": "#/definitions/ImageAttachment" } } ], @@ -10161,16 +10332,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVRF" + "$ref": "#/definitions/ImageAttachment" } } }, "tags": [ - "ipam" + "extras" ] }, "delete": { - "operationId": "ipam_vrfs_delete", + "operationId": "extras_image-attachments_delete", "description": "", "parameters": [], "responses": { @@ -10179,62 +10350,165 @@ } }, "tags": [ - "ipam" + "extras" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this VRF.", + "description": "A unique integer value identifying this image attachment.", "required": true, "type": "integer" } ] }, - "/secrets/_choices/": { + "/extras/object-changes/": { "get": { - "operationId": "secrets__choices_list", - "description": "", - "parameters": [], + "operationId": "extras_object-changes_list", + "description": "Retrieve a list of recent changes.", + "parameters": [ + { + "name": "user", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "user_name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "request_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "action", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "changed_object_type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "object_repr", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "time", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], "responses": { "200": { - "description": "" + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ObjectChange" + } + } + } + } } }, "tags": [ - "secrets" + "extras" ] }, "parameters": [] }, - "/secrets/_choices/{id}/": { + "/extras/object-changes/{id}/": { "get": { - "operationId": "secrets__choices_read", - "description": "", + "operationId": "extras_object-changes_read", + "description": "Retrieve a list of recent changes.", "parameters": [], "responses": { "200": { - "description": "" + "description": "", + "schema": { + "$ref": "#/definitions/ObjectChange" + } } }, "tags": [ - "secrets" + "extras" ] }, "parameters": [ { "name": "id", "in": "path", + "description": "A unique integer value identifying this object change.", "required": true, - "type": "string" + "type": "integer" } ] }, - "/secrets/generate-rsa-key-pair/": { + "/extras/reports/": { "get": { - "operationId": "secrets_generate-rsa-key-pair_list", - "description": "This endpoint can be used to generate a new RSA key pair. The keys are returned in PEM format.\n\n {\n \"public_key\": \"<public key>\",\n \"private_key\": \"<private key>\"\n }", + "operationId": "extras_reports_list", + "description": "Compile all reports and their related results (if any). Result data is deferred in the list view.", "parameters": [], "responses": { "200": { @@ -10242,15 +10516,38 @@ } }, "tags": [ - "secrets" + "extras" ] }, "parameters": [] }, - "/secrets/get-session-key/": { + "/extras/reports/{id}/": { + "get": { + "operationId": "extras_reports_read", + "description": "Retrieve a single Report identified as \"<module>.<report>\".", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/extras/reports/{id}/run/": { "post": { - "operationId": "secrets_get-session-key_create", - "description": "Retrieve a temporary session key to use for encrypting and decrypting secrets via the API. The user's private RSA\nkey is POSTed with the name `private_key`. An example:\n\n curl -v -X POST -H \"Authorization: Token <token>\" -H \"Accept: application/json; indent=4\" \\\n --data-urlencode \"private_key@<filename>\" https://netbox/api/secrets/get-session-key/\n\nThis request will yield a base64-encoded session key to be included in an `X-Session-Key` header in future requests:\n\n {\n \"session_key\": \"+8t4SI6XikgVmB5+/urhozx9O5qCQANyOk1MNe6taRf=\"\n }\n\nThis endpoint accepts one optional parameter: `preserve_key`. If True and a session key exists, the existing session\nkey will be returned instead of a new one.", + "operationId": "extras_reports_run", + "description": "Run a Report and create a new ReportResult, overwriting any previous result for the Report.", "parameters": [], "responses": { "201": { @@ -10258,15 +10555,22 @@ } }, "tags": [ - "secrets" + "extras" ] }, - "parameters": [] + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] }, - "/secrets/secret-roles/": { + "/extras/tags/": { "get": { - "operationId": "secrets_secret-roles_list", - "description": "", + "operationId": "extras_tags_list", + "description": "Call to super to allow for caching", "parameters": [ { "name": "name", @@ -10282,6 +10586,13 @@ "required": false, "type": "string" }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -10323,7 +10634,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/SecretRole" + "$ref": "#/definitions/Tag" } } } @@ -10331,11 +10642,11 @@ } }, "tags": [ - "secrets" + "extras" ] }, "post": { - "operationId": "secrets_secret-roles_create", + "operationId": "extras_tags_create", "description": "", "parameters": [ { @@ -10343,7 +10654,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/SecretRole" + "$ref": "#/definitions/Tag" } } ], @@ -10351,35 +10662,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/SecretRole" + "$ref": "#/definitions/Tag" } } }, "tags": [ - "secrets" + "extras" ] }, "parameters": [] }, - "/secrets/secret-roles/{id}/": { + "/extras/tags/{id}/": { "get": { - "operationId": "secrets_secret-roles_read", - "description": "", + "operationId": "extras_tags_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/SecretRole" + "$ref": "#/definitions/Tag" } } }, "tags": [ - "secrets" + "extras" ] }, "put": { - "operationId": "secrets_secret-roles_update", + "operationId": "extras_tags_update", "description": "", "parameters": [ { @@ -10387,7 +10698,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/SecretRole" + "$ref": "#/definitions/Tag" } } ], @@ -10395,16 +10706,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/SecretRole" + "$ref": "#/definitions/Tag" } } }, "tags": [ - "secrets" + "extras" ] }, "patch": { - "operationId": "secrets_secret-roles_partial_update", + "operationId": "extras_tags_partial_update", "description": "", "parameters": [ { @@ -10412,7 +10723,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/SecretRole" + "$ref": "#/definitions/Tag" } } ], @@ -10420,16 +10731,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/SecretRole" + "$ref": "#/definitions/Tag" } } }, "tags": [ - "secrets" + "extras" ] }, "delete": { - "operationId": "secrets_secret-roles_delete", + "operationId": "extras_tags_delete", "description": "", "parameters": [], "responses": { @@ -10438,23 +10749,23 @@ } }, "tags": [ - "secrets" + "extras" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this secret role.", + "description": "A unique integer value identifying this tag.", "required": true, "type": "integer" } ] }, - "/secrets/secrets/": { + "/extras/topology-maps/": { "get": { - "operationId": "secrets_secrets_list", - "description": "", + "operationId": "extras_topology-maps_list", + "description": "Call to super to allow for caching", "parameters": [ { "name": "name", @@ -10464,42 +10775,21 @@ "type": "string" }, { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "role_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "role", + "name": "slug", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device_id", + "name": "site_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "site", "in": "query", "description": "", "required": false, @@ -10546,7 +10836,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Secret" + "$ref": "#/definitions/TopologyMap" } } } @@ -10554,11 +10844,11 @@ } }, "tags": [ - "secrets" + "extras" ] }, "post": { - "operationId": "secrets_secrets_create", + "operationId": "extras_topology-maps_create", "description": "", "parameters": [ { @@ -10566,7 +10856,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableSecret" + "$ref": "#/definitions/WritableTopologyMap" } } ], @@ -10574,35 +10864,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableSecret" + "$ref": "#/definitions/TopologyMap" } } }, "tags": [ - "secrets" + "extras" ] }, "parameters": [] }, - "/secrets/secrets/{id}/": { + "/extras/topology-maps/{id}/": { "get": { - "operationId": "secrets_secrets_read", - "description": "", + "operationId": "extras_topology-maps_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Secret" + "$ref": "#/definitions/TopologyMap" } } }, "tags": [ - "secrets" + "extras" ] }, "put": { - "operationId": "secrets_secrets_update", + "operationId": "extras_topology-maps_update", "description": "", "parameters": [ { @@ -10610,7 +10900,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableSecret" + "$ref": "#/definitions/WritableTopologyMap" } } ], @@ -10618,16 +10908,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableSecret" + "$ref": "#/definitions/TopologyMap" } } }, "tags": [ - "secrets" + "extras" ] }, "patch": { - "operationId": "secrets_secrets_partial_update", + "operationId": "extras_topology-maps_partial_update", "description": "", "parameters": [ { @@ -10635,7 +10925,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableSecret" + "$ref": "#/definitions/WritableTopologyMap" } } ], @@ -10643,16 +10933,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableSecret" + "$ref": "#/definitions/TopologyMap" } } }, "tags": [ - "secrets" + "extras" ] }, "delete": { - "operationId": "secrets_secrets_delete", + "operationId": "extras_topology-maps_delete", "description": "", "parameters": [], "responses": { @@ -10661,22 +10951,49 @@ } }, "tags": [ - "secrets" + "extras" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this secret.", + "description": "A unique integer value identifying this topology map.", "required": true, "type": "integer" } ] }, - "/tenancy/_choices/": { + "/extras/topology-maps/{id}/render/": { "get": { - "operationId": "tenancy__choices_list", + "operationId": "extras_topology-maps_render", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TopologyMap" + } + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this topology map.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/_choices/": { + "get": { + "operationId": "ipam__choices_list", "description": "", "parameters": [], "responses": { @@ -10685,14 +11002,14 @@ } }, "tags": [ - "tenancy" + "ipam" ] }, "parameters": [] }, - "/tenancy/_choices/{id}/": { + "/ipam/_choices/{id}/": { "get": { - "operationId": "tenancy__choices_read", + "operationId": "ipam__choices_read", "description": "", "parameters": [], "responses": { @@ -10701,7 +11018,7 @@ } }, "tags": [ - "tenancy" + "ipam" ] }, "parameters": [ @@ -10713,20 +11030,62 @@ } ] }, - "/tenancy/tenant-groups/": { + "/ipam/aggregates/": { "get": { - "operationId": "tenancy_tenant-groups_list", - "description": "", + "operationId": "ipam_aggregates_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", + "name": "family", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "slug", + "name": "date_added", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "prefix", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rir_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rir", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", "in": "query", "description": "", "required": false, @@ -10773,7 +11132,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/TenantGroup" + "$ref": "#/definitions/Aggregate" } } } @@ -10781,11 +11140,11 @@ } }, "tags": [ - "tenancy" + "ipam" ] }, "post": { - "operationId": "tenancy_tenant-groups_create", + "operationId": "ipam_aggregates_create", "description": "", "parameters": [ { @@ -10793,7 +11152,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/TenantGroup" + "$ref": "#/definitions/WritableAggregate" } } ], @@ -10801,35 +11160,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/TenantGroup" + "$ref": "#/definitions/Aggregate" } } }, "tags": [ - "tenancy" + "ipam" ] }, "parameters": [] }, - "/tenancy/tenant-groups/{id}/": { + "/ipam/aggregates/{id}/": { "get": { - "operationId": "tenancy_tenant-groups_read", - "description": "", + "operationId": "ipam_aggregates_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/TenantGroup" + "$ref": "#/definitions/Aggregate" } } }, "tags": [ - "tenancy" + "ipam" ] }, "put": { - "operationId": "tenancy_tenant-groups_update", + "operationId": "ipam_aggregates_update", "description": "", "parameters": [ { @@ -10837,7 +11196,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/TenantGroup" + "$ref": "#/definitions/WritableAggregate" } } ], @@ -10845,16 +11204,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/TenantGroup" + "$ref": "#/definitions/Aggregate" } } }, "tags": [ - "tenancy" + "ipam" ] }, "patch": { - "operationId": "tenancy_tenant-groups_partial_update", + "operationId": "ipam_aggregates_partial_update", "description": "", "parameters": [ { @@ -10862,7 +11221,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/TenantGroup" + "$ref": "#/definitions/WritableAggregate" } } ], @@ -10870,16 +11229,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/TenantGroup" + "$ref": "#/definitions/Aggregate" } } }, "tags": [ - "tenancy" + "ipam" ] }, "delete": { - "operationId": "tenancy_tenant-groups_delete", + "operationId": "ipam_aggregates_delete", "description": "", "parameters": [], "responses": { @@ -10888,86 +11247,205 @@ } }, "tags": [ - "tenancy" + "ipam" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this tenant group.", + "description": "A unique integer value identifying this aggregate.", "required": true, "type": "integer" } ] }, - "/tenancy/tenants/": { + "/ipam/ip-addresses/": { "get": { - "operationId": "tenancy_tenants_list", - "description": "", + "operationId": "ipam_ip-addresses_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", + "name": "family", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "id__in", + "name": "dns_name", "in": "query", - "description": "Multiple values may be separated by commas.", + "description": "", "required": false, "type": "string" }, { - "name": "q", + "name": "tenant_group_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "group_id", + "name": "tenant_group", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "group", + "name": "tenant_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "limit", + "name": "tenant", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "id__in", "in": "query", - "description": "The initial index from which to return the results.", + "description": "Multiple values may be separated by commas.", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "q", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" + "required": false, + "type": "string" + }, + { + "name": "parent", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "address", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mask_length", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "vrf_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vrf", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "virtual_machine_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_machine", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "interface", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "interface_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" }, "next": { "type": "string", @@ -10982,7 +11460,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Tenant" + "$ref": "#/definitions/IPAddress" } } } @@ -10990,11 +11468,11 @@ } }, "tags": [ - "tenancy" + "ipam" ] }, "post": { - "operationId": "tenancy_tenants_create", + "operationId": "ipam_ip-addresses_create", "description": "", "parameters": [ { @@ -11002,7 +11480,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableTenant" + "$ref": "#/definitions/WritableIPAddress" } } ], @@ -11010,35 +11488,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableTenant" + "$ref": "#/definitions/IPAddress" } } }, "tags": [ - "tenancy" + "ipam" ] }, "parameters": [] }, - "/tenancy/tenants/{id}/": { + "/ipam/ip-addresses/{id}/": { "get": { - "operationId": "tenancy_tenants_read", - "description": "", + "operationId": "ipam_ip-addresses_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Tenant" + "$ref": "#/definitions/IPAddress" } } }, "tags": [ - "tenancy" + "ipam" ] }, "put": { - "operationId": "tenancy_tenants_update", + "operationId": "ipam_ip-addresses_update", "description": "", "parameters": [ { @@ -11046,7 +11524,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableTenant" + "$ref": "#/definitions/WritableIPAddress" } } ], @@ -11054,16 +11532,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableTenant" + "$ref": "#/definitions/IPAddress" } } }, "tags": [ - "tenancy" + "ipam" ] }, "patch": { - "operationId": "tenancy_tenants_partial_update", + "operationId": "ipam_ip-addresses_partial_update", "description": "", "parameters": [ { @@ -11071,7 +11549,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableTenant" + "$ref": "#/definitions/WritableIPAddress" } } ], @@ -11079,16 +11557,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableTenant" + "$ref": "#/definitions/IPAddress" } } }, "tags": [ - "tenancy" + "ipam" ] }, "delete": { - "operationId": "tenancy_tenants_delete", + "operationId": "ipam_ip-addresses_delete", "description": "", "parameters": [], "responses": { @@ -11097,119 +11575,227 @@ } }, "tags": [ - "tenancy" + "ipam" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this tenant.", + "description": "A unique integer value identifying this IP address.", "required": true, "type": "integer" } ] }, - "/virtualization/_choices/": { - "get": { - "operationId": "virtualization__choices_list", - "description": "", - "parameters": [], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "virtualization" - ] - }, - "parameters": [] - }, - "/virtualization/_choices/{id}/": { - "get": { - "operationId": "virtualization__choices_read", - "description": "", - "parameters": [], - "responses": { - "200": { - "description": "" - } - }, - "tags": [ - "virtualization" - ] - }, - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "type": "string" - } - ] - }, - "/virtualization/cluster-groups/": { + "/ipam/prefixes/": { "get": { - "operationId": "virtualization_cluster-groups_list", - "description": "", + "operationId": "ipam_prefixes_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", + "name": "family", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "slug", + "name": "is_pool", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "limit", + "name": "tenant_group_id", "in": "query", - "description": "Number of results to return per page.", + "description": "", "required": false, - "type": "integer" + "type": "string" }, { - "name": "offset", + "name": "tenant_group", "in": "query", - "description": "The initial index from which to return the results.", + "description": "", "required": false, - "type": "integer" - } - ], - "responses": { - "200": { + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", "description": "", - "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "next": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "previous": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "results": { - "type": "array", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "prefix", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "within", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "within_include", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "contains", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mask_length", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "vrf_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vrf", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vlan_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vlan_vid", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", "items": { - "$ref": "#/definitions/ClusterGroup" + "$ref": "#/definitions/Prefix" } } } @@ -11217,11 +11803,11 @@ } }, "tags": [ - "virtualization" + "ipam" ] }, "post": { - "operationId": "virtualization_cluster-groups_create", + "operationId": "ipam_prefixes_create", "description": "", "parameters": [ { @@ -11229,7 +11815,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ClusterGroup" + "$ref": "#/definitions/WritablePrefix" } } ], @@ -11237,35 +11823,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/ClusterGroup" + "$ref": "#/definitions/Prefix" } } }, "tags": [ - "virtualization" + "ipam" ] }, "parameters": [] }, - "/virtualization/cluster-groups/{id}/": { + "/ipam/prefixes/{id}/": { "get": { - "operationId": "virtualization_cluster-groups_read", - "description": "", + "operationId": "ipam_prefixes_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/ClusterGroup" + "$ref": "#/definitions/Prefix" } } }, "tags": [ - "virtualization" + "ipam" ] }, "put": { - "operationId": "virtualization_cluster-groups_update", + "operationId": "ipam_prefixes_update", "description": "", "parameters": [ { @@ -11273,7 +11859,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ClusterGroup" + "$ref": "#/definitions/WritablePrefix" } } ], @@ -11281,16 +11867,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/ClusterGroup" + "$ref": "#/definitions/Prefix" } } }, "tags": [ - "virtualization" + "ipam" ] }, "patch": { - "operationId": "virtualization_cluster-groups_partial_update", + "operationId": "ipam_prefixes_partial_update", "description": "", "parameters": [ { @@ -11298,7 +11884,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ClusterGroup" + "$ref": "#/definitions/WritablePrefix" } } ], @@ -11306,16 +11892,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/ClusterGroup" + "$ref": "#/definitions/Prefix" } } }, "tags": [ - "virtualization" + "ipam" ] }, "delete": { - "operationId": "virtualization_cluster-groups_delete", + "operationId": "ipam_prefixes_delete", "description": "", "parameters": [], "responses": { @@ -11324,100 +11910,46 @@ } }, "tags": [ - "virtualization" + "ipam" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this cluster group.", + "description": "A unique integer value identifying this prefix.", "required": true, "type": "integer" } ] }, - "/virtualization/cluster-types/": { + "/ipam/prefixes/{id}/available-ips/": { "get": { - "operationId": "virtualization_cluster-types_list", - "description": "", - "parameters": [ - { - "name": "name", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "slug", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "limit", - "in": "query", - "description": "Number of results to return per page.", - "required": false, - "type": "integer" - }, - { - "name": "offset", - "in": "query", - "description": "The initial index from which to return the results.", - "required": false, - "type": "integer" - } - ], + "operationId": "ipam_prefixes_available-ips_read", + "description": "A convenience method for returning available IP addresses within a prefix. By default, the number of IPs\nreturned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be passed,\nhowever results will not be paginated.", + "parameters": [], "responses": { "200": { "description": "", "schema": { - "required": [ - "count", - "results" - ], - "type": "object", - "properties": { - "count": { - "type": "integer" - }, - "next": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "previous": { - "type": "string", - "format": "uri", - "x-nullable": true - }, - "results": { - "type": "array", - "items": { - "$ref": "#/definitions/ClusterType" - } - } - } + "$ref": "#/definitions/Prefix" } } }, "tags": [ - "virtualization" + "ipam" ] }, "post": { - "operationId": "virtualization_cluster-types_create", - "description": "", + "operationId": "ipam_prefixes_available-ips_create", + "description": "A convenience method for returning available IP addresses within a prefix. By default, the number of IPs\nreturned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be passed,\nhowever results will not be paginated.", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ClusterType" + "$ref": "#/definitions/WritablePrefix" } } ], @@ -11425,110 +11957,80 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/ClusterType" + "$ref": "#/definitions/Prefix" } } }, "tags": [ - "virtualization" + "ipam" ] }, - "parameters": [] + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this prefix.", + "required": true, + "type": "integer" + } + ] }, - "/virtualization/cluster-types/{id}/": { + "/ipam/prefixes/{id}/available-prefixes/": { "get": { - "operationId": "virtualization_cluster-types_read", - "description": "", + "operationId": "ipam_prefixes_available-prefixes_read", + "description": "A convenience method for returning available child prefixes within a parent.", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/ClusterType" - } - } - }, - "tags": [ - "virtualization" - ] - }, - "put": { - "operationId": "virtualization_cluster-types_update", - "description": "", - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ClusterType" - } - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/ClusterType" + "$ref": "#/definitions/Prefix" } } }, "tags": [ - "virtualization" + "ipam" ] }, - "patch": { - "operationId": "virtualization_cluster-types_partial_update", - "description": "", + "post": { + "operationId": "ipam_prefixes_available-prefixes_create", + "description": "A convenience method for returning available child prefixes within a parent.", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/ClusterType" + "$ref": "#/definitions/WritablePrefix" } } ], "responses": { - "200": { + "201": { "description": "", "schema": { - "$ref": "#/definitions/ClusterType" + "$ref": "#/definitions/Prefix" } } }, "tags": [ - "virtualization" - ] - }, - "delete": { - "operationId": "virtualization_cluster-types_delete", - "description": "", - "parameters": [], - "responses": { - "204": { - "description": "" - } - }, - "tags": [ - "virtualization" + "ipam" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this cluster type.", + "description": "A unique integer value identifying this prefix.", "required": true, "type": "integer" } ] }, - "/virtualization/clusters/": { + "/ipam/rirs/": { "get": { - "operationId": "virtualization_clusters_list", - "description": "", + "operationId": "ipam_rirs_list", + "description": "Call to super to allow for caching", "parameters": [ { "name": "name", @@ -11538,58 +12040,30 @@ "type": "string" }, { - "name": "id__in", - "in": "query", - "description": "Multiple values may be separated by commas.", - "required": false, - "type": "string" - }, - { - "name": "q", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "group_id", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "group", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "type_id", + "name": "slug", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "type", + "name": "is_private", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site_id", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site", + "name": "id__in", "in": "query", - "description": "", + "description": "Multiple values may be separated by commas.", "required": false, "type": "string" }, @@ -11634,7 +12108,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Cluster" + "$ref": "#/definitions/RIR" } } } @@ -11642,11 +12116,11 @@ } }, "tags": [ - "virtualization" + "ipam" ] }, "post": { - "operationId": "virtualization_clusters_create", + "operationId": "ipam_rirs_create", "description": "", "parameters": [ { @@ -11654,7 +12128,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableCluster" + "$ref": "#/definitions/RIR" } } ], @@ -11662,35 +12136,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableCluster" + "$ref": "#/definitions/RIR" } } }, "tags": [ - "virtualization" + "ipam" ] }, "parameters": [] }, - "/virtualization/clusters/{id}/": { + "/ipam/rirs/{id}/": { "get": { - "operationId": "virtualization_clusters_read", - "description": "", + "operationId": "ipam_rirs_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Cluster" + "$ref": "#/definitions/RIR" } } }, "tags": [ - "virtualization" + "ipam" ] }, "put": { - "operationId": "virtualization_clusters_update", + "operationId": "ipam_rirs_update", "description": "", "parameters": [ { @@ -11698,7 +12172,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableCluster" + "$ref": "#/definitions/RIR" } } ], @@ -11706,16 +12180,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableCluster" + "$ref": "#/definitions/RIR" } } }, "tags": [ - "virtualization" + "ipam" ] }, "patch": { - "operationId": "virtualization_clusters_partial_update", + "operationId": "ipam_rirs_partial_update", "description": "", "parameters": [ { @@ -11723,7 +12197,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableCluster" + "$ref": "#/definitions/RIR" } } ], @@ -11731,16 +12205,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableCluster" + "$ref": "#/definitions/RIR" } } }, "tags": [ - "virtualization" + "ipam" ] }, "delete": { - "operationId": "virtualization_clusters_delete", + "operationId": "ipam_rirs_delete", "description": "", "parameters": [], "responses": { @@ -11749,61 +12223,47 @@ } }, "tags": [ - "virtualization" + "ipam" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this cluster.", + "description": "A unique integer value identifying this RIR.", "required": true, "type": "integer" } ] }, - "/virtualization/interfaces/": { + "/ipam/roles/": { "get": { - "operationId": "virtualization_interfaces_list", - "description": "", + "operationId": "ipam_roles_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, - { - "name": "enabled", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "mtu", - "in": "query", - "description": "", - "required": false, - "type": "number" - }, - { - "name": "virtual_machine_id", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "virtual_machine", + "name": "slug", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "mac_address", + "name": "q", "in": "query", "description": "", "required": false, @@ -11850,7 +12310,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/Interface" + "$ref": "#/definitions/Role" } } } @@ -11858,11 +12318,11 @@ } }, "tags": [ - "virtualization" + "ipam" ] }, "post": { - "operationId": "virtualization_interfaces_create", + "operationId": "ipam_roles_create", "description": "", "parameters": [ { @@ -11870,7 +12330,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/Role" } } ], @@ -11878,35 +12338,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/Role" } } }, "tags": [ - "virtualization" + "ipam" ] }, "parameters": [] }, - "/virtualization/interfaces/{id}/": { + "/ipam/roles/{id}/": { "get": { - "operationId": "virtualization_interfaces_read", - "description": "", + "operationId": "ipam_roles_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/Interface" + "$ref": "#/definitions/Role" } } }, "tags": [ - "virtualization" + "ipam" ] }, "put": { - "operationId": "virtualization_interfaces_update", + "operationId": "ipam_roles_update", "description": "", "parameters": [ { @@ -11914,7 +12374,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/Role" } } ], @@ -11922,16 +12382,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/Role" } } }, "tags": [ - "virtualization" + "ipam" ] }, "patch": { - "operationId": "virtualization_interfaces_partial_update", + "operationId": "ipam_roles_partial_update", "description": "", "parameters": [ { @@ -11939,7 +12399,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/Role" } } ], @@ -11947,16 +12407,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableInterface" + "$ref": "#/definitions/Role" } } }, "tags": [ - "virtualization" + "ipam" ] }, "delete": { - "operationId": "virtualization_interfaces_delete", + "operationId": "ipam_roles_delete", "description": "", "parameters": [], "responses": { @@ -11965,145 +12425,305 @@ } }, "tags": [ - "virtualization" + "ipam" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this interface.", + "description": "A unique integer value identifying this role.", "required": true, "type": "integer" } ] }, - "/virtualization/virtual-machines/": { + "/ipam/services/": { "get": { - "operationId": "virtualization_virtual-machines_list", - "description": "", + "operationId": "ipam_services_list", + "description": "Call to super to allow for caching", "parameters": [ { - "name": "name", + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "cluster", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "id__in", + "name": "protocol", "in": "query", - "description": "Multiple values may be separated by commas.", + "description": "", "required": false, "type": "string" }, { - "name": "q", + "name": "port", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "status", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "cluster_group_id", + "name": "device_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "cluster_group", + "name": "device", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "cluster_type_id", + "name": "virtual_machine_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "cluster_type", + "name": "virtual_machine", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "cluster_id", + "name": "tag", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "site_id", + "name": "limit", "in": "query", - "description": "", + "description": "Number of results to return per page.", "required": false, - "type": "string" + "type": "integer" }, { - "name": "site", + "name": "offset", "in": "query", - "description": "", + "description": "The initial index from which to return the results.", "required": false, - "type": "string" - }, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Service" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_services_create", + "description": "", + "parameters": [ { - "name": "role_id", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableService" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Service" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/services/{id}/": { + "get": { + "operationId": "ipam_services_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Service" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_services_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableService" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Service" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_services_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableService" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Service" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_services_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this service.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/vlan-groups/": { + "get": { + "operationId": "ipam_vlan-groups_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "role", + "name": "name", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant_id", + "name": "slug", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "tenant", + "name": "q", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "platform_id", + "name": "site_id", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "platform", + "name": "site", "in": "query", "description": "", "required": false, @@ -12150,7 +12770,7 @@ "results": { "type": "array", "items": { - "$ref": "#/definitions/VirtualMachine" + "$ref": "#/definitions/VLANGroup" } } } @@ -12158,11 +12778,11 @@ } }, "tags": [ - "virtualization" + "ipam" ] }, "post": { - "operationId": "virtualization_virtual-machines_create", + "operationId": "ipam_vlan-groups_create", "description": "", "parameters": [ { @@ -12170,7 +12790,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVirtualMachine" + "$ref": "#/definitions/WritableVLANGroup" } } ], @@ -12178,35 +12798,35 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/WritableVirtualMachine" + "$ref": "#/definitions/VLANGroup" } } }, "tags": [ - "virtualization" + "ipam" ] }, "parameters": [] }, - "/virtualization/virtual-machines/{id}/": { + "/ipam/vlan-groups/{id}/": { "get": { - "operationId": "virtualization_virtual-machines_read", - "description": "", + "operationId": "ipam_vlan-groups_read", + "description": "Call to super to allow for caching", "parameters": [], "responses": { "200": { "description": "", "schema": { - "$ref": "#/definitions/VirtualMachine" + "$ref": "#/definitions/VLANGroup" } } }, "tags": [ - "virtualization" + "ipam" ] }, "put": { - "operationId": "virtualization_virtual-machines_update", + "operationId": "ipam_vlan-groups_update", "description": "", "parameters": [ { @@ -12214,7 +12834,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVirtualMachine" + "$ref": "#/definitions/WritableVLANGroup" } } ], @@ -12222,16 +12842,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVirtualMachine" + "$ref": "#/definitions/VLANGroup" } } }, "tags": [ - "virtualization" + "ipam" ] }, "patch": { - "operationId": "virtualization_virtual-machines_partial_update", + "operationId": "ipam_vlan-groups_partial_update", "description": "", "parameters": [ { @@ -12239,7 +12859,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/WritableVirtualMachine" + "$ref": "#/definitions/WritableVLANGroup" } } ], @@ -12247,16 +12867,16 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/WritableVirtualMachine" + "$ref": "#/definitions/VLANGroup" } } }, "tags": [ - "virtualization" + "ipam" ] }, "delete": { - "operationId": "virtualization_virtual-machines_delete", + "operationId": "ipam_vlan-groups_delete", "description": "", "parameters": [], "responses": { @@ -12265,51 +12885,4216 @@ } }, "tags": [ - "virtualization" + "ipam" ] }, "parameters": [ { "name": "id", "in": "path", - "description": "A unique integer value identifying this virtual machine.", + "description": "A unique integer value identifying this VLAN group.", "required": true, "type": "integer" } ] - } - }, - "definitions": { - "NestedCircuit": { - "title": "Circuit", - "required": [ - "cid" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "url": { - "title": "Url", - "type": "string", + }, + "/ipam/vlans/": { + "get": { + "operationId": "ipam_vlans_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "vid", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VLAN" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_vlans_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/VLAN" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/vlans/{id}/": { + "get": { + "operationId": "ipam_vlans_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VLAN" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_vlans_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VLAN" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_vlans_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VLAN" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_vlans_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this VLAN.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/vrfs/": { + "get": { + "operationId": "ipam_vrfs_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rd", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "enforce_unique", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VRF" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_vrfs_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/VRF" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/vrfs/{id}/": { + "get": { + "operationId": "ipam_vrfs_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VRF" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_vrfs_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VRF" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_vrfs_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VRF" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_vrfs_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this VRF.", + "required": true, + "type": "integer" + } + ] + }, + "/secrets/_choices/": { + "get": { + "operationId": "secrets__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/_choices/{id}/": { + "get": { + "operationId": "secrets__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/secrets/generate-rsa-key-pair/": { + "get": { + "operationId": "secrets_generate-rsa-key-pair_list", + "summary": "This endpoint can be used to generate a new RSA key pair. The keys are returned in PEM format.", + "description": "{\n \"public_key\": \"<public key>\",\n \"private_key\": \"<private key>\"\n }", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/get-session-key/": { + "post": { + "operationId": "secrets_get-session-key_create", + "description": "Retrieve a temporary session key to use for encrypting and decrypting secrets via the API. The user's private RSA\nkey is POSTed with the name `private_key`. An example:\n\n curl -v -X POST -H \"Authorization: Token <token>\" -H \"Accept: application/json; indent=4\" \\\n --data-urlencode \"private_key@<filename>\" https://netbox/api/secrets/get-session-key/\n\nThis request will yield a base64-encoded session key to be included in an `X-Session-Key` header in future requests:\n\n {\n \"session_key\": \"+8t4SI6XikgVmB5+/urhozx9O5qCQANyOk1MNe6taRf=\"\n }\n\nThis endpoint accepts one optional parameter: `preserve_key`. If True and a session key exists, the existing session\nkey will be returned instead of a new one.", + "parameters": [], + "responses": { + "201": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/secret-roles/": { + "get": { + "operationId": "secrets_secret-roles_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRole" + } + } + } + } + } + }, + "tags": [ + "secrets" + ] + }, + "post": { + "operationId": "secrets_secret-roles_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/secret-roles/{id}/": { + "get": { + "operationId": "secrets_secret-roles_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + }, + "tags": [ + "secrets" + ] + }, + "put": { + "operationId": "secrets_secret-roles_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + }, + "tags": [ + "secrets" + ] + }, + "patch": { + "operationId": "secrets_secret-roles_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + }, + "tags": [ + "secrets" + ] + }, + "delete": { + "operationId": "secrets_secret-roles_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this secret role.", + "required": true, + "type": "integer" + } + ] + }, + "/secrets/secrets/": { + "get": { + "operationId": "secrets_secrets_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Secret" + } + } + } + } + } + }, + "tags": [ + "secrets" + ] + }, + "post": { + "operationId": "secrets_secrets_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Secret" + } + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/secrets/{id}/": { + "get": { + "operationId": "secrets_secrets_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Secret" + } + } + }, + "tags": [ + "secrets" + ] + }, + "put": { + "operationId": "secrets_secrets_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Secret" + } + } + }, + "tags": [ + "secrets" + ] + }, + "patch": { + "operationId": "secrets_secrets_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Secret" + } + } + }, + "tags": [ + "secrets" + ] + }, + "delete": { + "operationId": "secrets_secrets_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this secret.", + "required": true, + "type": "integer" + } + ] + }, + "/tenancy/_choices/": { + "get": { + "operationId": "tenancy__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [] + }, + "/tenancy/_choices/{id}/": { + "get": { + "operationId": "tenancy__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/tenancy/tenant-groups/": { + "get": { + "operationId": "tenancy_tenant-groups_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/TenantGroup" + } + } + } + } + } + }, + "tags": [ + "tenancy" + ] + }, + "post": { + "operationId": "tenancy_tenant-groups_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [] + }, + "/tenancy/tenant-groups/{id}/": { + "get": { + "operationId": "tenancy_tenant-groups_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "put": { + "operationId": "tenancy_tenant-groups_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "patch": { + "operationId": "tenancy_tenant-groups_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "delete": { + "operationId": "tenancy_tenant-groups_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this tenant group.", + "required": true, + "type": "integer" + } + ] + }, + "/tenancy/tenants/": { + "get": { + "operationId": "tenancy_tenants_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Tenant" + } + } + } + } + } + }, + "tags": [ + "tenancy" + ] + }, + "post": { + "operationId": "tenancy_tenants_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Tenant" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [] + }, + "/tenancy/tenants/{id}/": { + "get": { + "operationId": "tenancy_tenants_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Tenant" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "put": { + "operationId": "tenancy_tenants_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Tenant" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "patch": { + "operationId": "tenancy_tenants_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Tenant" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "delete": { + "operationId": "tenancy_tenants_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this tenant.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/_choices/": { + "get": { + "operationId": "virtualization__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/_choices/{id}/": { + "get": { + "operationId": "virtualization__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/virtualization/cluster-groups/": { + "get": { + "operationId": "virtualization_cluster-groups_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ClusterGroup" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_cluster-groups_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/cluster-groups/{id}/": { + "get": { + "operationId": "virtualization_cluster-groups_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_cluster-groups_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_cluster-groups_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_cluster-groups_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this cluster group.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/cluster-types/": { + "get": { + "operationId": "virtualization_cluster-types_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ClusterType" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_cluster-types_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/cluster-types/{id}/": { + "get": { + "operationId": "virtualization_cluster-types_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_cluster-types_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_cluster-types_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_cluster-types_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this cluster type.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/clusters/": { + "get": { + "operationId": "virtualization_clusters_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "type_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Cluster" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_clusters_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Cluster" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/clusters/{id}/": { + "get": { + "operationId": "virtualization_clusters_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Cluster" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_clusters_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Cluster" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_clusters_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Cluster" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_clusters_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this cluster.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/interfaces/": { + "get": { + "operationId": "virtualization_interfaces_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "enabled", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mtu", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_machine_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_machine", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mac_address", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VirtualMachineInterface" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_interfaces_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachineInterface" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachineInterface" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/interfaces/{id}/": { + "get": { + "operationId": "virtualization_interfaces_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachineInterface" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_interfaces_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachineInterface" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachineInterface" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_interfaces_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachineInterface" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachineInterface" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_interfaces_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this interface.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/virtual-machines/": { + "get": { + "operationId": "virtualization_virtual-machines_list", + "description": "Call to super to allow for caching", + "parameters": [ + { + "name": "id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vcpus", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "memory", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "disk", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_type_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "region_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "region", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "platform_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "platform", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VirtualMachineWithConfigContext" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_virtual-machines_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachineWithConfigContext" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachineWithConfigContext" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/virtual-machines/{id}/": { + "get": { + "operationId": "virtualization_virtual-machines_read", + "description": "Call to super to allow for caching", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachineWithConfigContext" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_virtual-machines_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachineWithConfigContext" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachineWithConfigContext" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_virtual-machines_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachineWithConfigContext" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachineWithConfigContext" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_virtual-machines_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this virtual machine.", + "required": true, + "type": "integer" + } + ] + } + }, + "definitions": { + "NestedCircuit": { + "title": "Circuit", + "required": [ + "cid" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "cid": { + "title": "Circuit ID", + "type": "string", + "maxLength": 50, + "minLength": 1 + } + } + }, + "NestedSite": { + "title": "Site", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + } + } + }, + "NestedCable": { + "title": "Cable", + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "label": { + "title": "Label", + "type": "string", + "maxLength": 100 + } + } + }, + "CircuitTermination": { + "required": [ + "circuit", + "term_side", + "site", + "port_speed" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "circuit": { + "$ref": "#/definitions/NestedCircuit" + }, + "term_side": { + "title": "Termination", + "type": "string", + "enum": [ + "A", + "Z" + ] + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "port_speed": { + "title": "Port speed (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "upstream_speed": { + "title": "Upstream speed (Kbps)", + "description": "Upstream speed, if different from port speed", + "type": "integer", + "maximum": 2147483647, + "minimum": 0, + "x-nullable": true + }, + "xconnect_id": { + "title": "Cross-connect ID", + "type": "string", + "maxLength": 50 + }, + "pp_info": { + "title": "Patch panel/port(s)", + "type": "string", + "maxLength": 100 + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true + }, + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "connection_status": { + "title": "Connection status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + }, + "readOnly": true + }, + "cable": { + "$ref": "#/definitions/NestedCable" + } + } + }, + "WritableCircuitTermination": { + "required": [ + "circuit", + "term_side", + "site", + "port_speed" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "circuit": { + "title": "Circuit", + "type": "integer" + }, + "term_side": { + "title": "Termination", + "type": "string", + "enum": [ + "A", + "Z" + ] + }, + "site": { + "title": "Site", + "type": "integer" + }, + "port_speed": { + "title": "Port speed (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "upstream_speed": { + "title": "Upstream speed (Kbps)", + "description": "Upstream speed, if different from port speed", + "type": "integer", + "maximum": 2147483647, + "minimum": 0, + "x-nullable": true + }, + "xconnect_id": { + "title": "Cross-connect ID", + "type": "string", + "maxLength": 50 + }, + "pp_info": { + "title": "Patch panel/port(s)", + "type": "string", + "maxLength": 100 + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true + }, + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "connection_status": { + "title": "Connection status", + "type": "boolean", + "enum": [ + false, + true + ] + }, + "cable": { + "$ref": "#/definitions/NestedCable" + } + } + }, + "CircuitType": { + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "circuit_count": { + "title": "Circuit count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedProvider": { + "title": "Provider", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "circuit_count": { + "title": "Circuit count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedCircuitType": { + "title": "Type", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "circuit_count": { + "title": "Circuit count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedTenant": { + "title": "Tenant", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 30, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + } + } + }, + "Circuit": { + "required": [ + "cid", + "provider", + "type" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "cid": { + "title": "Circuit ID", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "provider": { + "$ref": "#/definitions/NestedProvider" + }, + "type": { + "$ref": "#/definitions/NestedCircuitType" + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "install_date": { + "title": "Date installed", + "type": "string", + "format": "date", + "x-nullable": true + }, + "commit_rate": { + "title": "Commit rate (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0, + "x-nullable": true + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "WritableCircuit": { + "required": [ + "cid", + "provider", + "type" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "cid": { + "title": "Circuit ID", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "provider": { + "title": "Provider", + "type": "integer" + }, + "type": { + "title": "Type", + "type": "integer" + }, + "status": { + "title": "Status", + "type": "integer", + "enum": [ + 2, + 3, + 1, + 4, + 0, + 5 + ] + }, + "tenant": { + "title": "Tenant", + "type": "integer", + "x-nullable": true + }, + "install_date": { + "title": "Date installed", + "type": "string", + "format": "date", + "x-nullable": true + }, + "commit_rate": { + "title": "Commit rate (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0, + "x-nullable": true + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "Provider": { + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "asn": { + "title": "ASN", + "type": "integer", + "maximum": 4294967295, + "minimum": 1, + "x-nullable": true + }, + "account": { + "title": "Account number", + "type": "string", + "maxLength": 30 + }, + "portal_url": { + "title": "Portal", + "type": "string", + "format": "uri", + "maxLength": 200 + }, + "noc_contact": { + "title": "NOC contact", + "type": "string" + }, + "admin_contact": { + "title": "Admin contact", + "type": "string" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "circuit_count": { + "title": "Circuit count", + "type": "integer", + "readOnly": true + } + } + }, + "Cable": { + "required": [ + "termination_a_type", + "termination_a_id", + "termination_b_type", + "termination_b_id" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "termination_a_type": { + "title": "Termination a type", + "type": "string" + }, + "termination_a_id": { + "title": "Termination a id", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "termination_a": { + "title": "Termination a", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "termination_b_type": { + "title": "Termination b type", + "type": "string" + }, + "termination_b_id": { + "title": "Termination b id", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "termination_b": { + "title": "Termination b", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 1300, + 1500, + 1510, + 1600, + 1610, + 1700, + 1800, + 1810, + 3000, + 3010, + 3020, + 3030, + 3040, + 3500, + 3510, + 3520, + 3800, + 5000 + ], + "x-nullable": true + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + } + }, + "label": { + "title": "Label", + "type": "string", + "maxLength": 100 + }, + "color": { + "title": "Color", + "type": "string", + "pattern": "^[0-9a-f]{6}$", + "maxLength": 6 + }, + "length": { + "title": "Length", + "type": "integer", + "maximum": 32767, + "minimum": 0, + "x-nullable": true + }, + "length_unit": { + "title": "Length unit", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + } + } + }, + "WritableCable": { + "required": [ + "termination_a_type", + "termination_a_id", + "termination_b_type", + "termination_b_id" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "termination_a_type": { + "title": "Termination a type", + "type": "string" + }, + "termination_a_id": { + "title": "Termination a id", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "termination_a": { + "title": "Termination a", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "termination_b_type": { + "title": "Termination b type", + "type": "string" + }, + "termination_b_id": { + "title": "Termination b id", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "termination_b": { + "title": "Termination b", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 1300, + 1500, + 1510, + 1600, + 1610, + 1700, + 1800, + 1810, + 3000, + 3010, + 3020, + 3030, + 3040, + 3500, + 3510, + 3520, + 3800, + 5000 + ], + "x-nullable": true + }, + "status": { + "title": "Status", + "type": "boolean", + "enum": [ + false, + true + ] + }, + "label": { + "title": "Label", + "type": "string", + "maxLength": 100 + }, + "color": { + "title": "Color", + "type": "string", + "pattern": "^[0-9a-f]{6}$", + "maxLength": 6 + }, + "length": { + "title": "Length", + "type": "integer", + "maximum": 32767, + "minimum": 0, + "x-nullable": true + }, + "length_unit": { + "title": "Length unit", + "type": "integer", + "enum": [ + 1200, + 1100, + 2100, + 2000 + ], + "x-nullable": true + } + } + }, + "NestedManufacturer": { + "title": "Manufacturer", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "devicetype_count": { + "title": "Devicetype count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedDeviceType": { + "title": "Device type", + "required": [ + "model", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "manufacturer": { + "$ref": "#/definitions/NestedManufacturer" + }, + "model": { + "title": "Model", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedDeviceRole": { + "title": "Device role", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedPlatform": { + "title": "Platform", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedRack": { + "title": "Rack", + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedDevice": { + "title": "Parent device", + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", "format": "uri", "readOnly": true }, - "cid": { - "title": "Circuit ID", + "name": { + "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "x-nullable": true + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true } } }, - "NestedSite": { - "title": "Site", + "NestedIPAddress": { + "title": "Primary ip", + "required": [ + "address" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "family": { + "title": "Family", + "type": "integer", + "readOnly": true + }, + "address": { + "title": "Address", + "description": "IPv4 or IPv6 address (with mask)", + "type": "string" + } + } + }, + "NestedCluster": { + "title": "Cluster", + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100, + "minLength": 1 + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedVirtualChassis": { + "title": "Virtual chassis", + "required": [ + "master" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "master": { + "$ref": "#/definitions/NestedDevice" + }, + "member_count": { + "title": "Member count", + "type": "integer", + "readOnly": true + } + } + }, + "Device": { + "required": [ + "device_type", + "device_role", + "site" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64, + "x-nullable": true + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "device_role": { + "$ref": "#/definitions/NestedDeviceRole" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "platform": { + "$ref": "#/definitions/NestedPlatform" + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this device", + "type": "string", + "maxLength": 50, + "x-nullable": true + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "rack": { + "$ref": "#/definitions/NestedRack" + }, + "position": { + "title": "Position (U)", + "description": "The lowest-numbered unit occupied by the device", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true + }, + "face": { + "title": "Face", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, + "parent_device": { + "$ref": "#/definitions/NestedDevice" + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "primary_ip": { + "$ref": "#/definitions/NestedIPAddress" + }, + "primary_ip4": { + "$ref": "#/definitions/NestedIPAddress" + }, + "primary_ip6": { + "$ref": "#/definitions/NestedIPAddress" + }, + "cluster": { + "$ref": "#/definitions/NestedCluster" + }, + "virtual_chassis": { + "$ref": "#/definitions/NestedVirtualChassis" + }, + "vc_position": { + "title": "Vc position", + "type": "integer", + "maximum": 255, + "minimum": 0, + "x-nullable": true + }, + "vc_priority": { + "title": "Vc priority", + "type": "integer", + "maximum": 255, + "minimum": 0, + "x-nullable": true + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "local_context_data": { + "title": "Local context data", + "type": "string", + "x-nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ConsolePort": { "required": [ - "name", - "slug" + "device", + "name" ], "type": "object", "properties": { @@ -12318,28 +17103,69 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "device": { + "$ref": "#/definitions/NestedDevice" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "slug": { - "title": "Slug", + "description": { + "title": "Description", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 100 + }, + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true + }, + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "connection_status": { + "title": "Connection status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + }, + "readOnly": true + }, + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "NestedDevice": { - "title": "Device", + "ConsolePortTemplate": { + "required": [ + "device_type", + "name" + ], "type": "object", "properties": { "id": { @@ -12347,27 +17173,20 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "device_type": { + "$ref": "#/definitions/NestedDeviceType" }, "name": { "title": "Name", "type": "string", - "maxLength": 64 - }, - "display_name": { - "title": "Display name", - "type": "string", - "readOnly": true + "maxLength": 50, + "minLength": 1 } } }, - "NestedInterface": { - "title": "Lag", + "WritableConsolePortTemplate": { "required": [ + "device_type", "name" ], "type": "object", @@ -12377,23 +17196,22 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "device_type": { + "title": "Device type", + "type": "integer" }, "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 50, + "minLength": 1 } } }, - "InterfaceNestedCircuit": { - "title": "Circuit", + "WritableConsolePort": { "required": [ - "cid" + "device", + "name" ], "type": "object", "properties": { @@ -12402,25 +17220,59 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", + "device": { + "title": "Device", + "type": "integer" + }, + "name": { + "title": "Name", "type": "string", - "format": "uri", - "readOnly": true + "maxLength": 50, + "minLength": 1 }, - "cid": { - "title": "Circuit ID", + "description": { + "title": "Description", "type": "string", - "maxLength": 50 + "maxLength": 100 + }, + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true + }, + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "connection_status": { + "title": "Connection status", + "type": "boolean", + "enum": [ + false, + true + ] + }, + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "InterfaceCircuitTermination": { - "title": "Circuit termination", + "ConsoleServerPortTemplate": { "required": [ - "circuit", - "term_side", - "port_speed" + "device_type", + "name" ], "type": "object", "properties": { @@ -12429,46 +17281,20 @@ "type": "integer", "readOnly": true }, - "circuit": { - "$ref": "#/definitions/InterfaceNestedCircuit" - }, - "term_side": { - "title": "Termination", - "type": "string", - "enum": [ - "A", - "Z" - ] - }, - "port_speed": { - "title": "Port speed (Kbps)", - "type": "integer", - "maximum": 2147483647, - "minimum": 0 - }, - "upstream_speed": { - "title": "Upstream speed (Kbps)", - "description": "Upstream speed, if different from port speed", - "type": "integer", - "maximum": 2147483647, - "minimum": 0 - }, - "xconnect_id": { - "title": "Cross-connect ID", - "type": "string", - "maxLength": 50 + "device_type": { + "$ref": "#/definitions/NestedDeviceType" }, - "pp_info": { - "title": "Patch panel/port(s)", + "name": { + "title": "Name", "type": "string", - "maxLength": 100 + "maxLength": 50, + "minLength": 1 } } }, - "InterfaceVLAN": { - "title": "Untagged vlan", + "WritableConsoleServerPortTemplate": { "required": [ - "vid", + "device_type", "name" ], "type": "object", @@ -12478,41 +17304,22 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true - }, - "vid": { - "title": "ID", - "type": "integer", - "maximum": 4094, - "minimum": 1 + "device_type": { + "title": "Device type", + "type": "integer" }, "name": { "title": "Name", "type": "string", - "maxLength": 64 - }, - "display_name": { - "title": "Display name", - "type": "string", - "readOnly": true + "maxLength": 50, + "minLength": 1 } } }, - "Interface": { - "title": "Interface", + "ConsoleServerPort": { "required": [ "device", - "name", - "form_factor", - "lag", - "circuit_termination", - "mode", - "untagged_vlan", - "tagged_vlans" + "name" ], "type": "object", "properties": { @@ -12527,10 +17334,30 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 50, + "minLength": 1 }, - "form_factor": { - "title": "Form factor", + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true + }, + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "connection_status": { + "title": "Connection status", "required": [ "label", "value" @@ -12541,84 +17368,89 @@ "type": "string" }, "value": { - "type": "integer" + "type": "boolean", + "x-nullable": true } - } - }, - "enabled": { - "title": "Enabled", - "type": "boolean" + }, + "readOnly": true }, - "lag": { - "$ref": "#/definitions/NestedInterface" + "cable": { + "$ref": "#/definitions/NestedCable" }, - "mtu": { - "title": "MTU", + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + } + } + }, + "WritableConsoleServerPort": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", "type": "integer", - "maximum": 32767, - "minimum": 0 + "readOnly": true }, - "mac_address": { - "title": "MAC Address", - "type": "string" + "device": { + "title": "Device", + "type": "integer" }, - "mgmt_only": { - "title": "OOB Management", - "description": "This interface is used only for out-of-band management", - "type": "boolean" + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 }, "description": { "title": "Description", "type": "string", "maxLength": 100 }, - "is_connected": { - "title": "Is connected", - "type": "string", - "readOnly": true - }, - "interface_connection": { - "title": "Interface connection", + "connected_endpoint_type": { + "title": "Connected endpoint type", "type": "string", "readOnly": true }, - "circuit_termination": { - "$ref": "#/definitions/InterfaceCircuitTermination" - }, - "mode": { - "title": "Mode", - "required": [ - "label", - "value" - ], + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "type": "integer" - } - } + "additionalProperties": { + "type": "string" + }, + "readOnly": true }, - "untagged_vlan": { - "$ref": "#/definitions/InterfaceVLAN" + "connection_status": { + "title": "Connection status", + "type": "boolean", + "enum": [ + false, + true + ] }, - "tagged_vlans": { + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { "type": "array", "items": { - "$ref": "#/definitions/InterfaceVLAN" + "type": "string", + "minLength": 1 } } } }, - "CircuitTermination": { + "DeviceBayTemplate": { "required": [ - "circuit", - "term_side", - "site", - "interface", - "port_speed" + "device_type", + "name" ], "type": "object", "properties": { @@ -12627,54 +17459,21 @@ "type": "integer", "readOnly": true }, - "circuit": { - "$ref": "#/definitions/NestedCircuit" - }, - "term_side": { - "title": "Termination", - "type": "string", - "enum": [ - "A", - "Z" - ] - }, - "site": { - "$ref": "#/definitions/NestedSite" - }, - "interface": { - "$ref": "#/definitions/Interface" - }, - "port_speed": { - "title": "Port speed (Kbps)", - "type": "integer", - "maximum": 2147483647, - "minimum": 0 - }, - "upstream_speed": { - "title": "Upstream speed (Kbps)", - "description": "Upstream speed, if different from port speed", - "type": "integer", - "maximum": 2147483647, - "minimum": 0 - }, - "xconnect_id": { - "title": "Cross-connect ID", - "type": "string", - "maxLength": 50 + "device_type": { + "$ref": "#/definitions/NestedDeviceType" }, - "pp_info": { - "title": "Patch panel/port(s)", + "name": { + "title": "Name", "type": "string", - "maxLength": 100 + "maxLength": 50, + "minLength": 1 } } }, - "WritableCircuitTermination": { + "WritableDeviceBayTemplate": { "required": [ - "circuit", - "term_side", - "site", - "port_speed" + "device_type", + "name" ], "type": "object", "properties": { @@ -12683,55 +17482,60 @@ "type": "integer", "readOnly": true }, - "circuit": { - "title": "Circuit", + "device_type": { + "title": "Device type", "type": "integer" }, - "term_side": { - "title": "Termination", + "name": { + "title": "Name", "type": "string", - "enum": [ - "A", - "Z" - ] - }, - "site": { - "title": "Site", - "type": "integer" - }, - "interface": { - "title": "Interface", - "type": "integer" - }, - "port_speed": { - "title": "Port speed (Kbps)", + "maxLength": 50, + "minLength": 1 + } + } + }, + "DeviceBay": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", "type": "integer", - "maximum": 2147483647, - "minimum": 0 + "readOnly": true }, - "upstream_speed": { - "title": "Upstream speed (Kbps)", - "description": "Upstream speed, if different from port speed", - "type": "integer", - "maximum": 2147483647, - "minimum": 0 + "device": { + "$ref": "#/definitions/NestedDevice" }, - "xconnect_id": { - "title": "Cross-connect ID", + "name": { + "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "pp_info": { - "title": "Patch panel/port(s)", + "description": { + "title": "Description", "type": "string", "maxLength": 100 + }, + "installed_device": { + "$ref": "#/definitions/NestedDevice" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "CircuitType": { + "WritableDeviceBay": { "required": [ - "name", - "slug" + "device", + "name" ], "type": "object", "properties": { @@ -12740,25 +17544,40 @@ "type": "integer", "readOnly": true }, + "device": { + "title": "Device", + "type": "integer" + }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "slug": { - "title": "Slug", + "description": { + "title": "Description", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 100 + }, + "installed_device": { + "title": "Installed device", + "type": "integer", + "x-nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "NestedProvider": { - "title": "Provider", + "DeviceRole": { "required": [ "name", - "slug" + "slug", + "color" ], "type": "object", "properties": { @@ -12767,30 +17586,48 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true - }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "color": { + "title": "Color", + "type": "string", + "pattern": "^[0-9a-f]{6}$", + "maxLength": 6, + "minLength": 1 + }, + "vm_role": { + "title": "VM Role", + "description": "Virtual machines may be assigned to this role", + "type": "boolean" + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true } } }, - "NestedCircuitType": { - "title": "Type", + "DeviceType": { "required": [ - "name", + "manufacturer", + "model", "slug" ], "type": "object", @@ -12800,30 +17637,100 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", + "manufacturer": { + "$ref": "#/definitions/NestedManufacturer" + }, + "model": { + "title": "Model", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "part_number": { + "title": "Part number", + "description": "Discrete part number (optional)", + "type": "string", + "maxLength": 50 + }, + "u_height": { + "title": "Height (U)", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "is_full_depth": { + "title": "Is full depth", + "description": "Device consumes both front and rear rack faces", + "type": "boolean" + }, + "subdevice_role": { + "title": "Subdevice role", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + } + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", "type": "string", - "format": "uri", + "format": "date", "readOnly": true }, - "name": { - "title": "Name", + "last_updated": { + "title": "Last updated", "type": "string", - "maxLength": 50 + "format": "date-time", + "readOnly": true }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true } } }, - "NestedTenant": { - "title": "Tenant", + "WritableDeviceType": { "required": [ - "name", + "manufacturer", + "model", "slug" ], "type": "object", @@ -12833,91 +17740,67 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "manufacturer": { + "title": "Manufacturer", + "type": "integer" }, - "name": { - "title": "Name", + "model": { + "title": "Model", "type": "string", - "maxLength": 30 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 - } - } - }, - "Circuit": { - "required": [ - "cid", - "provider", - "type", - "status", - "tenant" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true + "maxLength": 50, + "minLength": 1 }, - "cid": { - "title": "Circuit ID", + "display_name": { + "title": "Display name", "type": "string", - "maxLength": 50 - }, - "provider": { - "$ref": "#/definitions/NestedProvider" - }, - "type": { - "$ref": "#/definitions/NestedCircuitType" - }, - "status": { - "title": "Status", - "required": [ - "label", - "value" - ], - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "type": "integer" - } - } - }, - "tenant": { - "$ref": "#/definitions/NestedTenant" + "readOnly": true }, - "install_date": { - "title": "Date installed", + "part_number": { + "title": "Part number", + "description": "Discrete part number (optional)", "type": "string", - "format": "date" + "maxLength": 50 }, - "commit_rate": { - "title": "Commit rate (Kbps)", + "u_height": { + "title": "Height (U)", "type": "integer", - "maximum": 2147483647, + "maximum": 32767, "minimum": 0 }, - "description": { - "title": "Description", - "type": "string", - "maxLength": 100 + "is_full_depth": { + "title": "Is full depth", + "description": "Device consumes both front and rear rack faces", + "type": "boolean" + }, + "subdevice_role": { + "title": "Parent/child status", + "description": "Parent devices house child devices in device bays. Select \"None\" if this device type is neither a parent nor a child.", + "type": "boolean", + "enum": [ + null, + true, + false + ] }, "comments": { "title": "Comments", "type": "string" }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -12933,14 +17816,19 @@ "type": "string", "format": "date-time", "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true } } }, - "WritableCircuit": { + "DeviceWithConfigContext": { "required": [ - "cid", - "provider", - "type" + "device_type", + "device_role", + "site" ], "type": "object", "properties": { @@ -12949,59 +17837,148 @@ "type": "integer", "readOnly": true }, - "cid": { - "title": "Circuit ID", + "name": { + "title": "Name", + "type": "string", + "maxLength": 64, + "x-nullable": true + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "device_role": { + "$ref": "#/definitions/NestedDeviceRole" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "platform": { + "$ref": "#/definitions/NestedPlatform" + }, + "serial": { + "title": "Serial number", "type": "string", "maxLength": 50 }, - "provider": { - "title": "Provider", - "type": "integer" + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this device", + "type": "string", + "maxLength": 50, + "x-nullable": true }, - "type": { - "title": "Type", - "type": "integer" + "site": { + "$ref": "#/definitions/NestedSite" + }, + "rack": { + "$ref": "#/definitions/NestedRack" + }, + "position": { + "title": "Position (U)", + "description": "The lowest-numbered unit occupied by the device", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true + }, + "face": { + "title": "Face", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer", + "x-nullable": true + } + } + }, + "parent_device": { + "$ref": "#/definitions/NestedDevice" }, "status": { "title": "Status", - "type": "integer", - "enum": [ - 2, - 3, - 1, - 4, - 0, - 5 - ] + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } }, - "tenant": { - "title": "Tenant", - "type": "integer" + "primary_ip": { + "$ref": "#/definitions/NestedIPAddress" }, - "install_date": { - "title": "Date installed", - "type": "string", - "format": "date" + "primary_ip4": { + "$ref": "#/definitions/NestedIPAddress" + }, + "primary_ip6": { + "$ref": "#/definitions/NestedIPAddress" + }, + "cluster": { + "$ref": "#/definitions/NestedCluster" }, - "commit_rate": { - "title": "Commit rate (Kbps)", + "virtual_chassis": { + "$ref": "#/definitions/NestedVirtualChassis" + }, + "vc_position": { + "title": "Vc position", "type": "integer", - "maximum": 2147483647, - "minimum": 0 + "maximum": 255, + "minimum": 0, + "x-nullable": true }, - "description": { - "title": "Description", - "type": "string", - "maxLength": 100 + "vc_priority": { + "title": "Vc priority", + "type": "integer", + "maximum": 255, + "minimum": 0, + "x-nullable": true }, "comments": { "title": "Comments", "type": "string" }, + "local_context_data": { + "title": "Local context data", + "type": "string", + "x-nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" }, + "config_context": { + "title": "Config context", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, "created": { "title": "Created", "type": "string", @@ -13016,10 +17993,11 @@ } } }, - "Provider": { + "WritableDeviceWithConfigContext": { "required": [ - "name", - "slug" + "device_type", + "device_role", + "site" ], "type": "object", "properties": { @@ -13031,48 +18009,153 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "x-nullable": true }, - "slug": { - "title": "Slug", + "display_name": { + "title": "Display name", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "readOnly": true }, - "asn": { - "title": "ASN", + "device_type": { + "title": "Device type", + "type": "integer" + }, + "device_role": { + "title": "Device role", + "type": "integer" + }, + "tenant": { + "title": "Tenant", "type": "integer", - "maximum": 4294967295, - "minimum": 1 + "x-nullable": true }, - "account": { - "title": "Account number", + "platform": { + "title": "Platform", + "type": "integer", + "x-nullable": true + }, + "serial": { + "title": "Serial number", "type": "string", - "maxLength": 30 + "maxLength": 50 }, - "portal_url": { - "title": "Portal", + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this device", "type": "string", - "format": "uri", - "maxLength": 200 + "maxLength": 50, + "x-nullable": true }, - "noc_contact": { - "title": "NOC contact", - "type": "string" + "site": { + "title": "Site", + "type": "integer" }, - "admin_contact": { - "title": "Admin contact", - "type": "string" + "rack": { + "title": "Rack", + "type": "integer", + "x-nullable": true + }, + "position": { + "title": "Position (U)", + "description": "The lowest-numbered unit occupied by the device", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true + }, + "face": { + "title": "Rack face", + "type": "integer", + "enum": [ + 0, + 1 + ], + "x-nullable": true + }, + "parent_device": { + "$ref": "#/definitions/NestedDevice" + }, + "status": { + "title": "Status", + "type": "integer", + "enum": [ + 1, + 0, + 2, + 3, + 4, + 5, + 6 + ] + }, + "primary_ip": { + "title": "Primary ip", + "type": "string", + "readOnly": true + }, + "primary_ip4": { + "title": "Primary IPv4", + "type": "integer", + "x-nullable": true + }, + "primary_ip6": { + "title": "Primary IPv6", + "type": "integer", + "x-nullable": true + }, + "cluster": { + "title": "Cluster", + "type": "integer", + "x-nullable": true + }, + "virtual_chassis": { + "title": "Virtual chassis", + "type": "integer", + "x-nullable": true + }, + "vc_position": { + "title": "Vc position", + "type": "integer", + "maximum": 255, + "minimum": 0, + "x-nullable": true + }, + "vc_priority": { + "title": "Vc priority", + "type": "integer", + "maximum": 255, + "minimum": 0, + "x-nullable": true }, "comments": { "title": "Comments", "type": "string" }, + "local_context_data": { + "title": "Local context data", + "type": "string", + "x-nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" }, + "config_context": { + "title": "Config context", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, "created": { "title": "Created", "type": "string", @@ -13087,10 +18170,10 @@ } } }, - "WritableProvider": { + "NestedRearPortTemplate": { + "title": "Rear port", "required": [ - "name", - "slug" + "name" ], "type": "object", "properties": { @@ -13099,70 +18182,130 @@ "type": "integer", "readOnly": true }, - "name": { - "title": "Name", + "url": { + "title": "Url", "type": "string", - "maxLength": 50 + "format": "uri", + "readOnly": true }, - "slug": { - "title": "Slug", + "name": { + "title": "Name", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 - }, - "asn": { - "title": "ASN", + "maxLength": 64, + "minLength": 1 + } + } + }, + "FrontPortTemplate": { + "required": [ + "device_type", + "name", + "type", + "rear_port" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", "type": "integer", - "maximum": 4294967295, - "minimum": 1 + "readOnly": true }, - "account": { - "title": "Account number", - "type": "string", - "maxLength": 30 + "device_type": { + "$ref": "#/definitions/NestedDeviceType" }, - "portal_url": { - "title": "Portal", + "name": { + "title": "Name", "type": "string", - "format": "uri", - "maxLength": 200 + "maxLength": 64, + "minLength": 1 }, - "noc_contact": { - "title": "NOC contact", - "type": "string" + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "rear_port": { + "$ref": "#/definitions/NestedRearPortTemplate" + }, + "rear_port_position": { + "title": "Rear port position", + "type": "integer", + "default": 1, + "maximum": 64, + "minimum": 1 + } + } + }, + "WritableFrontPortTemplate": { + "required": [ + "device_type", + "name", + "type", + "rear_port" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true }, - "admin_contact": { - "title": "Admin contact", - "type": "string" + "device_type": { + "title": "Device type", + "type": "integer" }, - "comments": { - "title": "Comments", - "type": "string" + "name": { + "title": "Name", + "type": "string", + "maxLength": 64, + "minLength": 1 }, - "custom_fields": { - "title": "Custom fields", - "type": "object" + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 1000, + 1100, + 2200, + 2300, + 2310, + 2600, + 2610, + 2500, + 2400, + 2100, + 2110, + 2000 + ] }, - "created": { - "title": "Created", - "type": "string", - "format": "date", - "readOnly": true + "rear_port": { + "title": "Rear port", + "type": "integer" }, - "last_updated": { - "title": "Last updated", - "type": "string", - "format": "date-time", - "readOnly": true + "rear_port_position": { + "title": "Rear port position", + "type": "integer", + "default": 1, + "maximum": 64, + "minimum": 1 } } }, - "NestedManufacturer": { - "title": "Manufacturer", + "FrontPortRearPort": { + "title": "Rear port", "required": [ - "name", - "slug" + "name" ], "type": "object", "properties": { @@ -13180,23 +18323,17 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 - }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 } } }, - "NestedDeviceType": { - "title": "Device type", + "FrontPort": { "required": [ - "manufacturer", - "model", - "slug" + "device", + "name", + "type", + "rear_port" ], "type": "object", "properties": { @@ -13205,34 +18342,64 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "name": { + "title": "Name", "type": "string", - "format": "uri", - "readOnly": true + "maxLength": 64, + "minLength": 1 }, - "manufacturer": { - "$ref": "#/definitions/NestedManufacturer" + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } }, - "model": { - "title": "Model", - "type": "string", - "maxLength": 50 + "rear_port": { + "$ref": "#/definitions/FrontPortRearPort" }, - "slug": { - "title": "Slug", + "rear_port_position": { + "title": "Rear port position", + "type": "integer", + "default": 1, + "maximum": 64, + "minimum": 1 + }, + "description": { + "title": "Description", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 100 + }, + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "NestedDeviceRole": { - "title": "Device role", + "WritableFrontPort": { "required": [ + "device", "name", - "slug" + "type", + "rear_port" ], "type": "object", "properties": { @@ -13241,31 +18408,66 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "device": { + "title": "Device", + "type": "integer" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 }, - "slug": { - "title": "Slug", + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 1000, + 1100, + 2200, + 2300, + 2310, + 2600, + 2610, + 2500, + 2400, + 2100, + 2110, + 2000 + ] + }, + "rear_port": { + "title": "Rear port", + "type": "integer" + }, + "rear_port_position": { + "title": "Rear port position", + "type": "integer", + "default": 1, + "maximum": 64, + "minimum": 1 + }, + "description": { + "title": "Description", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 100 + }, + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "NestedPlatform": { - "title": "Platform", + "NestedInterface": { + "title": "Interface a", "required": [ - "name", - "slug" + "name" ], "type": "object", "properties": { @@ -13280,23 +18482,74 @@ "format": "uri", "readOnly": true }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "cable": { + "title": "Cable", + "type": "integer", + "x-nullable": true + }, + "connection_status": { + "title": "Connection status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + }, + "readOnly": true } } }, - "NestedRack": { - "title": "Rack", + "InterfaceConnection": { + "required": [ + "interface_b" + ], + "type": "object", + "properties": { + "interface_a": { + "$ref": "#/definitions/NestedInterface" + }, + "interface_b": { + "$ref": "#/definitions/NestedInterface" + }, + "connection_status": { + "title": "Connection status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + } + } + } + }, + "InterfaceTemplate": { "required": [ + "device_type", "name" ], "type": "object", @@ -13306,28 +18559,57 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "device_type": { + "$ref": "#/definitions/NestedDeviceType" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 + }, + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "form_factor": { + "title": "Form factor", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } }, - "display_name": { - "title": "Display name", - "type": "string", - "readOnly": true + "mgmt_only": { + "title": "Management only", + "type": "boolean" } } }, - "DeviceIPAddress": { - "title": "Primary ip", + "WritableInterfaceTemplate": { "required": [ - "address" + "device_type", + "name" ], "type": "object", "properties": { @@ -13336,27 +18618,98 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", + "device_type": { + "title": "Device type", + "type": "integer" + }, + "name": { + "title": "Name", "type": "string", - "format": "uri", - "readOnly": true + "maxLength": 64, + "minLength": 1 }, - "family": { - "title": "Family", + "type": { + "title": "Type", "type": "integer", + "enum": [ + 0, + 200, + 800, + 1000, + 1120, + 1130, + 1150, + 1170, + 1050, + 1100, + 1200, + 1300, + 1310, + 1320, + 1350, + 1400, + 1420, + 1500, + 1510, + 1650, + 1520, + 1550, + 1600, + 1700, + 1750, + 2600, + 2610, + 2620, + 2630, + 2640, + 2810, + 2820, + 2830, + 6100, + 6200, + 6300, + 6400, + 6500, + 6600, + 6700, + 3010, + 3020, + 3040, + 3080, + 3160, + 3320, + 3400, + 4000, + 4010, + 4040, + 4050, + 5000, + 5050, + 5100, + 5150, + 5200, + 5300, + 5310, + 5320, + 5330, + 32767 + ] + }, + "form_factor": { + "title": "Form factor", + "type": "string", "readOnly": true }, - "address": { - "title": "Address", - "description": "IPv4 or IPv6 address (with mask)", - "type": "string" + "mgmt_only": { + "title": "Management only", + "type": "boolean" } } }, - "NestedCluster": { - "title": "Cluster", + "NestedVLAN": { + "title": "Untagged vlan", "required": [ + "vid", "name" ], "type": "object", @@ -13372,53 +18725,29 @@ "format": "uri", "readOnly": true }, + "vid": { + "title": "ID", + "type": "integer", + "maximum": 4094, + "minimum": 1 + }, "name": { "title": "Name", "type": "string", - "maxLength": 100 - } - } - }, - "DeviceVirtualChassis": { - "title": "Virtual chassis", - "required": [ - "master" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true + "maxLength": 64, + "minLength": 1 }, - "url": { - "title": "Url", + "display_name": { + "title": "Display name", "type": "string", - "format": "uri", "readOnly": true - }, - "master": { - "$ref": "#/definitions/NestedDevice" } } }, - "Device": { + "DeviceInterface": { "required": [ - "device_type", - "device_role", - "tenant", - "platform", - "site", - "rack", - "position", - "face", - "status", - "primary_ip", - "primary_ip4", - "primary_ip6", - "cluster", - "virtual_chassis", - "vc_position" + "device", + "name" ], "type": "object", "properties": { @@ -13427,54 +18756,92 @@ "type": "integer", "readOnly": true }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 64, + "minLength": 1 }, - "display_name": { - "title": "Display name", - "type": "string", - "readOnly": true + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } }, - "device_type": { - "$ref": "#/definitions/NestedDeviceType" + "form_factor": { + "title": "Form factor", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } }, - "device_role": { - "$ref": "#/definitions/NestedDeviceRole" + "enabled": { + "title": "Enabled", + "type": "boolean" }, - "tenant": { - "$ref": "#/definitions/NestedTenant" + "lag": { + "$ref": "#/definitions/NestedInterface" }, - "platform": { - "$ref": "#/definitions/NestedPlatform" + "mtu": { + "title": "MTU", + "type": "integer", + "maximum": 65536, + "minimum": 1, + "x-nullable": true }, - "serial": { - "title": "Serial number", + "mac_address": { + "title": "MAC Address", "type": "string", - "maxLength": 50 + "x-nullable": true }, - "asset_tag": { - "title": "Asset tag", - "description": "A unique tag used to identify this device", - "type": "string", - "maxLength": 50 + "mgmt_only": { + "title": "OOB Management", + "description": "This interface is used only for out-of-band management", + "type": "boolean" }, - "site": { - "$ref": "#/definitions/NestedSite" + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 }, - "rack": { - "$ref": "#/definitions/NestedRack" + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true }, - "position": { - "title": "Position (U)", - "description": "The lowest-numbered unit occupied by the device", - "type": "integer", - "maximum": 32767, - "minimum": 1 + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true }, - "face": { - "title": "Face", + "connection_status": { + "title": "Connection status", "required": [ "label", "value" @@ -13485,18 +18852,17 @@ "type": "string" }, "value": { - "type": "integer", + "type": "boolean", "x-nullable": true } - } - }, - "parent_device": { - "title": "Parent device", - "type": "string", + }, "readOnly": true }, - "status": { - "title": "Status", + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "mode": { + "title": "Mode", "required": [ "label", "value" @@ -13511,57 +18877,31 @@ } } }, - "primary_ip": { - "$ref": "#/definitions/DeviceIPAddress" - }, - "primary_ip4": { - "$ref": "#/definitions/DeviceIPAddress" - }, - "primary_ip6": { - "$ref": "#/definitions/DeviceIPAddress" - }, - "cluster": { - "$ref": "#/definitions/NestedCluster" - }, - "virtual_chassis": { - "$ref": "#/definitions/DeviceVirtualChassis" - }, - "vc_position": { - "title": "Vc position", - "type": "integer", - "maximum": 255, - "minimum": 0 - }, - "vc_priority": { - "title": "Vc priority", - "type": "integer", - "maximum": 255, - "minimum": 0 - }, - "comments": { - "title": "Comments", - "type": "string" + "untagged_vlan": { + "$ref": "#/definitions/NestedVLAN" }, - "custom_fields": { - "title": "Custom fields", - "type": "object" + "tagged_vlans": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedVLAN" + }, + "uniqueItems": true }, - "created": { - "title": "Created", - "type": "string", - "format": "date", - "readOnly": true + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } }, - "last_updated": { - "title": "Last updated", + "count_ipaddresses": { + "title": "Count ipaddresses", "type": "string", - "format": "date-time", "readOnly": true } } }, - "ConsoleServerPort": { - "title": "Cs port", + "WritableDeviceInterface": { "required": [ "device", "name" @@ -13574,43 +18914,131 @@ "readOnly": true }, "device": { - "$ref": "#/definitions/NestedDevice" + "title": "Device", + "type": "integer" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 + }, + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 0, + 200, + 800, + 1000, + 1120, + 1130, + 1150, + 1170, + 1050, + 1100, + 1200, + 1300, + 1310, + 1320, + 1350, + 1400, + 1420, + 1500, + 1510, + 1650, + 1520, + 1550, + 1600, + 1700, + 1750, + 2600, + 2610, + 2620, + 2630, + 2640, + 2810, + 2820, + 2830, + 6100, + 6200, + 6300, + 6400, + 6500, + 6600, + 6700, + 3010, + 3020, + 3040, + 3080, + 3160, + 3320, + 3400, + 4000, + 4010, + 4040, + 4050, + 5000, + 5050, + 5100, + 5150, + 5200, + 5300, + 5310, + 5320, + 5330, + 32767 + ] }, - "connected_console": { - "title": "Connected console", + "form_factor": { + "title": "Form factor", "type": "string", "readOnly": true - } - } - }, - "ConsolePort": { - "required": [ - "device", - "name", - "cs_port" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", + }, + "enabled": { + "title": "Enabled", + "type": "boolean" + }, + "lag": { + "title": "Parent LAG", "type": "integer", - "readOnly": true + "x-nullable": true }, - "device": { - "$ref": "#/definitions/NestedDevice" + "mtu": { + "title": "MTU", + "type": "integer", + "maximum": 65536, + "minimum": 1, + "x-nullable": true }, - "name": { - "title": "Name", + "mac_address": { + "title": "MAC Address", "type": "string", - "maxLength": 50 + "x-nullable": true + }, + "mgmt_only": { + "title": "OOB Management", + "description": "This interface is used only for out-of-band management", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true }, - "cs_port": { - "$ref": "#/definitions/ConsoleServerPort" + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true }, "connection_status": { "title": "Connection status", @@ -13619,55 +19047,48 @@ false, true ] - } - } - }, - "ConsolePortTemplate": { - "required": [ - "device_type", - "name" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true }, - "device_type": { - "$ref": "#/definitions/NestedDeviceType" + "cable": { + "$ref": "#/definitions/NestedCable" }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 50 - } - } - }, - "WritableConsolePortTemplate": { - "required": [ - "device_type", - "name" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", + "mode": { + "title": "Mode", "type": "integer", - "readOnly": true + "enum": [ + 100, + 200, + 300 + ], + "x-nullable": true }, - "device_type": { - "title": "Device type", - "type": "integer" + "untagged_vlan": { + "title": "Untagged VLAN", + "type": "integer", + "x-nullable": true }, - "name": { - "title": "Name", + "tagged_vlans": { + "type": "array", + "items": { + "title": "Tagged VLANs", + "type": "integer" + }, + "uniqueItems": true + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "count_ipaddresses": { + "title": "Count ipaddresses", "type": "string", - "maxLength": 50 + "readOnly": true } } }, - "WritableConsolePort": { + "InventoryItem": { "required": [ "device", "name" @@ -13680,74 +19101,58 @@ "readOnly": true }, "device": { - "title": "Device", - "type": "integer" + "$ref": "#/definitions/NestedDevice" + }, + "parent": { + "title": "Parent", + "type": "integer", + "x-nullable": true }, "name": { "title": "Name", "type": "string", - "maxLength": 50 - }, - "cs_port": { - "title": "Console server port", - "type": "integer" + "maxLength": 50, + "minLength": 1 }, - "connection_status": { - "title": "Connection status", - "type": "boolean", - "enum": [ - false, - true - ] - } - } - }, - "ConsoleServerPortTemplate": { - "required": [ - "device_type", - "name" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true + "manufacturer": { + "$ref": "#/definitions/NestedManufacturer" }, - "device_type": { - "$ref": "#/definitions/NestedDeviceType" + "part_id": { + "title": "Part ID", + "type": "string", + "maxLength": 50 }, - "name": { - "title": "Name", + "serial": { + "title": "Serial number", "type": "string", "maxLength": 50 - } - } - }, - "WritableConsoleServerPortTemplate": { - "required": [ - "device_type", - "name" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true }, - "device_type": { - "title": "Device type", - "type": "integer" + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this item", + "type": "string", + "maxLength": 50, + "x-nullable": true }, - "name": { - "title": "Name", + "discovered": { + "title": "Discovered", + "type": "boolean" + }, + "description": { + "title": "Description", "type": "string", - "maxLength": 50 + "maxLength": 100 + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "WritableConsoleServerPort": { + "WritableInventoryItem": { "required": [ "device", "name" @@ -13763,17 +19168,61 @@ "title": "Device", "type": "integer" }, + "parent": { + "title": "Parent", + "type": "integer", + "x-nullable": true + }, "name": { "title": "Name", "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "manufacturer": { + "title": "Manufacturer", + "type": "integer", + "x-nullable": true + }, + "part_id": { + "title": "Part ID", + "type": "string", "maxLength": 50 + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this item", + "type": "string", + "maxLength": 50, + "x-nullable": true + }, + "discovered": { + "title": "Discovered", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "DeviceBayTemplate": { + "Manufacturer": { "required": [ - "device_type", - "name" + "name", + "slug" ], "type": "object", "properties": { @@ -13782,20 +19231,41 @@ "type": "integer", "readOnly": true }, - "device_type": { - "$ref": "#/definitions/NestedDeviceType" - }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "devicetype_count": { + "title": "Devicetype count", + "type": "integer", + "readOnly": true + }, + "inventoryitem_count": { + "title": "Inventoryitem count", + "type": "integer", + "readOnly": true + }, + "platform_count": { + "title": "Platform count", + "type": "integer", + "readOnly": true } } }, - "WritableDeviceBayTemplate": { + "Platform": { "required": [ - "device_type", - "name" + "name", + "slug" ], "type": "object", "properties": { @@ -13804,22 +19274,51 @@ "type": "integer", "readOnly": true }, - "device_type": { - "title": "Device type", - "type": "integer" - }, "name": { "title": "Name", "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "manufacturer": { + "$ref": "#/definitions/NestedManufacturer" + }, + "napalm_driver": { + "title": "NAPALM driver", + "description": "The name of the NAPALM driver to use when interacting with devices", + "type": "string", "maxLength": 50 + }, + "napalm_args": { + "title": "NAPALM arguments", + "description": "Additional arguments to pass when initiating the NAPALM driver (JSON format)", + "type": "string", + "x-nullable": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true } } }, - "DeviceBay": { + "WritablePlatform": { "required": [ - "device", "name", - "installed_device" + "slug" ], "type": "object", "properties": { @@ -13828,20 +19327,51 @@ "type": "integer", "readOnly": true }, - "device": { - "$ref": "#/definitions/NestedDevice" - }, "name": { "title": "Name", "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "manufacturer": { + "title": "Manufacturer", + "description": "Optionally limit this platform to devices of a certain manufacturer", + "type": "integer", + "x-nullable": true + }, + "napalm_driver": { + "title": "NAPALM driver", + "description": "The name of the NAPALM driver to use when interacting with devices", + "type": "string", "maxLength": 50 }, - "installed_device": { - "$ref": "#/definitions/NestedDevice" + "napalm_args": { + "title": "NAPALM arguments", + "description": "Additional arguments to pass when initiating the NAPALM driver (JSON format)", + "type": "string", + "x-nullable": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true } } }, - "WritableDeviceBay": { + "PowerPort": { "required": [ "device", "name" @@ -13854,25 +19384,83 @@ "readOnly": true }, "device": { - "title": "Device", - "type": "integer" + "$ref": "#/definitions/NestedDevice" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "installed_device": { - "title": "Installed device", - "type": "integer" + "maximum_draw": { + "title": "Maximum draw", + "description": "Maximum current draw (watts)", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true + }, + "allocated_draw": { + "title": "Allocated draw", + "description": "Allocated current draw (watts)", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true + }, + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "connection_status": { + "title": "Connection status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + }, + "readOnly": true + }, + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "DeviceRole": { + "NestedPowerPanel": { + "title": "Power panel", "required": [ - "name", - "slug", - "color" + "name" ], "type": "object", "properties": { @@ -13881,80 +19469,51 @@ "type": "integer", "readOnly": true }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 50 - }, - "slug": { - "title": "Slug", + "url": { + "title": "Url", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "format": "uri", + "readOnly": true }, - "color": { - "title": "Color", + "name": { + "title": "Name", "type": "string", - "pattern": "^[0-9a-f]{6}$", - "maxLength": 6 + "maxLength": 50, + "minLength": 1 }, - "vm_role": { - "title": "VM Role", - "description": "Virtual machines may be assigned to this role", - "type": "boolean" + "powerfeed_count": { + "title": "Powerfeed count", + "type": "integer", + "readOnly": true } } }, - "DeviceType": { + "PowerFeed": { "required": [ - "manufacturer", - "model", - "slug", - "interface_ordering", - "subdevice_role" + "power_panel", + "name" ], "type": "object", "properties": { "id": { "title": "ID", "type": "integer", - "readOnly": true - }, - "manufacturer": { - "$ref": "#/definitions/NestedManufacturer" - }, - "model": { - "title": "Model", - "type": "string", - "maxLength": 50 - }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 - }, - "part_number": { - "title": "Part number", - "description": "Discrete part number (optional)", - "type": "string", - "maxLength": 50 - }, - "u_height": { - "title": "Height (U)", - "type": "integer", - "maximum": 32767, - "minimum": 0 + "readOnly": true }, - "is_full_depth": { - "title": "Is full depth", - "description": "Device consumes both front and rear rack faces", - "type": "boolean" + "power_panel": { + "$ref": "#/definitions/NestedPowerPanel" + }, + "rack": { + "$ref": "#/definitions/NestedRack" }, - "interface_ordering": { - "title": "Interface ordering", + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "status": { + "title": "Status", "required": [ "label", "value" @@ -13967,25 +19526,14 @@ "value": { "type": "integer" } + }, + "default": { + "label": "Active", + "value": 1 } }, - "is_console_server": { - "title": "Is a console server", - "description": "This type of device has console server ports", - "type": "boolean" - }, - "is_pdu": { - "title": "Is a PDU", - "description": "This type of device has power outlets", - "type": "boolean" - }, - "is_network_device": { - "title": "Is a network device", - "description": "This type of device has network interfaces", - "type": "boolean" - }, - "subdevice_role": { - "title": "Subdevice role", + "type": { + "title": "Type", "required": [ "label", "value" @@ -13996,121 +19544,106 @@ "type": "string" }, "value": { - "type": "boolean", - "x-nullable": true + "type": "integer" } + }, + "default": { + "label": "Primary", + "value": 1 } }, - "comments": { - "title": "Comments", - "type": "string" + "supply": { + "title": "Supply", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + }, + "default": { + "label": "AC", + "value": 1 + } }, - "custom_fields": { - "title": "Custom fields", - "type": "object" + "phase": { + "title": "Phase", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + }, + "default": { + "label": "Single phase", + "value": 1 + } }, - "instance_count": { - "title": "Instance count", - "type": "integer", - "readOnly": true - } - } - }, - "WritableDeviceType": { - "required": [ - "manufacturer", - "model", - "slug" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", + "voltage": { + "title": "Voltage", "type": "integer", - "readOnly": true - }, - "manufacturer": { - "title": "Manufacturer", - "type": "integer" - }, - "model": { - "title": "Model", - "type": "string", - "maxLength": 50 - }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 - }, - "part_number": { - "title": "Part number", - "description": "Discrete part number (optional)", - "type": "string", - "maxLength": 50 + "maximum": 32767, + "minimum": 1 }, - "u_height": { - "title": "Height (U)", + "amperage": { + "title": "Amperage", "type": "integer", "maximum": 32767, - "minimum": 0 - }, - "is_full_depth": { - "title": "Is full depth", - "description": "Device consumes both front and rear rack faces", - "type": "boolean" + "minimum": 1 }, - "interface_ordering": { - "title": "Interface ordering", + "max_utilization": { + "title": "Max utilization", + "description": "Maximum permissible draw (percentage)", "type": "integer", - "enum": [ - 1, - 2 - ] - }, - "is_console_server": { - "title": "Is a console server", - "description": "This type of device has console server ports", - "type": "boolean" - }, - "is_pdu": { - "title": "Is a PDU", - "description": "This type of device has power outlets", - "type": "boolean" - }, - "is_network_device": { - "title": "Is a network device", - "description": "This type of device has network interfaces", - "type": "boolean" - }, - "subdevice_role": { - "title": "Parent/child status", - "description": "Parent devices house child devices in device bays. Select \"None\" if this device type is neither a parent nor a child.", - "type": "boolean", - "enum": [ - null, - true, - false - ], - "x-nullable": true + "maximum": 100, + "minimum": 1 }, "comments": { "title": "Comments", "type": "string" }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true } } }, - "WritableDevice": { + "WritablePowerFeed": { "required": [ - "device_type", - "device_role", - "site" + "power_panel", + "name" ], "type": "object", "properties": { @@ -14119,60 +19652,20 @@ "type": "integer", "readOnly": true }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 64 - }, - "device_type": { - "title": "Device type", - "type": "integer" - }, - "device_role": { - "title": "Device role", - "type": "integer" - }, - "tenant": { - "title": "Tenant", - "type": "integer" - }, - "platform": { - "title": "Platform", - "type": "integer" - }, - "serial": { - "title": "Serial number", - "type": "string", - "maxLength": 50 - }, - "asset_tag": { - "title": "Asset tag", - "description": "A unique tag used to identify this device", - "type": "string", - "maxLength": 50 - }, - "site": { - "title": "Site", + "power_panel": { + "title": "Power panel", "type": "integer" }, "rack": { "title": "Rack", - "type": "integer" - }, - "position": { - "title": "Position (U)", - "description": "The lowest-numbered unit occupied by the device", "type": "integer", - "maximum": 32767, - "minimum": 1 + "x-nullable": true }, - "face": { - "title": "Rack face", - "type": "integer", - "enum": [ - 0, - 1 - ] + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 }, "status": { "title": "Status", @@ -14181,43 +19674,63 @@ 1, 0, 2, - 3, - 4, - 5 + 4 ] }, - "primary_ip4": { - "title": "Primary IPv4", - "type": "integer" + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 1, + 2 + ] }, - "primary_ip6": { - "title": "Primary IPv6", - "type": "integer" + "supply": { + "title": "Supply", + "type": "integer", + "enum": [ + 1, + 2 + ] }, - "cluster": { - "title": "Cluster", - "type": "integer" + "phase": { + "title": "Phase", + "type": "integer", + "enum": [ + 1, + 3 + ] }, - "virtual_chassis": { - "title": "Virtual chassis", - "type": "integer" + "voltage": { + "title": "Voltage", + "type": "integer", + "maximum": 32767, + "minimum": 1 }, - "vc_position": { - "title": "Vc position", + "amperage": { + "title": "Amperage", "type": "integer", - "maximum": 255, - "minimum": 0 + "maximum": 32767, + "minimum": 1 }, - "vc_priority": { - "title": "Vc priority", + "max_utilization": { + "title": "Max utilization", + "description": "Maximum permissible draw (percentage)", "type": "integer", - "maximum": 255, - "minimum": 0 + "maximum": 100, + "minimum": 1 }, "comments": { "title": "Comments", "type": "string" }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -14236,13 +19749,11 @@ } } }, - "PeerInterface": { - "title": "Interface a", + "PowerPortTemplate": { + "title": "Power port", "required": [ - "device", - "name", - "form_factor", - "lag" + "device_type", + "name" ], "type": "object", "properties": { @@ -14251,138 +19762,37 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true - }, - "device": { - "$ref": "#/definitions/NestedDevice" + "device_type": { + "$ref": "#/definitions/NestedDeviceType" }, "name": { "title": "Name", "type": "string", - "maxLength": 64 - }, - "form_factor": { - "title": "Form factor", - "required": [ - "label", - "value" - ], - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "type": "integer" - } - } - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "lag": { - "$ref": "#/definitions/NestedInterface" + "maxLength": 50, + "minLength": 1 }, - "mtu": { - "title": "MTU", + "maximum_draw": { + "title": "Maximum draw", + "description": "Maximum current draw (watts)", "type": "integer", "maximum": 32767, - "minimum": 0 - }, - "mac_address": { - "title": "MAC Address", - "type": "string" - }, - "mgmt_only": { - "title": "OOB Management", - "description": "This interface is used only for out-of-band management", - "type": "boolean" - }, - "description": { - "title": "Description", - "type": "string", - "maxLength": 100 - } - } - }, - "InterfaceConnection": { - "required": [ - "interface_a", - "interface_b", - "connection_status" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "interface_a": { - "$ref": "#/definitions/PeerInterface" - }, - "interface_b": { - "$ref": "#/definitions/PeerInterface" + "minimum": 1, + "x-nullable": true }, - "connection_status": { - "title": "Connection status", - "required": [ - "label", - "value" - ], - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "type": "boolean", - "x-nullable": true - } - } - } - } - }, - "WritableInterfaceConnection": { - "required": [ - "interface_a", - "interface_b" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", + "allocated_draw": { + "title": "Allocated draw", + "description": "Allocated current draw (watts)", "type": "integer", - "readOnly": true - }, - "interface_a": { - "title": "Interface a", - "type": "integer" - }, - "interface_b": { - "title": "Interface b", - "type": "integer" - }, - "connection_status": { - "title": "Status", - "type": "boolean", - "enum": [ - false, - true - ] + "maximum": 32767, + "minimum": 1, + "x-nullable": true } } }, - "InterfaceTemplate": { + "PowerOutletTemplate": { "required": [ "device_type", - "name", - "form_factor" + "name" ], "type": "object", "properties": { @@ -14397,10 +19807,14 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 50, + "minLength": 1 }, - "form_factor": { - "title": "Form factor", + "power_port": { + "$ref": "#/definitions/PowerPortTemplate" + }, + "feed_leg": { + "title": "Feed leg", "required": [ "label", "value" @@ -14414,14 +19828,10 @@ "type": "integer" } } - }, - "mgmt_only": { - "title": "Management only", - "type": "boolean" } } }, - "WritableInterfaceTemplate": { + "WritablePowerOutletTemplate": { "required": [ "device_type", "name" @@ -14440,182 +19850,81 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 50, + "minLength": 1 }, - "form_factor": { - "title": "Form factor", + "power_port": { + "$ref": "#/definitions/PowerPortTemplate" + }, + "feed_leg": { + "title": "Feed leg", + "description": "Phase (for three-phase feeds)", "type": "integer", "enum": [ - 0, - 200, - 800, - 1000, - 1150, - 1170, - 1050, - 1100, - 1200, - 1300, - 1310, - 1320, - 1350, - 1400, - 1500, - 1510, - 1520, - 1550, - 1600, - 2600, - 2610, - 2620, - 2630, - 2640, - 3010, - 3020, - 3040, - 3080, - 3160, - 4000, - 4010, - 4040, - 4050, - 5000, - 5050, - 5100, - 5150, - 5200, - 32767 - ] - }, - "mgmt_only": { - "title": "Management only", - "type": "boolean" + 1, + 2, + 3 + ], + "x-nullable": true } } }, - "WritableInterface": { + "NestedPowerPort": { + "title": "Power port", "required": [ - "device", - "name" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "device": { - "title": "Device", - "type": "integer" - }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 64 - }, - "form_factor": { - "title": "Form factor", - "type": "integer", - "enum": [ - 0, - 200, - 800, - 1000, - 1150, - 1170, - 1050, - 1100, - 1200, - 1300, - 1310, - 1320, - 1350, - 1400, - 1500, - 1510, - 1520, - 1550, - 1600, - 2600, - 2610, - 2620, - 2630, - 2640, - 3010, - 3020, - 3040, - 3080, - 3160, - 4000, - 4010, - 4040, - 4050, - 5000, - 5050, - 5100, - 5150, - 5200, - 32767 - ] - }, - "enabled": { - "title": "Enabled", - "type": "boolean" - }, - "lag": { - "title": "Parent LAG", - "type": "integer" - }, - "mtu": { - "title": "MTU", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", "type": "integer", - "maximum": 32767, - "minimum": 0 + "readOnly": true }, - "mac_address": { - "title": "MAC Address", - "type": "string" + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true }, - "mgmt_only": { - "title": "OOB Management", - "description": "This interface is used only for out-of-band management", - "type": "boolean" + "device": { + "$ref": "#/definitions/NestedDevice" }, - "description": { - "title": "Description", + "name": { + "title": "Name", "type": "string", - "maxLength": 100 + "maxLength": 50, + "minLength": 1 }, - "mode": { - "title": "Mode", + "cable": { + "title": "Cable", "type": "integer", - "enum": [ - 100, - 200, - 300 - ] - }, - "untagged_vlan": { - "title": "Untagged VLAN", - "type": "integer" + "x-nullable": true }, - "tagged_vlans": { - "type": "array", - "items": { - "title": "Tagged VLANs", - "type": "integer" + "connection_status": { + "title": "Connection status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } }, - "uniqueItems": true + "readOnly": true } } }, - "InventoryItem": { + "PowerOutlet": { "required": [ "device", - "parent", - "name", - "manufacturer" + "name" ], "type": "object", "properties": { @@ -14627,46 +19936,81 @@ "device": { "$ref": "#/definitions/NestedDevice" }, - "parent": { - "title": "Parent", - "type": "integer" - }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "manufacturer": { - "$ref": "#/definitions/NestedManufacturer" + "power_port": { + "$ref": "#/definitions/NestedPowerPort" }, - "part_id": { - "title": "Part ID", - "type": "string", - "maxLength": 50 + "feed_leg": { + "title": "Feed leg", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } }, - "serial": { - "title": "Serial number", + "description": { + "title": "Description", "type": "string", - "maxLength": 50 + "maxLength": 100 }, - "asset_tag": { - "title": "Asset tag", - "description": "A unique tag used to identify this item", + "connected_endpoint_type": { + "title": "Connected endpoint type", "type": "string", - "maxLength": 50 + "readOnly": true }, - "discovered": { - "title": "Discovered", - "type": "boolean" + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true }, - "description": { - "title": "Description", - "type": "string", - "maxLength": 100 + "connection_status": { + "title": "Connection status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + }, + "readOnly": true + }, + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "WritableInventoryItem": { + "WritablePowerOutlet": { "required": [ "device", "name" @@ -14682,47 +20026,69 @@ "title": "Device", "type": "integer" }, - "parent": { - "title": "Parent", - "type": "integer" - }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "manufacturer": { - "title": "Manufacturer", - "type": "integer" + "power_port": { + "title": "Power port", + "type": "integer", + "x-nullable": true }, - "part_id": { - "title": "Part ID", - "type": "string", - "maxLength": 50 + "feed_leg": { + "title": "Feed leg", + "description": "Phase (for three-phase feeds)", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ], + "x-nullable": true }, - "serial": { - "title": "Serial number", + "description": { + "title": "Description", "type": "string", - "maxLength": 50 + "maxLength": 100 }, - "asset_tag": { - "title": "Asset tag", - "description": "A unique tag used to identify this item", + "connected_endpoint_type": { + "title": "Connected endpoint type", "type": "string", - "maxLength": 50 + "readOnly": true }, - "discovered": { - "title": "Discovered", - "type": "boolean" + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true }, - "description": { - "title": "Description", - "type": "string", - "maxLength": 100 + "connection_status": { + "title": "Connection status", + "type": "boolean", + "enum": [ + false, + true + ] + }, + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "Manufacturer": { + "NestedRackGroup": { + "title": "Rack group", "required": [ "name", "slug" @@ -14734,25 +20100,37 @@ "type": "integer", "readOnly": true }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true } } }, - "Platform": { + "PowerPanel": { "required": [ - "name", - "slug", - "manufacturer" + "site", + "name" ], "type": "object", "properties": { @@ -14761,88 +20139,62 @@ "type": "integer", "readOnly": true }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 50 - }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "site": { + "$ref": "#/definitions/NestedSite" }, - "manufacturer": { - "$ref": "#/definitions/NestedManufacturer" + "rack_group": { + "$ref": "#/definitions/NestedRackGroup" }, - "napalm_driver": { - "title": "NAPALM driver", - "description": "The name of the NAPALM driver to use when interacting with devices", + "name": { + "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "rpc_client": { - "title": "Legacy RPC client", - "type": "string", - "enum": [ - "juniper-junos", - "cisco-ios", - "opengear" - ] + "powerfeed_count": { + "title": "Powerfeed count", + "type": "integer", + "readOnly": true } } }, - "WritablePlatform": { + "WritablePowerPanel": { "required": [ - "name", - "slug" + "site", + "name" ], "type": "object", "properties": { "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 50 - }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "title": "ID", + "type": "integer", + "readOnly": true }, - "manufacturer": { - "title": "Manufacturer", - "description": "Optionally limit this platform to devices of a certain manufacturer", + "site": { + "title": "Site", "type": "integer" }, - "napalm_driver": { - "title": "NAPALM driver", - "description": "The name of the NAPALM driver to use when interacting with devices", - "type": "string", - "maxLength": 50 + "rack_group": { + "title": "Rack group", + "type": "integer", + "x-nullable": true }, - "rpc_client": { - "title": "Legacy RPC client", + "name": { + "title": "Name", "type": "string", - "enum": [ - "juniper-junos", - "cisco-ios", - "opengear" - ] + "maxLength": 50, + "minLength": 1 + }, + "powerfeed_count": { + "title": "Powerfeed count", + "type": "integer", + "readOnly": true } } }, - "PowerOutlet": { - "title": "Power outlet", + "WritablePowerPortTemplate": { "required": [ - "device", + "device_type", "name" ], "type": "object", @@ -14852,26 +20204,38 @@ "type": "integer", "readOnly": true }, - "device": { - "$ref": "#/definitions/NestedDevice" + "device_type": { + "title": "Device type", + "type": "integer" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "connected_port": { - "title": "Connected port", - "type": "string", - "readOnly": true + "maximum_draw": { + "title": "Maximum draw", + "description": "Maximum current draw (watts)", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true + }, + "allocated_draw": { + "title": "Allocated draw", + "description": "Allocated current draw (watts)", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true } } }, - "PowerPort": { + "WritablePowerPort": { "required": [ "device", - "name", - "power_outlet" + "name" ], "type": "object", "properties": { @@ -14881,15 +20245,49 @@ "readOnly": true }, "device": { - "$ref": "#/definitions/NestedDevice" + "title": "Device", + "type": "integer" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "maximum_draw": { + "title": "Maximum draw", + "description": "Maximum current draw (watts)", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true + }, + "allocated_draw": { + "title": "Allocated draw", + "description": "Allocated current draw (watts)", + "type": "integer", + "maximum": 32767, + "minimum": 1, + "x-nullable": true + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "connected_endpoint_type": { + "title": "Connected endpoint type", + "type": "string", + "readOnly": true }, - "power_outlet": { - "$ref": "#/definitions/PowerOutlet" + "connected_endpoint": { + "title": "Connected endpoint", + "description": "\n Return the appropriate serializer for the type of connected object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true }, "connection_status": { "title": "Connection status", @@ -14898,13 +20296,24 @@ false, true ] + }, + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "PowerOutletTemplate": { + "RackGroup": { "required": [ - "device_type", - "name" + "name", + "slug", + "site" ], "type": "object", "properties": { @@ -14913,20 +20322,35 @@ "type": "integer", "readOnly": true }, - "device_type": { - "$ref": "#/definitions/NestedDeviceType" - }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true } } }, - "WritablePowerOutletTemplate": { + "WritableRackGroup": { "required": [ - "device_type", - "name" + "name", + "slug", + "site" ], "type": "object", "properties": { @@ -14935,21 +20359,35 @@ "type": "integer", "readOnly": true }, - "device_type": { - "title": "Device type", - "type": "integer" - }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "site": { + "title": "Site", + "type": "integer" + }, + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true } } }, - "WritablePowerOutlet": { + "NestedUser": { + "title": "User", "required": [ - "device", - "name" + "username" ], "type": "object", "properties": { @@ -14958,21 +20396,22 @@ "type": "integer", "readOnly": true }, - "device": { - "title": "Device", - "type": "integer" - }, - "name": { - "title": "Name", + "username": { + "title": "Username", + "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.", "type": "string", - "maxLength": 50 + "pattern": "^[\\w.@+-]+$", + "maxLength": 150, + "minLength": 1 } } }, - "PowerPortTemplate": { + "RackReservation": { "required": [ - "device_type", - "name" + "rack", + "units", + "user", + "description" ], "type": "object", "properties": { @@ -14981,20 +20420,44 @@ "type": "integer", "readOnly": true }, - "device_type": { - "$ref": "#/definitions/NestedDeviceType" + "rack": { + "$ref": "#/definitions/NestedRack" }, - "name": { - "title": "Name", + "units": { + "type": "array", + "items": { + "title": "Units", + "type": "integer", + "maximum": 32767, + "minimum": 0 + } + }, + "created": { + "title": "Created", "type": "string", - "maxLength": 50 + "format": "date", + "readOnly": true + }, + "user": { + "$ref": "#/definitions/NestedUser" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100, + "minLength": 1 } } }, - "WritablePowerPortTemplate": { + "WritableRackReservation": { "required": [ - "device_type", - "name" + "rack", + "units", + "user", + "description" ], "type": "object", "properties": { @@ -15003,21 +20466,47 @@ "type": "integer", "readOnly": true }, - "device_type": { - "title": "Device type", + "rack": { + "title": "Rack", "type": "integer" }, - "name": { - "title": "Name", + "units": { + "type": "array", + "items": { + "title": "Units", + "type": "integer", + "maximum": 32767, + "minimum": 0 + } + }, + "created": { + "title": "Created", "type": "string", - "maxLength": 50 + "format": "date", + "readOnly": true + }, + "user": { + "title": "User", + "type": "integer" + }, + "tenant": { + "title": "Tenant", + "type": "integer", + "x-nullable": true + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100, + "minLength": 1 } } }, - "WritablePowerPort": { + "RackRole": { "required": [ - "device", - "name" + "name", + "slug", + "color" ], "type": "object", "properties": { @@ -15026,34 +20515,39 @@ "type": "integer", "readOnly": true }, - "device": { - "title": "Device", - "type": "integer" - }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "power_outlet": { - "title": "Power outlet", - "type": "integer" + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 }, - "connection_status": { - "title": "Connection status", - "type": "boolean", - "enum": [ - false, - true - ] + "color": { + "title": "Color", + "type": "string", + "pattern": "^[0-9a-f]{6}$", + "maxLength": 6, + "minLength": 1 + }, + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true } } }, - "RackGroup": { + "NestedRackRole": { + "title": "Role", "required": [ - "name", - "slug", - "site" + "name", + "slug" ], "type": "object", "properties": { @@ -15062,27 +20556,36 @@ "type": "integer", "readOnly": true }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "site": { - "$ref": "#/definitions/NestedSite" + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true } } }, - "WritableRackGroup": { + "Rack": { "required": [ "name", - "slug", "site" ], "type": "object", @@ -15095,49 +20598,176 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, - "slug": { - "title": "Slug", + "facility_id": { + "title": "Facility ID", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "x-nullable": true + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true }, "site": { - "title": "Site", - "type": "integer" - } - } - }, - "NestedUser": { - "title": "User", - "required": [ - "username" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", + "$ref": "#/definitions/NestedSite" + }, + "group": { + "$ref": "#/definitions/NestedRackGroup" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "role": { + "$ref": "#/definitions/NestedRackRole" + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this rack", + "type": "string", + "maxLength": 50, + "x-nullable": true + }, + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "width": { + "title": "Width", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "u_height": { + "title": "Height (U)", + "type": "integer", + "maximum": 100, + "minimum": 1 + }, + "desc_units": { + "title": "Descending units", + "description": "Units are numbered top-to-bottom", + "type": "boolean" + }, + "outer_width": { + "title": "Outer width", + "type": "integer", + "maximum": 32767, + "minimum": 0, + "x-nullable": true + }, + "outer_depth": { + "title": "Outer depth", "type": "integer", + "maximum": 32767, + "minimum": 0, + "x-nullable": true + }, + "outer_unit": { + "title": "Outer unit", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", "readOnly": true }, - "username": { - "title": "Username", - "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.", + "last_updated": { + "title": "Last updated", "type": "string", - "pattern": "^[\\w.@+-]+$", - "maxLength": 150 + "format": "date-time", + "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "powerfeed_count": { + "title": "Powerfeed count", + "type": "integer", + "readOnly": true } } }, - "RackReservation": { + "WritableRack": { "required": [ - "rack", - "units", - "user", - "tenant", - "description" + "name", + "site" ], "type": "object", "properties": { @@ -15146,113 +20776,164 @@ "type": "integer", "readOnly": true }, - "rack": { - "$ref": "#/definitions/NestedRack" + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "facility_id": { + "title": "Facility ID", + "type": "string", + "maxLength": 50, + "x-nullable": true + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "site": { + "title": "Site", + "type": "integer" + }, + "group": { + "title": "Group", + "type": "integer", + "x-nullable": true + }, + "tenant": { + "title": "Tenant", + "type": "integer", + "x-nullable": true + }, + "status": { + "title": "Status", + "type": "integer", + "enum": [ + 3, + 2, + 0, + 1, + 4 + ] + }, + "role": { + "title": "Role", + "type": "integer", + "x-nullable": true + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this rack", + "type": "string", + "maxLength": 50, + "x-nullable": true + }, + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 100, + 200, + 300, + 1000, + 1100 + ], + "x-nullable": true + }, + "width": { + "title": "Width", + "description": "Rail-to-rail width", + "type": "integer", + "enum": [ + 19, + 23 + ] }, - "units": { - "type": "array", - "items": { - "title": "Units", - "type": "integer", - "maximum": 32767, - "minimum": 0 - } + "u_height": { + "title": "Height (U)", + "type": "integer", + "maximum": 100, + "minimum": 1 }, - "created": { - "title": "Created", - "type": "string", - "format": "date-time", - "readOnly": true + "desc_units": { + "title": "Descending units", + "description": "Units are numbered top-to-bottom", + "type": "boolean" }, - "user": { - "$ref": "#/definitions/NestedUser" + "outer_width": { + "title": "Outer width", + "type": "integer", + "maximum": 32767, + "minimum": 0, + "x-nullable": true }, - "tenant": { - "$ref": "#/definitions/NestedTenant" + "outer_depth": { + "title": "Outer depth", + "type": "integer", + "maximum": 32767, + "minimum": 0, + "x-nullable": true }, - "description": { - "title": "Description", - "type": "string", - "maxLength": 100 - } - } - }, - "WritableRackReservation": { - "required": [ - "rack", - "units", - "user", - "description" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", + "outer_unit": { + "title": "Outer unit", "type": "integer", - "readOnly": true + "enum": [ + 1000, + 2000 + ], + "x-nullable": true }, - "rack": { - "title": "Rack", - "type": "integer" + "comments": { + "title": "Comments", + "type": "string" }, - "units": { + "tags": { "type": "array", "items": { - "title": "Units", - "type": "integer", - "maximum": 32767, - "minimum": 0 + "type": "string", + "minLength": 1 } }, - "user": { - "title": "User", - "type": "integer" + "custom_fields": { + "title": "Custom fields", + "type": "object" }, - "description": { - "title": "Description", + "created": { + "title": "Created", "type": "string", - "maxLength": 100 - } - } - }, - "RackRole": { - "required": [ - "name", - "slug", - "color" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", + "format": "date", "readOnly": true }, - "name": { - "title": "Name", + "last_updated": { + "title": "Last updated", "type": "string", - "maxLength": 50 + "format": "date-time", + "readOnly": true }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true }, - "color": { - "title": "Color", - "type": "string", - "pattern": "^[0-9a-f]{6}$", - "maxLength": 6 + "powerfeed_count": { + "title": "Powerfeed count", + "type": "integer", + "readOnly": true } } }, - "NestedRackGroup": { - "title": "Group", + "RearPortTemplate": { "required": [ + "device_type", "name", - "slug" + "type" ], "type": "object", "properties": { @@ -15261,31 +20942,44 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "device_type": { + "$ref": "#/definitions/NestedDeviceType" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "positions": { + "title": "Positions", + "type": "integer", + "maximum": 64, + "minimum": 1 } } }, - "NestedRackRole": { - "title": "Role", + "WritableRearPortTemplate": { "required": [ + "device_type", "name", - "slug" + "type" ], "type": "object", "properties": { @@ -15294,36 +20988,47 @@ "type": "integer", "readOnly": true }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "device_type": { + "title": "Device type", + "type": "integer" }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 1000, + 1100, + 2200, + 2300, + 2310, + 2600, + 2610, + 2500, + 2400, + 2100, + 2110, + 2000 + ] + }, + "positions": { + "title": "Positions", + "type": "integer", + "maximum": 64, + "minimum": 1 } } }, - "Rack": { + "RearPort": { "required": [ + "device", "name", - "facility_id", - "site", - "group", - "tenant", - "role", - "type", - "width" + "type" ], "type": "object", "properties": { @@ -15332,37 +21037,14 @@ "type": "integer", "readOnly": true }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, "name": { "title": "Name", "type": "string", - "maxLength": 50 - }, - "facility_id": { - "title": "Facility ID", - "type": "string", - "maxLength": 50 - }, - "display_name": { - "title": "Display name", - "type": "string", - "readOnly": true - }, - "site": { - "$ref": "#/definitions/NestedSite" - }, - "group": { - "$ref": "#/definitions/NestedRackGroup" - }, - "tenant": { - "$ref": "#/definitions/NestedTenant" - }, - "role": { - "$ref": "#/definitions/NestedRackRole" - }, - "serial": { - "title": "Serial number", - "type": "string", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 }, "type": { "title": "Type", @@ -15380,59 +21062,34 @@ } } }, - "width": { - "title": "Width", - "required": [ - "label", - "value" - ], - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "type": "integer" - } - } - }, - "u_height": { - "title": "Height (U)", + "positions": { + "title": "Positions", "type": "integer", - "maximum": 100, + "maximum": 64, "minimum": 1 }, - "desc_units": { - "title": "Descending units", - "description": "Units are numbered top-to-bottom", - "type": "boolean" - }, - "comments": { - "title": "Comments", - "type": "string" - }, - "custom_fields": { - "title": "Custom fields", - "type": "object" - }, - "created": { - "title": "Created", + "description": { + "title": "Description", "type": "string", - "format": "date", - "readOnly": true + "maxLength": 100 }, - "last_updated": { - "title": "Last updated", - "type": "string", - "format": "date-time", - "readOnly": true + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "WritableRack": { + "WritableRearPort": { "required": [ + "device", "name", - "site" + "type" ], "type": "object", "properties": { @@ -15441,87 +21098,54 @@ "type": "integer", "readOnly": true }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 50 - }, - "facility_id": { - "title": "Facility ID", - "type": "string", - "maxLength": 50 - }, - "site": { - "title": "Site", - "type": "integer" - }, - "group": { - "title": "Group", - "type": "integer" - }, - "tenant": { - "title": "Tenant", - "type": "integer" - }, - "role": { - "title": "Role", + "device": { + "title": "Device", "type": "integer" }, - "serial": { - "title": "Serial number", + "name": { + "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 64, + "minLength": 1 }, "type": { "title": "Type", "type": "integer", "enum": [ - 100, - 200, - 300, 1000, - 1100 - ] - }, - "width": { - "title": "Width", - "description": "Rail-to-rail width", - "type": "integer", - "enum": [ - 19, - 23 + 1100, + 2200, + 2300, + 2310, + 2600, + 2610, + 2500, + 2400, + 2100, + 2110, + 2000 ] }, - "u_height": { - "title": "Height (U)", + "positions": { + "title": "Positions", "type": "integer", - "maximum": 100, + "maximum": 64, "minimum": 1 }, - "desc_units": { - "title": "Descending units", - "description": "Units are numbered top-to-bottom", - "type": "boolean" - }, - "comments": { - "title": "Comments", - "type": "string" - }, - "custom_fields": { - "title": "Custom fields", - "type": "object" - }, - "created": { - "title": "Created", + "description": { + "title": "Description", "type": "string", - "format": "date", - "readOnly": true + "maxLength": 100 }, - "last_updated": { - "title": "Last updated", - "type": "string", - "format": "date-time", - "readOnly": true + "cable": { + "$ref": "#/definitions/NestedCable" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, @@ -15547,22 +21171,102 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "site_count": { + "title": "Site count", + "type": "integer", + "readOnly": true } } }, "Region": { "required": [ "name", - "slug", - "parent" + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "parent": { + "$ref": "#/definitions/NestedRegion" + }, + "site_count": { + "title": "Site count", + "type": "integer", + "readOnly": true + } + } + }, + "WritableRegion": { + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "parent": { + "title": "Parent", + "type": "integer", + "x-nullable": true + }, + "site_count": { + "title": "Site count", + "type": "integer", + "readOnly": true + } + } + }, + "Site": { + "required": [ + "name", + "slug" ], "type": "object", "properties": { @@ -15571,60 +21275,164 @@ "type": "integer", "readOnly": true }, - "name": { - "title": "Name", + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "region": { + "$ref": "#/definitions/NestedRegion" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "facility": { + "title": "Facility", + "type": "string", + "maxLength": 50 + }, + "asn": { + "title": "ASN", + "type": "integer", + "maximum": 4294967295, + "minimum": 1, + "x-nullable": true + }, + "time_zone": { + "title": "Time zone", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "physical_address": { + "title": "Physical address", + "type": "string", + "maxLength": 200 + }, + "shipping_address": { + "title": "Shipping address", + "type": "string", + "maxLength": 200 + }, + "latitude": { + "title": "Latitude", + "type": "string", + "format": "decimal", + "x-nullable": true + }, + "longitude": { + "title": "Longitude", + "type": "string", + "format": "decimal", + "x-nullable": true + }, + "contact_name": { + "title": "Contact name", + "type": "string", + "maxLength": 50 + }, + "contact_phone": { + "title": "Contact phone", + "type": "string", + "maxLength": 20 + }, + "contact_email": { + "title": "Contact E-mail", + "type": "string", + "format": "email", + "maxLength": 254 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", "type": "string", - "maxLength": 50 + "format": "date", + "readOnly": true }, - "slug": { - "title": "Slug", + "last_updated": { + "title": "Last updated", "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "format": "date-time", + "readOnly": true }, - "parent": { - "$ref": "#/definitions/NestedRegion" - } - } - }, - "WritableRegion": { - "required": [ - "name", - "slug" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", + "circuit_count": { + "title": "Circuit count", "type": "integer", "readOnly": true }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 50 + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true }, - "parent": { - "title": "Parent", - "type": "integer" + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true } } }, - "Site": { + "WritableSite": { "required": [ "name", - "slug", - "status", - "region", - "tenant" + "slug" ], "type": "object", "properties": { @@ -15636,36 +21444,35 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "status": { "title": "Status", - "required": [ - "label", - "value" - ], - "type": "object", - "properties": { - "label": { - "type": "string" - }, - "value": { - "type": "integer" - } - } + "type": "integer", + "enum": [ + 1, + 2, + 4 + ] }, "region": { - "$ref": "#/definitions/NestedRegion" + "title": "Region", + "type": "integer", + "x-nullable": true }, "tenant": { - "$ref": "#/definitions/NestedTenant" + "title": "Tenant", + "type": "integer", + "x-nullable": true }, "facility": { "title": "Facility", @@ -15676,7 +21483,8 @@ "title": "ASN", "type": "integer", "maximum": 4294967295, - "minimum": 1 + "minimum": 1, + "x-nullable": true }, "time_zone": { "title": "Time zone", @@ -15697,6 +21505,18 @@ "type": "string", "maxLength": 200 }, + "latitude": { + "title": "Latitude", + "type": "string", + "format": "decimal", + "x-nullable": true + }, + "longitude": { + "title": "Longitude", + "type": "string", + "format": "decimal", + "x-nullable": true + }, "contact_name": { "title": "Contact name", "type": "string", @@ -15717,6 +21537,13 @@ "title": "Comments", "type": "string" }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -15733,37 +21560,229 @@ "format": "date-time", "readOnly": true }, - "count_prefixes": { - "title": "Count prefixes", + "circuit_count": { + "title": "Circuit count", + "type": "integer", + "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true + }, + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true + } + } + }, + "VirtualChassis": { + "required": [ + "master" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "master": { + "$ref": "#/definitions/NestedDevice" + }, + "domain": { + "title": "Domain", + "type": "string", + "maxLength": 30 + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "member_count": { + "title": "Member count", + "type": "integer", + "readOnly": true + } + } + }, + "WritableVirtualChassis": { + "required": [ + "master" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "master": { + "title": "Master", + "type": "integer" + }, + "domain": { + "title": "Domain", + "type": "string", + "maxLength": 30 + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "member_count": { + "title": "Member count", + "type": "integer", + "readOnly": true + } + } + }, + "NestedTenantGroup": { + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", "type": "string", + "format": "uri", "readOnly": true }, - "count_vlans": { - "title": "Count vlans", + "name": { + "title": "Name", + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "slug": { + "title": "Slug", "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50, + "minLength": 1 + }, + "tenant_count": { + "title": "Tenant count", + "type": "integer", + "readOnly": true + } + } + }, + "ConfigContext": { + "required": [ + "name", + "data" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", "readOnly": true }, - "count_racks": { - "title": "Count racks", - "type": "string", - "readOnly": true + "name": { + "title": "Name", + "type": "string", + "maxLength": 100, + "minLength": 1 + }, + "weight": { + "title": "Weight", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "is_active": { + "title": "Is active", + "type": "boolean" + }, + "regions": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedRegion" + }, + "uniqueItems": true + }, + "sites": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedSite" + }, + "uniqueItems": true + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedDeviceRole" + }, + "uniqueItems": true + }, + "platforms": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedPlatform" + }, + "uniqueItems": true + }, + "tenant_groups": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedTenantGroup" + }, + "uniqueItems": true }, - "count_devices": { - "title": "Count devices", - "type": "string", - "readOnly": true + "tenants": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedTenant" + }, + "uniqueItems": true }, - "count_circuits": { - "title": "Count circuits", - "type": "string", - "readOnly": true + "data": { + "title": "Data", + "type": "string" } } }, - "WritableSite": { + "WritableConfigContext": { "required": [ "name", - "slug" + "data" ], "type": "object", "properties": { @@ -15775,103 +21794,77 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 - }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 - }, - "status": { - "title": "Status", - "type": "integer", - "enum": [ - 1, - 2, - 4 - ] - }, - "region": { - "title": "Region", - "type": "integer" - }, - "tenant": { - "title": "Tenant", - "type": "integer" - }, - "facility": { - "title": "Facility", - "type": "string", - "maxLength": 50 + "maxLength": 100, + "minLength": 1 }, - "asn": { - "title": "ASN", + "weight": { + "title": "Weight", "type": "integer", - "maximum": 4294967295, - "minimum": 1 - }, - "time_zone": { - "title": "Time zone", - "type": "string" + "maximum": 32767, + "minimum": 0 }, "description": { "title": "Description", "type": "string", "maxLength": 100 }, - "physical_address": { - "title": "Physical address", - "type": "string", - "maxLength": 200 - }, - "shipping_address": { - "title": "Shipping address", - "type": "string", - "maxLength": 200 + "is_active": { + "title": "Is active", + "type": "boolean" }, - "contact_name": { - "title": "Contact name", - "type": "string", - "maxLength": 50 + "regions": { + "type": "array", + "items": { + "type": "integer" + }, + "uniqueItems": true }, - "contact_phone": { - "title": "Contact phone", - "type": "string", - "maxLength": 20 + "sites": { + "type": "array", + "items": { + "type": "integer" + }, + "uniqueItems": true }, - "contact_email": { - "title": "Contact E-mail", - "type": "string", - "format": "email", - "maxLength": 254 + "roles": { + "type": "array", + "items": { + "type": "integer" + }, + "uniqueItems": true }, - "comments": { - "title": "Comments", - "type": "string" + "platforms": { + "type": "array", + "items": { + "type": "integer" + }, + "uniqueItems": true }, - "custom_fields": { - "title": "Custom fields", - "type": "object" + "tenant_groups": { + "type": "array", + "items": { + "type": "integer" + }, + "uniqueItems": true }, - "created": { - "title": "Created", - "type": "string", - "format": "date", - "readOnly": true + "tenants": { + "type": "array", + "items": { + "type": "integer" + }, + "uniqueItems": true }, - "last_updated": { - "title": "Last updated", - "type": "string", - "format": "date-time", - "readOnly": true + "data": { + "title": "Data", + "type": "string" } } }, - "VirtualChassis": { + "ExportTemplate": { "required": [ - "master" + "content_type", + "name", + "template_code" ], "type": "object", "properties": { @@ -15880,39 +21873,59 @@ "type": "integer", "readOnly": true }, - "master": { - "$ref": "#/definitions/NestedDevice" + "content_type": { + "title": "Content type", + "type": "integer" }, - "domain": { - "title": "Domain", + "name": { + "title": "Name", "type": "string", - "maxLength": 30 - } - } - }, - "WritableVirtualChassis": { - "required": [ - "master" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true + "maxLength": 100, + "minLength": 1 }, - "master": { - "title": "Master", - "type": "integer" + "description": { + "title": "Description", + "type": "string", + "maxLength": 200 }, - "domain": { - "title": "Domain", + "template_language": { + "title": "Template language", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + }, + "default": { + "label": "Jinja2", + "value": 20 + } + }, + "template_code": { + "title": "Template code", "type": "string", - "maxLength": 30 + "minLength": 1 + }, + "mime_type": { + "title": "Mime type", + "type": "string", + "maxLength": 50 + }, + "file_extension": { + "title": "File extension", + "type": "string", + "maxLength": 15 } } }, - "ExportTemplate": { + "WritableExportTemplate": { "required": [ "content_type", "name", @@ -15932,21 +21945,31 @@ "name": { "title": "Name", "type": "string", - "maxLength": 100 + "maxLength": 100, + "minLength": 1 }, "description": { "title": "Description", "type": "string", "maxLength": 200 }, + "template_language": { + "title": "Template language", + "type": "integer", + "enum": [ + 10, + 20 + ] + }, "template_code": { "title": "Template code", - "type": "string" + "type": "string", + "minLength": 1 }, "mime_type": { "title": "Mime type", "type": "string", - "maxLength": 15 + "maxLength": 50 }, "file_extension": { "title": "File extension", @@ -15993,12 +22016,14 @@ "name": { "title": "Name", "type": "string", - "maxLength": 100 + "maxLength": 100, + "minLength": 1 }, "source": { "title": "Source URL", "type": "string", - "maxLength": 500 + "maxLength": 500, + "minLength": 1 }, "link": { "title": "Link URL", @@ -16039,12 +22064,14 @@ "name": { "title": "Name", "type": "string", - "maxLength": 100 + "maxLength": 100, + "minLength": 1 }, "source": { "title": "Source URL", "type": "string", - "maxLength": 500 + "maxLength": 500, + "minLength": 1 }, "link": { "title": "Link URL", @@ -16056,7 +22083,8 @@ }, "ImageAttachment": { "required": [ - "image", + "content_type", + "object_id", "image_height", "image_width" ], @@ -16067,9 +22095,22 @@ "type": "integer", "readOnly": true }, + "content_type": { + "title": "Content type", + "type": "string" + }, + "object_id": { + "title": "Object id", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, "parent": { "title": "Parent", - "type": "string", + "type": "object", + "additionalProperties": { + "type": "string" + }, "readOnly": true }, "name": { @@ -16092,58 +22133,18 @@ "image_width": { "title": "Image width", "type": "integer", - "maximum": 32767, - "minimum": 0 - }, - "created": { - "title": "Created", - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "WritableImageAttachment": { - "required": [ - "content_type", - "object_id", - "image" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "content_type": { - "title": "Content type", - "type": "string" - }, - "object_id": { - "title": "Object id", - "type": "integer", - "maximum": 2147483647, + "maximum": 32767, "minimum": 0 }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 50 - }, - "image": { - "title": "Image", + "created": { + "title": "Created", "type": "string", - "readOnly": true, - "format": "uri" + "format": "date-time", + "readOnly": true } } }, - "UserAction": { - "required": [ - "user", - "action" - ], + "ObjectChange": { "type": "object", "properties": { "id": { @@ -16160,6 +22161,18 @@ "user": { "$ref": "#/definitions/NestedUser" }, + "user_name": { + "title": "User name", + "type": "string", + "readOnly": true, + "minLength": 1 + }, + "request_id": { + "title": "Request id", + "type": "string", + "format": "uuid", + "readOnly": true + }, "action": { "title": "Action", "required": [ @@ -16174,11 +22187,71 @@ "value": { "type": "integer" } - } + }, + "readOnly": true + }, + "changed_object_type": { + "title": "Changed object type", + "type": "string", + "readOnly": true + }, + "changed_object": { + "title": "Changed object", + "description": "\n Serialize a nested representation of the changed object.\n ", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, + "object_data": { + "title": "Object data", + "type": "string", + "readOnly": true + } + } + }, + "Tag": { + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100, + "minLength": 1 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 100, + "minLength": 1 + }, + "color": { + "title": "Color", + "type": "string", + "pattern": "^[0-9a-f]{6}$", + "maxLength": 6, + "minLength": 1 }, - "message": { - "title": "Message", + "comments": { + "title": "Comments", "type": "string" + }, + "tagged_items": { + "title": "Tagged items", + "type": "integer", + "readOnly": true } } }, @@ -16199,14 +22272,16 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "site": { "$ref": "#/definitions/NestedSite" @@ -16214,7 +22289,8 @@ "device_patterns": { "title": "Device patterns", "description": "Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined.", - "type": "string" + "type": "string", + "minLength": 1 }, "description": { "title": "Description", @@ -16239,23 +22315,27 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "site": { "title": "Site", - "type": "integer" + "type": "integer", + "x-nullable": true }, "device_patterns": { "title": "Device patterns", "description": "Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined.", - "type": "string" + "type": "string", + "minLength": 1 }, "description": { "title": "Description", @@ -16286,20 +22366,26 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "aggregate_count": { + "title": "Aggregate count", + "type": "integer", + "readOnly": true } } }, "Aggregate": { "required": [ - "family", "prefix", "rir" ], @@ -16316,7 +22402,8 @@ "enum": [ 4, 6 - ] + ], + "readOnly": true }, "prefix": { "title": "Prefix", @@ -16328,13 +22415,21 @@ "date_added": { "title": "Date added", "type": "string", - "format": "date" + "format": "date", + "x-nullable": true }, "description": { "title": "Description", "type": "string", "maxLength": 100 }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -16365,6 +22460,15 @@ "type": "integer", "readOnly": true }, + "family": { + "title": "Family", + "type": "integer", + "enum": [ + 4, + 6 + ], + "readOnly": true + }, "prefix": { "title": "Prefix", "type": "string" @@ -16376,13 +22480,21 @@ "date_added": { "title": "Date added", "type": "string", - "format": "date" + "format": "date", + "x-nullable": true }, "description": { "title": "Description", "type": "string", "maxLength": 100 }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -16404,8 +22516,7 @@ "NestedVRF": { "title": "Vrf", "required": [ - "name", - "rd" + "name" ], "type": "object", "properties": { @@ -16423,12 +22534,19 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "rd": { "title": "Route distinguisher", "type": "string", - "maxLength": 21 + "maxLength": 21, + "x-nullable": true + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true } } }, @@ -16453,15 +22571,14 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 64, + "minLength": 1 } } }, "IPAddressInterface": { "title": "Interface", "required": [ - "device", - "virtual_machine", "name" ], "type": "object", @@ -16485,50 +22602,14 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 - } - } - }, - "NestedIPAddress": { - "title": "Nat inside", - "required": [ - "address" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true - }, - "family": { - "title": "Family", - "type": "integer", - "readOnly": true - }, - "address": { - "title": "Address", - "description": "IPv4 or IPv6 address (with mask)", - "type": "string" + "maxLength": 64, + "minLength": 1 } } }, "IPAddress": { "required": [ - "address", - "vrf", - "tenant", - "status", - "role", - "interface", - "nat_inside", - "nat_outside" + "address" ], "type": "object", "properties": { @@ -16539,7 +22620,19 @@ }, "family": { "title": "Family", - "type": "integer", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + }, "readOnly": true }, "address": { @@ -16588,17 +22681,31 @@ "interface": { "$ref": "#/definitions/IPAddressInterface" }, - "description": { - "title": "Description", - "type": "string", - "maxLength": 100 - }, "nat_inside": { "$ref": "#/definitions/NestedIPAddress" }, "nat_outside": { "$ref": "#/definitions/NestedIPAddress" }, + "dns_name": { + "title": "DNS Name", + "description": "Hostname or FQDN (not case-sensitive)", + "type": "string", + "pattern": "^[0-9A-Za-z.-]+$", + "maxLength": 255 + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -16619,7 +22726,8 @@ }, "WritableIPAddress": { "required": [ - "address" + "address", + "nat_outside" ], "type": "object", "properties": { @@ -16628,6 +22736,11 @@ "type": "integer", "readOnly": true }, + "family": { + "title": "Family", + "type": "integer", + "readOnly": true + }, "address": { "title": "Address", "description": "IPv4 or IPv6 address (with mask)", @@ -16635,11 +22748,13 @@ }, "vrf": { "title": "VRF", - "type": "integer" + "type": "integer", + "x-nullable": true }, "tenant": { "title": "Tenant", - "type": "integer" + "type": "integer", + "x-nullable": true }, "status": { "title": "Status", @@ -16665,21 +22780,42 @@ 42, 43, 44 - ] + ], + "x-nullable": true }, "interface": { "title": "Interface", + "type": "integer", + "x-nullable": true + }, + "nat_inside": { + "title": "NAT (Inside)", + "description": "The IP for which this address is the \"outside\" IP", + "type": "integer", + "x-nullable": true + }, + "nat_outside": { + "title": "Nat outside", "type": "integer" }, + "dns_name": { + "title": "DNS Name", + "description": "Hostname or FQDN (not case-sensitive)", + "type": "string", + "pattern": "^[0-9A-Za-z.-]+$", + "maxLength": 255 + }, "description": { "title": "Description", "type": "string", "maxLength": 100 }, - "nat_inside": { - "title": "NAT (Inside)", - "description": "The IP for which this address is the \"outside\" IP", - "type": "integer" + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } }, "custom_fields": { "title": "Custom fields", @@ -16689,49 +22825,12 @@ "title": "Created", "type": "string", "format": "date", - "readOnly": true - }, - "last_updated": { - "title": "Last updated", - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "NestedVLAN": { - "title": "Vlan", - "required": [ - "vid", - "name" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true - }, - "vid": { - "title": "ID", - "type": "integer", - "maximum": 4094, - "minimum": 1 - }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 64 + "readOnly": true }, - "display_name": { - "title": "Display name", + "last_updated": { + "title": "Last updated", "type": "string", + "format": "date-time", "readOnly": true } } @@ -16758,26 +22857,32 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true } } }, "Prefix": { "required": [ - "prefix", - "site", - "vrf", - "tenant", - "vlan", - "status", - "role" + "prefix" ], "type": "object", "properties": { @@ -16788,7 +22893,19 @@ }, "family": { "title": "Family", - "type": "integer", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + }, "readOnly": true }, "prefix": { @@ -16837,6 +22954,13 @@ "type": "string", "maxLength": 100 }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -16866,6 +22990,11 @@ "type": "integer", "readOnly": true }, + "family": { + "title": "Family", + "type": "integer", + "readOnly": true + }, "prefix": { "title": "Prefix", "description": "IPv4 or IPv6 network with mask", @@ -16873,19 +23002,23 @@ }, "site": { "title": "Site", - "type": "integer" + "type": "integer", + "x-nullable": true }, "vrf": { "title": "VRF", - "type": "integer" + "type": "integer", + "x-nullable": true }, "tenant": { "title": "Tenant", - "type": "integer" + "type": "integer", + "x-nullable": true }, "vlan": { "title": "VLAN", - "type": "integer" + "type": "integer", + "x-nullable": true }, "status": { "title": "Status", @@ -16901,7 +23034,8 @@ "role": { "title": "Role", "description": "The primary function of this prefix", - "type": "integer" + "type": "integer", + "x-nullable": true }, "is_pool": { "title": "Is a pool", @@ -16913,6 +23047,13 @@ "type": "string", "maxLength": 100 }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -16946,19 +23087,26 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "is_private": { "title": "Private", "description": "IP space managed by this RIR is considered private", "type": "boolean" + }, + "aggregate_count": { + "title": "Aggregate count", + "type": "integer", + "readOnly": true } } }, @@ -16977,31 +23125,40 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "weight": { "title": "Weight", "type": "integer", "maximum": 32767, "minimum": 0 + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true } } }, "Service": { "required": [ - "device", - "virtual_machine", "name", "port", - "protocol", - "ipaddresses" + "protocol" ], "type": "object", "properties": { @@ -17019,7 +23176,8 @@ "name": { "title": "Name", "type": "string", - "maxLength": 30 + "maxLength": 30, + "minLength": 1 }, "port": { "title": "Port number", @@ -17047,13 +23205,18 @@ "type": "array", "items": { "$ref": "#/definitions/NestedIPAddress" - } + }, + "uniqueItems": true }, "description": { "title": "Description", "type": "string", "maxLength": 100 }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, "created": { "title": "Created", "type": "string", @@ -17083,16 +23246,19 @@ }, "device": { "title": "Device", - "type": "integer" + "type": "integer", + "x-nullable": true }, "virtual_machine": { "title": "Virtual machine", - "type": "integer" + "type": "integer", + "x-nullable": true }, "name": { "title": "Name", "type": "string", - "maxLength": 30 + "maxLength": 30, + "minLength": 1 }, "port": { "title": "Port number", @@ -17121,6 +23287,10 @@ "type": "string", "maxLength": 100 }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, "created": { "title": "Created", "type": "string", @@ -17138,8 +23308,7 @@ "VLANGroup": { "required": [ "name", - "slug", - "site" + "slug" ], "type": "object", "properties": { @@ -17151,17 +23320,24 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "site": { "$ref": "#/definitions/NestedSite" + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true } } }, @@ -17180,18 +23356,26 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "site": { "title": "Site", - "type": "integer" + "type": "integer", + "x-nullable": true + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true } } }, @@ -17217,26 +23401,28 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true } } }, "VLAN": { "required": [ - "site", - "group", "vid", - "name", - "tenant", - "status", - "role" + "name" ], "type": "object", "properties": { @@ -17260,7 +23446,8 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 64, + "minLength": 1 }, "tenant": { "$ref": "#/definitions/NestedTenant" @@ -17289,6 +23476,13 @@ "type": "string", "maxLength": 100 }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "display_name": { "title": "Display name", "type": "string", @@ -17309,6 +23503,11 @@ "type": "string", "format": "date-time", "readOnly": true + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true } } }, @@ -17326,11 +23525,13 @@ }, "site": { "title": "Site", - "type": "integer" + "type": "integer", + "x-nullable": true }, "group": { "title": "Group", - "type": "integer" + "type": "integer", + "x-nullable": true }, "vid": { "title": "ID", @@ -17341,11 +23542,13 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 64, + "minLength": 1 }, "tenant": { "title": "Tenant", - "type": "integer" + "type": "integer", + "x-nullable": true }, "status": { "title": "Status", @@ -17358,13 +23561,26 @@ }, "role": { "title": "Role", - "type": "integer" + "type": "integer", + "x-nullable": true }, "description": { "title": "Description", "type": "string", "maxLength": 100 }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -17380,14 +23596,17 @@ "type": "string", "format": "date-time", "readOnly": true + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true } } }, "VRF": { "required": [ - "name", - "rd", - "tenant" + "name" ], "type": "object", "properties": { @@ -17399,12 +23618,14 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "rd": { "title": "Route distinguisher", "type": "string", - "maxLength": 21 + "maxLength": 21, + "x-nullable": true }, "tenant": { "$ref": "#/definitions/NestedTenant" @@ -17419,6 +23640,13 @@ "type": "string", "maxLength": 100 }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "display_name": { "title": "Display name", "type": "string", @@ -17439,13 +23667,22 @@ "type": "string", "format": "date-time", "readOnly": true + }, + "ipaddress_count": { + "title": "Ipaddress count", + "type": "integer", + "readOnly": true + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true } } }, "WritableVRF": { "required": [ - "name", - "rd" + "name" ], "type": "object", "properties": { @@ -17457,16 +23694,19 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "rd": { "title": "Route distinguisher", "type": "string", - "maxLength": 21 + "maxLength": 21, + "x-nullable": true }, "tenant": { "title": "Tenant", - "type": "integer" + "type": "integer", + "x-nullable": true }, "enforce_unique": { "title": "Enforce unique space", @@ -17478,6 +23718,18 @@ "type": "string", "maxLength": 100 }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -17493,6 +23745,16 @@ "type": "string", "format": "date-time", "readOnly": true + }, + "ipaddress_count": { + "title": "Ipaddress count", + "type": "integer", + "readOnly": true + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true } } }, @@ -17511,14 +23773,21 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "secret_count": { + "title": "Secret count", + "type": "integer", + "readOnly": true } } }, @@ -17544,14 +23813,21 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "secret_count": { + "title": "Secret count", + "type": "integer", + "readOnly": true } } }, @@ -17559,7 +23835,7 @@ "required": [ "device", "role", - "name" + "plaintext" ], "type": "object", "properties": { @@ -17582,12 +23858,24 @@ "plaintext": { "title": "Plaintext", "type": "string", - "readOnly": true + "minLength": 1 }, "hash": { "title": "Hash", "type": "string", - "readOnly": true + "readOnly": true, + "minLength": 1 + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" }, "created": { "title": "Created", @@ -17631,12 +23919,25 @@ }, "plaintext": { "title": "Plaintext", - "type": "string" + "type": "string", + "minLength": 1 }, "hash": { "title": "Hash", "type": "string", - "readOnly": true + "readOnly": true, + "minLength": 1 + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" }, "created": { "title": "Created", @@ -17659,63 +23960,36 @@ ], "type": "object", "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "name": { - "title": "Name", - "type": "string", - "maxLength": 50 - }, - "slug": { - "title": "Slug", - "type": "string", - "format": "slug", - "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 - } - } - }, - "NestedTenantGroup": { - "title": "Group", - "required": [ - "name", - "slug" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", + "id": { + "title": "ID", + "type": "integer", "readOnly": true }, "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "tenant_count": { + "title": "Tenant count", + "type": "integer", + "readOnly": true } } }, "Tenant": { "required": [ "name", - "slug", - "group" + "slug" ], "type": "object", "properties": { @@ -17727,14 +24001,16 @@ "name": { "title": "Name", "type": "string", - "maxLength": 30 + "maxLength": 30, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "group": { "$ref": "#/definitions/NestedTenantGroup" @@ -17749,6 +24025,13 @@ "title": "Comments", "type": "string" }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -17764,6 +24047,51 @@ "type": "string", "format": "date-time", "readOnly": true + }, + "circuit_count": { + "title": "Circuit count", + "type": "integer", + "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "ipaddress_count": { + "title": "Ipaddress count", + "type": "integer", + "readOnly": true + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true + }, + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true + }, + "site_count": { + "title": "Site count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true + }, + "vrf_count": { + "title": "Vrf count", + "type": "integer", + "readOnly": true } } }, @@ -17782,18 +24110,21 @@ "name": { "title": "Name", "type": "string", - "maxLength": 30 + "maxLength": 30, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "group": { "title": "Group", - "type": "integer" + "type": "integer", + "x-nullable": true }, "description": { "title": "Description", @@ -17805,6 +24136,13 @@ "title": "Comments", "type": "string" }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" @@ -17820,6 +24158,51 @@ "type": "string", "format": "date-time", "readOnly": true + }, + "circuit_count": { + "title": "Circuit count", + "type": "integer", + "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "ipaddress_count": { + "title": "Ipaddress count", + "type": "integer", + "readOnly": true + }, + "prefix_count": { + "title": "Prefix count", + "type": "integer", + "readOnly": true + }, + "rack_count": { + "title": "Rack count", + "type": "integer", + "readOnly": true + }, + "site_count": { + "title": "Site count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + }, + "vlan_count": { + "title": "Vlan count", + "type": "integer", + "readOnly": true + }, + "vrf_count": { + "title": "Vrf count", + "type": "integer", + "readOnly": true } } }, @@ -17838,14 +24221,21 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "cluster_count": { + "title": "Cluster count", + "type": "integer", + "readOnly": true } } }, @@ -17864,14 +24254,21 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "cluster_count": { + "title": "Cluster count", + "type": "integer", + "readOnly": true } } }, @@ -17897,14 +24294,21 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "cluster_count": { + "title": "Cluster count", + "type": "integer", + "readOnly": true } } }, @@ -17930,23 +24334,165 @@ "name": { "title": "Name", "type": "string", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 }, "slug": { "title": "Slug", "type": "string", "format": "slug", "pattern": "^[-a-zA-Z0-9_]+$", - "maxLength": 50 + "maxLength": 50, + "minLength": 1 + }, + "cluster_count": { + "title": "Cluster count", + "type": "integer", + "readOnly": true } } }, "Cluster": { "required": [ "name", - "type", - "group", - "site" + "type" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100, + "minLength": 1 + }, + "type": { + "$ref": "#/definitions/NestedClusterType" + }, + "group": { + "$ref": "#/definitions/NestedClusterGroup" + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + } + } + }, + "WritableCluster": { + "required": [ + "name", + "type" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100, + "minLength": 1 + }, + "type": { + "title": "Type", + "type": "integer" + }, + "group": { + "title": "Group", + "type": "integer", + "x-nullable": true + }, + "site": { + "title": "Site", + "type": "integer", + "x-nullable": true + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "device_count": { + "title": "Device count", + "type": "integer", + "readOnly": true + }, + "virtualmachine_count": { + "title": "Virtualmachine count", + "type": "integer", + "readOnly": true + } + } + }, + "VirtualMachineInterface": { + "required": [ + "virtual_machine", + "name" ], "type": "object", "properties": { @@ -17955,46 +24501,94 @@ "type": "integer", "readOnly": true }, + "virtual_machine": { + "$ref": "#/definitions/NestedVirtualMachine" + }, "name": { "title": "Name", "type": "string", + "maxLength": 64, + "minLength": 1 + }, + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + }, + "default": { + "label": "Virtual", + "value": 0 + } + }, + "enabled": { + "title": "Enabled", + "type": "boolean" + }, + "mtu": { + "title": "MTU", + "type": "integer", + "maximum": 65536, + "minimum": 1, + "x-nullable": true + }, + "mac_address": { + "title": "MAC Address", + "type": "string", + "x-nullable": true + }, + "description": { + "title": "Description", + "type": "string", "maxLength": 100 }, - "type": { - "$ref": "#/definitions/NestedClusterType" - }, - "group": { - "$ref": "#/definitions/NestedClusterGroup" - }, - "site": { - "$ref": "#/definitions/NestedSite" - }, - "comments": { - "title": "Comments", - "type": "string" + "mode": { + "title": "Mode", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } }, - "custom_fields": { - "title": "Custom fields", - "type": "object" + "untagged_vlan": { + "$ref": "#/definitions/NestedVLAN" }, - "created": { - "title": "Created", - "type": "string", - "format": "date", - "readOnly": true + "tagged_vlans": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedVLAN" + }, + "uniqueItems": true }, - "last_updated": { - "title": "Last updated", - "type": "string", - "format": "date-time", - "readOnly": true + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "WritableCluster": { + "WritableVirtualMachineInterface": { "required": [ - "name", - "type" + "name" ], "type": "object", "properties": { @@ -18003,86 +24597,141 @@ "type": "integer", "readOnly": true }, + "virtual_machine": { + "title": "Virtual machine", + "type": "integer", + "x-nullable": true + }, "name": { "title": "Name", "type": "string", - "maxLength": 100 + "maxLength": 64, + "minLength": 1 }, "type": { "title": "Type", - "type": "integer" - }, - "group": { - "title": "Group", - "type": "integer" - }, - "site": { - "title": "Site", - "type": "integer" + "type": "integer", + "enum": [ + 0, + 200, + 800, + 1000, + 1120, + 1130, + 1150, + 1170, + 1050, + 1100, + 1200, + 1300, + 1310, + 1320, + 1350, + 1400, + 1420, + 1500, + 1510, + 1650, + 1520, + 1550, + 1600, + 1700, + 1750, + 2600, + 2610, + 2620, + 2630, + 2640, + 2810, + 2820, + 2830, + 6100, + 6200, + 6300, + 6400, + 6500, + 6600, + 6700, + 3010, + 3020, + 3040, + 3080, + 3160, + 3320, + 3400, + 4000, + 4010, + 4040, + 4050, + 5000, + 5050, + 5100, + 5150, + 5200, + 5300, + 5310, + 5320, + 5330, + 32767 + ] }, - "comments": { - "title": "Comments", - "type": "string" + "enabled": { + "title": "Enabled", + "type": "boolean" }, - "custom_fields": { - "title": "Custom fields", - "type": "object" + "mtu": { + "title": "MTU", + "type": "integer", + "maximum": 65536, + "minimum": 1, + "x-nullable": true }, - "created": { - "title": "Created", + "mac_address": { + "title": "MAC Address", "type": "string", - "format": "date", - "readOnly": true + "x-nullable": true }, - "last_updated": { - "title": "Last updated", + "description": { + "title": "Description", "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "VirtualMachineIPAddress": { - "title": "Primary ip", - "required": [ - "address" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true + "maxLength": 100 }, - "url": { - "title": "Url", - "type": "string", - "format": "uri", - "readOnly": true + "mode": { + "title": "Mode", + "type": "integer", + "enum": [ + 100, + 200, + 300 + ], + "x-nullable": true }, - "family": { - "title": "Family", + "untagged_vlan": { + "title": "Untagged VLAN", "type": "integer", - "readOnly": true + "x-nullable": true }, - "address": { - "title": "Address", - "description": "IPv4 or IPv6 address (with mask)", - "type": "string" + "tagged_vlans": { + "type": "array", + "items": { + "title": "Tagged VLANs", + "type": "integer" + }, + "uniqueItems": true + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } } }, - "VirtualMachine": { + "VirtualMachineWithConfigContext": { "required": [ "name", - "status", - "cluster", - "role", - "tenant", - "platform", - "primary_ip", - "primary_ip4", - "primary_ip6" + "cluster" ], "type": "object", "properties": { @@ -18094,7 +24743,8 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 64, + "minLength": 1 }, "status": { "title": "Status", @@ -18112,6 +24762,9 @@ } } }, + "site": { + "$ref": "#/definitions/NestedSite" + }, "cluster": { "$ref": "#/definitions/NestedCluster" }, @@ -18125,40 +24778,63 @@ "$ref": "#/definitions/NestedPlatform" }, "primary_ip": { - "$ref": "#/definitions/VirtualMachineIPAddress" + "$ref": "#/definitions/NestedIPAddress" }, "primary_ip4": { - "$ref": "#/definitions/VirtualMachineIPAddress" + "$ref": "#/definitions/NestedIPAddress" }, "primary_ip6": { - "$ref": "#/definitions/VirtualMachineIPAddress" + "$ref": "#/definitions/NestedIPAddress" }, "vcpus": { "title": "VCPUs", "type": "integer", "maximum": 32767, - "minimum": 0 + "minimum": 0, + "x-nullable": true }, "memory": { "title": "Memory (MB)", "type": "integer", "maximum": 2147483647, - "minimum": 0 + "minimum": 0, + "x-nullable": true }, "disk": { "title": "Disk (GB)", "type": "integer", "maximum": 2147483647, - "minimum": 0 + "minimum": 0, + "x-nullable": true }, "comments": { "title": "Comments", "type": "string" }, + "local_context_data": { + "title": "Local context data", + "type": "string", + "x-nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" }, + "config_context": { + "title": "Config context", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, "created": { "title": "Created", "type": "string", @@ -18173,7 +24849,7 @@ } } }, - "WritableVirtualMachine": { + "WritableVirtualMachineWithConfigContext": { "required": [ "name", "cluster" @@ -18188,7 +24864,8 @@ "name": { "title": "Name", "type": "string", - "maxLength": 64 + "maxLength": 64, + "minLength": 1 }, "status": { "title": "Status", @@ -18199,56 +24876,94 @@ 3 ] }, + "site": { + "title": "Site", + "type": "string", + "readOnly": true + }, "cluster": { "title": "Cluster", "type": "integer" }, "role": { "title": "Role", - "type": "integer" + "type": "integer", + "x-nullable": true }, "tenant": { "title": "Tenant", - "type": "integer" + "type": "integer", + "x-nullable": true }, "platform": { "title": "Platform", - "type": "integer" + "type": "integer", + "x-nullable": true + }, + "primary_ip": { + "title": "Primary ip", + "type": "string", + "readOnly": true }, "primary_ip4": { "title": "Primary IPv4", - "type": "integer" + "type": "integer", + "x-nullable": true }, "primary_ip6": { "title": "Primary IPv6", - "type": "integer" + "type": "integer", + "x-nullable": true }, "vcpus": { "title": "VCPUs", "type": "integer", "maximum": 32767, - "minimum": 0 + "minimum": 0, + "x-nullable": true }, "memory": { "title": "Memory (MB)", "type": "integer", "maximum": 2147483647, - "minimum": 0 + "minimum": 0, + "x-nullable": true }, "disk": { "title": "Disk (GB)", "type": "integer", "maximum": 2147483647, - "minimum": 0 + "minimum": 0, + "x-nullable": true }, "comments": { "title": "Comments", "type": "string" }, + "local_context_data": { + "title": "Local context data", + "type": "string", + "x-nullable": true + }, + "tags": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } + }, "custom_fields": { "title": "Custom fields", "type": "object" }, + "config_context": { + "title": "Config context", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "readOnly": true + }, "created": { "title": "Created", "type": "string",