diff --git a/netbox/client/circuits/circuits_circuits_list_parameters.go b/netbox/client/circuits/circuits_circuits_list_parameters.go index 953df19c3285428de9842d7ddc7c433d78dc2420..5e35ed840f1742ebd0bf95374d422b53affe09a2 100644 --- a/netbox/client/circuits/circuits_circuits_list_parameters.go +++ b/netbox/client/circuits/circuits_circuits_list_parameters.go @@ -94,6 +94,8 @@ type CircuitsCircuitsListParams struct { Site *string /*SiteID*/ SiteID *string + /*Status*/ + Status *string /*Tenant*/ Tenant *string /*TenantID*/ @@ -262,6 +264,17 @@ func (o *CircuitsCircuitsListParams) SetSiteID(siteID *string) { o.SiteID = siteID } +// WithStatus adds the status to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithStatus(status *string) *CircuitsCircuitsListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetStatus(status *string) { + o.Status = status +} + // WithTenant adds the tenant to the circuits circuits list params func (o *CircuitsCircuitsListParams) WithTenant(tenant *string) *CircuitsCircuitsListParams { o.SetTenant(tenant) @@ -490,6 +503,22 @@ func (o *CircuitsCircuitsListParams) WriteToRequest(r runtime.ClientRequest, reg } + 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.Tenant != nil { // query param tenant diff --git a/netbox/client/dcim/dcim_client.go b/netbox/client/dcim/dcim_client.go index 2091c9c833b73310976179b0eeced2a8531f1629..1691a60023405a4a9a5922c41d470a9a7bd42fac 100644 --- a/netbox/client/dcim/dcim_client.go +++ b/netbox/client/dcim/dcim_client.go @@ -4640,6 +4640,180 @@ func (a *Client) DcimSitesUpdate(params *DcimSitesUpdateParams, authInfo runtime } +/* +DcimVirtualChassisCreate dcim virtual chassis create API +*/ +func (a *Client) DcimVirtualChassisCreate(params *DcimVirtualChassisCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_create", + Method: "POST", + PathPattern: "/dcim/virtual-chassis/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisCreateCreated), nil + +} + +/* +DcimVirtualChassisDelete dcim virtual chassis delete API +*/ +func (a *Client) DcimVirtualChassisDelete(params *DcimVirtualChassisDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_delete", + Method: "DELETE", + PathPattern: "/dcim/virtual-chassis/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisDeleteNoContent), nil + +} + +/* +DcimVirtualChassisList dcim virtual chassis list API +*/ +func (a *Client) DcimVirtualChassisList(params *DcimVirtualChassisListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_list", + Method: "GET", + PathPattern: "/dcim/virtual-chassis/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisListOK), nil + +} + +/* +DcimVirtualChassisPartialUpdate dcim virtual chassis partial update API +*/ +func (a *Client) DcimVirtualChassisPartialUpdate(params *DcimVirtualChassisPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_partial_update", + Method: "PATCH", + PathPattern: "/dcim/virtual-chassis/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisPartialUpdateOK), nil + +} + +/* +DcimVirtualChassisRead dcim virtual chassis read API +*/ +func (a *Client) DcimVirtualChassisRead(params *DcimVirtualChassisReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_read", + Method: "GET", + PathPattern: "/dcim/virtual-chassis/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisReadOK), nil + +} + +/* +DcimVirtualChassisUpdate dcim virtual chassis update API +*/ +func (a *Client) DcimVirtualChassisUpdate(params *DcimVirtualChassisUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimVirtualChassisUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimVirtualChassisUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_virtual-chassis_update", + Method: "PUT", + PathPattern: "/dcim/virtual-chassis/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimVirtualChassisUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimVirtualChassisUpdateOK), nil + +} + // SetTransport changes the transport on the client func (a *Client) SetTransport(transport runtime.ClientTransport) { a.transport = transport diff --git a/netbox/client/dcim/dcim_devices_list_parameters.go b/netbox/client/dcim/dcim_devices_list_parameters.go index 6008c89aebbb2e338d3630015229c8f592979693..f6f18a90f6465e1147befc5f778fb7f617f42b83 100644 --- a/netbox/client/dcim/dcim_devices_list_parameters.go +++ b/netbox/client/dcim/dcim_devices_list_parameters.go @@ -132,6 +132,8 @@ type DcimDevicesListParams struct { Tenant *string /*TenantID*/ TenantID *string + /*VirtualChassisID*/ + VirtualChassisID *string timeout time.Duration Context context.Context @@ -501,6 +503,17 @@ func (o *DcimDevicesListParams) SetTenantID(tenantID *string) { o.TenantID = tenantID } +// WithVirtualChassisID adds the virtualChassisID to the dcim devices list params +func (o *DcimDevicesListParams) WithVirtualChassisID(virtualChassisID *string) *DcimDevicesListParams { + o.SetVirtualChassisID(virtualChassisID) + return o +} + +// SetVirtualChassisID adds the virtualChassisId to the dcim devices list params +func (o *DcimDevicesListParams) SetVirtualChassisID(virtualChassisID *string) { + o.VirtualChassisID = virtualChassisID +} + // WriteToRequest writes these params to a swagger request func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { @@ -989,6 +1002,22 @@ func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strf } + if o.VirtualChassisID != nil { + + // query param virtual_chassis_id + var qrVirtualChassisID string + if o.VirtualChassisID != nil { + qrVirtualChassisID = *o.VirtualChassisID + } + qVirtualChassisID := qrVirtualChassisID + if qVirtualChassisID != "" { + if err := r.SetQueryParam("virtual_chassis_id", qVirtualChassisID); err != nil { + return err + } + } + + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } diff --git a/netbox/client/dcim/dcim_platforms_create_parameters.go b/netbox/client/dcim/dcim_platforms_create_parameters.go index 91908aaff2108f65838304133a5853ac1902d5e1..8b6a01dee26ca9c66553a1d96a5c17cbc14efa03 100644 --- a/netbox/client/dcim/dcim_platforms_create_parameters.go +++ b/netbox/client/dcim/dcim_platforms_create_parameters.go @@ -65,7 +65,7 @@ for the dcim platforms create operation typically these are written to a http.Re type DcimPlatformsCreateParams struct { /*Data*/ - Data *models.Platform + Data *models.WritablePlatform timeout time.Duration Context context.Context @@ -106,13 +106,13 @@ func (o *DcimPlatformsCreateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim platforms create params -func (o *DcimPlatformsCreateParams) WithData(data *models.Platform) *DcimPlatformsCreateParams { +func (o *DcimPlatformsCreateParams) WithData(data *models.WritablePlatform) *DcimPlatformsCreateParams { o.SetData(data) return o } // SetData adds the data to the dcim platforms create params -func (o *DcimPlatformsCreateParams) SetData(data *models.Platform) { +func (o *DcimPlatformsCreateParams) SetData(data *models.WritablePlatform) { o.Data = data } diff --git a/netbox/client/dcim/dcim_platforms_create_responses.go b/netbox/client/dcim/dcim_platforms_create_responses.go index 6e6fb078e20a1eb67b716f818c280e391940ccaa..1c4c16c4daa7fd27fe4d809c8e69262e1fc1560b 100644 --- a/netbox/client/dcim/dcim_platforms_create_responses.go +++ b/netbox/client/dcim/dcim_platforms_create_responses.go @@ -47,7 +47,7 @@ func NewDcimPlatformsCreateCreated() *DcimPlatformsCreateCreated { DcimPlatformsCreateCreated dcim platforms create created */ type DcimPlatformsCreateCreated struct { - Payload *models.Platform + Payload *models.WritablePlatform } func (o *DcimPlatformsCreateCreated) Error() string { @@ -56,7 +56,7 @@ func (o *DcimPlatformsCreateCreated) Error() string { func (o *DcimPlatformsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Platform) + o.Payload = new(models.WritablePlatform) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_platforms_list_parameters.go b/netbox/client/dcim/dcim_platforms_list_parameters.go index c143538a5ce4ff12889e00974437ee6e6411a916..1df117d6296394738622cd72af25d92a63367110 100644 --- a/netbox/client/dcim/dcim_platforms_list_parameters.go +++ b/netbox/client/dcim/dcim_platforms_list_parameters.go @@ -68,6 +68,10 @@ type DcimPlatformsListParams struct { */ Limit *int64 + /*Manufacturer*/ + Manufacturer *string + /*ManufacturerID*/ + ManufacturerID *string /*Name*/ Name *string /*Offset @@ -127,6 +131,28 @@ func (o *DcimPlatformsListParams) SetLimit(limit *int64) { o.Limit = limit } +// WithManufacturer adds the manufacturer to the dcim platforms list params +func (o *DcimPlatformsListParams) WithManufacturer(manufacturer *string) *DcimPlatformsListParams { + o.SetManufacturer(manufacturer) + return o +} + +// SetManufacturer adds the manufacturer to the dcim platforms list params +func (o *DcimPlatformsListParams) SetManufacturer(manufacturer *string) { + o.Manufacturer = manufacturer +} + +// WithManufacturerID adds the manufacturerID to the dcim platforms list params +func (o *DcimPlatformsListParams) WithManufacturerID(manufacturerID *string) *DcimPlatformsListParams { + o.SetManufacturerID(manufacturerID) + return o +} + +// SetManufacturerID adds the manufacturerId to the dcim platforms list params +func (o *DcimPlatformsListParams) SetManufacturerID(manufacturerID *string) { + o.ManufacturerID = manufacturerID +} + // WithName adds the name to the dcim platforms list params func (o *DcimPlatformsListParams) WithName(name *string) *DcimPlatformsListParams { o.SetName(name) @@ -184,6 +210,38 @@ func (o *DcimPlatformsListParams) WriteToRequest(r runtime.ClientRequest, reg st } + if o.Manufacturer != nil { + + // query param manufacturer + var qrManufacturer string + if o.Manufacturer != nil { + qrManufacturer = *o.Manufacturer + } + qManufacturer := qrManufacturer + if qManufacturer != "" { + if err := r.SetQueryParam("manufacturer", qManufacturer); err != nil { + return err + } + } + + } + + if o.ManufacturerID != nil { + + // query param manufacturer_id + var qrManufacturerID string + if o.ManufacturerID != nil { + qrManufacturerID = *o.ManufacturerID + } + qManufacturerID := qrManufacturerID + if qManufacturerID != "" { + if err := r.SetQueryParam("manufacturer_id", qManufacturerID); err != nil { + return err + } + } + + } + if o.Name != nil { // query param name diff --git a/netbox/client/dcim/dcim_platforms_partial_update_parameters.go b/netbox/client/dcim/dcim_platforms_partial_update_parameters.go index 776f639d894d1dec5f5b8d4f27ab115b1bdf7e60..1b6363123e4cc15671781532265ad8f8498205db 100644 --- a/netbox/client/dcim/dcim_platforms_partial_update_parameters.go +++ b/netbox/client/dcim/dcim_platforms_partial_update_parameters.go @@ -66,7 +66,7 @@ for the dcim platforms partial update operation typically these are written to a type DcimPlatformsPartialUpdateParams struct { /*Data*/ - Data *models.Platform + Data *models.WritablePlatform /*ID A unique integer value identifying this platform. @@ -112,13 +112,13 @@ func (o *DcimPlatformsPartialUpdateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim platforms partial update params -func (o *DcimPlatformsPartialUpdateParams) WithData(data *models.Platform) *DcimPlatformsPartialUpdateParams { +func (o *DcimPlatformsPartialUpdateParams) WithData(data *models.WritablePlatform) *DcimPlatformsPartialUpdateParams { o.SetData(data) return o } // SetData adds the data to the dcim platforms partial update params -func (o *DcimPlatformsPartialUpdateParams) SetData(data *models.Platform) { +func (o *DcimPlatformsPartialUpdateParams) SetData(data *models.WritablePlatform) { o.Data = data } diff --git a/netbox/client/dcim/dcim_platforms_partial_update_responses.go b/netbox/client/dcim/dcim_platforms_partial_update_responses.go index c2047f9cdceca8b7db3c4a202950206f8c97e84a..3dbcced75602f617b9bee846e8d01920159a2acd 100644 --- a/netbox/client/dcim/dcim_platforms_partial_update_responses.go +++ b/netbox/client/dcim/dcim_platforms_partial_update_responses.go @@ -47,7 +47,7 @@ func NewDcimPlatformsPartialUpdateOK() *DcimPlatformsPartialUpdateOK { DcimPlatformsPartialUpdateOK dcim platforms partial update o k */ type DcimPlatformsPartialUpdateOK struct { - Payload *models.Platform + Payload *models.WritablePlatform } func (o *DcimPlatformsPartialUpdateOK) Error() string { @@ -56,7 +56,7 @@ func (o *DcimPlatformsPartialUpdateOK) Error() string { func (o *DcimPlatformsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Platform) + o.Payload = new(models.WritablePlatform) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_platforms_update_parameters.go b/netbox/client/dcim/dcim_platforms_update_parameters.go index 5a9ba845902adf4962b4723966679bdca2d0cadb..3c407062a86d9ae0e0ca7aa92cf0f4dc722cebd3 100644 --- a/netbox/client/dcim/dcim_platforms_update_parameters.go +++ b/netbox/client/dcim/dcim_platforms_update_parameters.go @@ -66,7 +66,7 @@ for the dcim platforms update operation typically these are written to a http.Re type DcimPlatformsUpdateParams struct { /*Data*/ - Data *models.Platform + Data *models.WritablePlatform /*ID A unique integer value identifying this platform. @@ -112,13 +112,13 @@ func (o *DcimPlatformsUpdateParams) SetHTTPClient(client *http.Client) { } // WithData adds the data to the dcim platforms update params -func (o *DcimPlatformsUpdateParams) WithData(data *models.Platform) *DcimPlatformsUpdateParams { +func (o *DcimPlatformsUpdateParams) WithData(data *models.WritablePlatform) *DcimPlatformsUpdateParams { o.SetData(data) return o } // SetData adds the data to the dcim platforms update params -func (o *DcimPlatformsUpdateParams) SetData(data *models.Platform) { +func (o *DcimPlatformsUpdateParams) SetData(data *models.WritablePlatform) { o.Data = data } diff --git a/netbox/client/dcim/dcim_platforms_update_responses.go b/netbox/client/dcim/dcim_platforms_update_responses.go index 2533298987cba40cca25cd4ee7e491f177f0f522..30c88ec95438ff915c1aea91bd84c7e1c5f76426 100644 --- a/netbox/client/dcim/dcim_platforms_update_responses.go +++ b/netbox/client/dcim/dcim_platforms_update_responses.go @@ -47,7 +47,7 @@ func NewDcimPlatformsUpdateOK() *DcimPlatformsUpdateOK { DcimPlatformsUpdateOK dcim platforms update o k */ type DcimPlatformsUpdateOK struct { - Payload *models.Platform + Payload *models.WritablePlatform } func (o *DcimPlatformsUpdateOK) Error() string { @@ -56,7 +56,7 @@ func (o *DcimPlatformsUpdateOK) Error() string { func (o *DcimPlatformsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - o.Payload = new(models.Platform) + o.Payload = new(models.WritablePlatform) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { diff --git a/netbox/client/dcim/dcim_rack_reservations_list_parameters.go b/netbox/client/dcim/dcim_rack_reservations_list_parameters.go index 9aaa112cd81993f271744c340f7613a1523c0306..bf33da3b8f50876b89807071a15c4fb52bdd4f7c 100644 --- a/netbox/client/dcim/dcim_rack_reservations_list_parameters.go +++ b/netbox/client/dcim/dcim_rack_reservations_list_parameters.go @@ -92,6 +92,10 @@ type DcimRackReservationsListParams struct { Site *string /*SiteID*/ SiteID *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string /*User*/ User *string /*UserID*/ @@ -245,6 +249,28 @@ func (o *DcimRackReservationsListParams) SetSiteID(siteID *string) { o.SiteID = siteID } +// WithTenant adds the tenant to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithTenant(tenant *string) *DcimRackReservationsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithTenantID(tenantID *string) *DcimRackReservationsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + // WithUser adds the user to the dcim rack reservations list params func (o *DcimRackReservationsListParams) WithUser(user *string) *DcimRackReservationsListParams { o.SetUser(user) @@ -435,6 +461,38 @@ func (o *DcimRackReservationsListParams) WriteToRequest(r runtime.ClientRequest, } + 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.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 o.User != nil { // query param user diff --git a/netbox/client/dcim/dcim_sites_list_parameters.go b/netbox/client/dcim/dcim_sites_list_parameters.go index 97212e51a175482643dcc23d7b75bc61546cf61c..4a576234c3fcacf10fca38bf43e5570cf6da3e45 100644 --- a/netbox/client/dcim/dcim_sites_list_parameters.go +++ b/netbox/client/dcim/dcim_sites_list_parameters.go @@ -98,6 +98,8 @@ type DcimSitesListParams struct { RegionID *string /*Slug*/ Slug *string + /*Status*/ + Status *string /*Tenant*/ Tenant *string /*TenantID*/ @@ -284,6 +286,17 @@ func (o *DcimSitesListParams) SetSlug(slug *string) { o.Slug = slug } +// WithStatus adds the status to the dcim sites list params +func (o *DcimSitesListParams) WithStatus(status *string) *DcimSitesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the dcim sites list params +func (o *DcimSitesListParams) SetStatus(status *string) { + o.Status = status +} + // WithTenant adds the tenant to the dcim sites list params func (o *DcimSitesListParams) WithTenant(tenant *string) *DcimSitesListParams { o.SetTenant(tenant) @@ -522,6 +535,22 @@ func (o *DcimSitesListParams) 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.Tenant != nil { // query param tenant diff --git a/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..15198c49c5f96a724854b4fba7a67098e2badca6 --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// NewDcimVirtualChassisCreateParams creates a new DcimVirtualChassisCreateParams object +// with the default values initialized. +func NewDcimVirtualChassisCreateParams() *DcimVirtualChassisCreateParams { + var () + return &DcimVirtualChassisCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisCreateParamsWithTimeout creates a new DcimVirtualChassisCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisCreateParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisCreateParams { + var () + return &DcimVirtualChassisCreateParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisCreateParamsWithContext creates a new DcimVirtualChassisCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisCreateParamsWithContext(ctx context.Context) *DcimVirtualChassisCreateParams { + var () + return &DcimVirtualChassisCreateParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisCreateParamsWithHTTPClient creates a new DcimVirtualChassisCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisCreateParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisCreateParams { + var () + return &DcimVirtualChassisCreateParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisCreateParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis create operation typically these are written to a http.Request +*/ +type DcimVirtualChassisCreateParams struct { + + /*Data*/ + Data *models.WritableVirtualChassis + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) WithContext(ctx context.Context) *DcimVirtualChassisCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) WithData(data *models.WritableVirtualChassis) *DcimVirtualChassisCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim virtual chassis create params +func (o *DcimVirtualChassisCreateParams) SetData(data *models.WritableVirtualChassis) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisCreateParams) 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_virtual_chassis_create_responses.go b/netbox/client/dcim/dcim_virtual_chassis_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..edeecd4a74436a3f45ec3a616e52630e01608db7 --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// DcimVirtualChassisCreateReader is a Reader for the DcimVirtualChassisCreate structure. +type DcimVirtualChassisCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimVirtualChassisCreateCreated() + 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()) + } +} + +// NewDcimVirtualChassisCreateCreated creates a DcimVirtualChassisCreateCreated with default headers values +func NewDcimVirtualChassisCreateCreated() *DcimVirtualChassisCreateCreated { + return &DcimVirtualChassisCreateCreated{} +} + +/*DcimVirtualChassisCreateCreated handles this case with default header values. + +DcimVirtualChassisCreateCreated dcim virtual chassis create created +*/ +type DcimVirtualChassisCreateCreated struct { + Payload *models.WritableVirtualChassis +} + +func (o *DcimVirtualChassisCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/virtual-chassis/][%d] dcimVirtualChassisCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimVirtualChassisCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualChassis) + + // 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_virtual_chassis_delete_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..810ca121e00af90571d9820f1cf8874ad68de56f --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// NewDcimVirtualChassisDeleteParams creates a new DcimVirtualChassisDeleteParams object +// with the default values initialized. +func NewDcimVirtualChassisDeleteParams() *DcimVirtualChassisDeleteParams { + var () + return &DcimVirtualChassisDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisDeleteParamsWithTimeout creates a new DcimVirtualChassisDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisDeleteParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisDeleteParams { + var () + return &DcimVirtualChassisDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisDeleteParamsWithContext creates a new DcimVirtualChassisDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisDeleteParamsWithContext(ctx context.Context) *DcimVirtualChassisDeleteParams { + var () + return &DcimVirtualChassisDeleteParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisDeleteParamsWithHTTPClient creates a new DcimVirtualChassisDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisDeleteParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisDeleteParams { + var () + return &DcimVirtualChassisDeleteParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisDeleteParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis delete operation typically these are written to a http.Request +*/ +type DcimVirtualChassisDeleteParams struct { + + /*ID + A unique integer value identifying this virtual chassis. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) WithContext(ctx context.Context) *DcimVirtualChassisDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) WithID(id int64) *DcimVirtualChassisDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim virtual chassis delete params +func (o *DcimVirtualChassisDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisDeleteParams) 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_virtual_chassis_delete_responses.go b/netbox/client/dcim/dcim_virtual_chassis_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fe9b47233e82285af40ab7eb4f23447a2d57c0fd --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// DcimVirtualChassisDeleteReader is a Reader for the DcimVirtualChassisDelete structure. +type DcimVirtualChassisDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimVirtualChassisDeleteNoContent() + 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()) + } +} + +// NewDcimVirtualChassisDeleteNoContent creates a DcimVirtualChassisDeleteNoContent with default headers values +func NewDcimVirtualChassisDeleteNoContent() *DcimVirtualChassisDeleteNoContent { + return &DcimVirtualChassisDeleteNoContent{} +} + +/*DcimVirtualChassisDeleteNoContent handles this case with default header values. + +DcimVirtualChassisDeleteNoContent dcim virtual chassis delete no content +*/ +type DcimVirtualChassisDeleteNoContent struct { +} + +func (o *DcimVirtualChassisDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/virtual-chassis/{id}/][%d] dcimVirtualChassisDeleteNoContent ", 204) +} + +func (o *DcimVirtualChassisDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..457beb0cdebb0f441815fd3b859312903e062c62 --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_list_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// NewDcimVirtualChassisListParams creates a new DcimVirtualChassisListParams object +// with the default values initialized. +func NewDcimVirtualChassisListParams() *DcimVirtualChassisListParams { + var () + return &DcimVirtualChassisListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisListParamsWithTimeout creates a new DcimVirtualChassisListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisListParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisListParams { + var () + return &DcimVirtualChassisListParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisListParamsWithContext creates a new DcimVirtualChassisListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisListParamsWithContext(ctx context.Context) *DcimVirtualChassisListParams { + var () + return &DcimVirtualChassisListParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisListParamsWithHTTPClient creates a new DcimVirtualChassisListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisListParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisListParams { + var () + return &DcimVirtualChassisListParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisListParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis list operation typically these are written to a http.Request +*/ +type DcimVirtualChassisListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithContext(ctx context.Context) *DcimVirtualChassisListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithLimit(limit *int64) *DcimVirtualChassisListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) WithOffset(offset *int64) *DcimVirtualChassisListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim virtual chassis list params +func (o *DcimVirtualChassisListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisListParams) 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_virtual_chassis_list_responses.go b/netbox/client/dcim/dcim_virtual_chassis_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b38d813ce884fc0a9e14208c9f559e76a6ef1ad9 --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// DcimVirtualChassisListReader is a Reader for the DcimVirtualChassisList structure. +type DcimVirtualChassisListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimVirtualChassisListOK() + 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()) + } +} + +// NewDcimVirtualChassisListOK creates a DcimVirtualChassisListOK with default headers values +func NewDcimVirtualChassisListOK() *DcimVirtualChassisListOK { + return &DcimVirtualChassisListOK{} +} + +/*DcimVirtualChassisListOK handles this case with default header values. + +DcimVirtualChassisListOK dcim virtual chassis list o k +*/ +type DcimVirtualChassisListOK struct { + Payload *models.DcimVirtualChassisListOKBody +} + +func (o *DcimVirtualChassisListOK) Error() string { + return fmt.Sprintf("[GET /dcim/virtual-chassis/][%d] dcimVirtualChassisListOK %+v", 200, o.Payload) +} + +func (o *DcimVirtualChassisListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimVirtualChassisListOKBody) + + // 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_virtual_chassis_partial_update_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f1cd282ad07932cff5baf9cc4107ad99b037bcb2 --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// NewDcimVirtualChassisPartialUpdateParams creates a new DcimVirtualChassisPartialUpdateParams object +// with the default values initialized. +func NewDcimVirtualChassisPartialUpdateParams() *DcimVirtualChassisPartialUpdateParams { + var () + return &DcimVirtualChassisPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisPartialUpdateParamsWithTimeout creates a new DcimVirtualChassisPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisPartialUpdateParams { + var () + return &DcimVirtualChassisPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisPartialUpdateParamsWithContext creates a new DcimVirtualChassisPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisPartialUpdateParamsWithContext(ctx context.Context) *DcimVirtualChassisPartialUpdateParams { + var () + return &DcimVirtualChassisPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisPartialUpdateParamsWithHTTPClient creates a new DcimVirtualChassisPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisPartialUpdateParams { + var () + return &DcimVirtualChassisPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis partial update operation typically these are written to a http.Request +*/ +type DcimVirtualChassisPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVirtualChassis + /*ID + A unique integer value identifying this virtual chassis. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithContext(ctx context.Context) *DcimVirtualChassisPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithData(data *models.WritableVirtualChassis) *DcimVirtualChassisPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetData(data *models.WritableVirtualChassis) { + o.Data = data +} + +// WithID adds the id to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) WithID(id int64) *DcimVirtualChassisPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim virtual chassis partial update params +func (o *DcimVirtualChassisPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisPartialUpdateParams) 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_virtual_chassis_partial_update_responses.go b/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cb0e13b28f68bd6913c0bf6bad194e88a10f9cea --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// DcimVirtualChassisPartialUpdateReader is a Reader for the DcimVirtualChassisPartialUpdate structure. +type DcimVirtualChassisPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimVirtualChassisPartialUpdateOK() + 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()) + } +} + +// NewDcimVirtualChassisPartialUpdateOK creates a DcimVirtualChassisPartialUpdateOK with default headers values +func NewDcimVirtualChassisPartialUpdateOK() *DcimVirtualChassisPartialUpdateOK { + return &DcimVirtualChassisPartialUpdateOK{} +} + +/*DcimVirtualChassisPartialUpdateOK handles this case with default header values. + +DcimVirtualChassisPartialUpdateOK dcim virtual chassis partial update o k +*/ +type DcimVirtualChassisPartialUpdateOK struct { + Payload *models.WritableVirtualChassis +} + +func (o *DcimVirtualChassisPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/virtual-chassis/{id}/][%d] dcimVirtualChassisPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimVirtualChassisPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualChassis) + + // 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_virtual_chassis_read_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4e623646b6026a1678a08871c904a3f15f1ec7fc --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// NewDcimVirtualChassisReadParams creates a new DcimVirtualChassisReadParams object +// with the default values initialized. +func NewDcimVirtualChassisReadParams() *DcimVirtualChassisReadParams { + var () + return &DcimVirtualChassisReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisReadParamsWithTimeout creates a new DcimVirtualChassisReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisReadParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisReadParams { + var () + return &DcimVirtualChassisReadParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisReadParamsWithContext creates a new DcimVirtualChassisReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisReadParamsWithContext(ctx context.Context) *DcimVirtualChassisReadParams { + var () + return &DcimVirtualChassisReadParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisReadParamsWithHTTPClient creates a new DcimVirtualChassisReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisReadParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisReadParams { + var () + return &DcimVirtualChassisReadParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisReadParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis read operation typically these are written to a http.Request +*/ +type DcimVirtualChassisReadParams struct { + + /*ID + A unique integer value identifying this virtual chassis. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) WithContext(ctx context.Context) *DcimVirtualChassisReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) WithID(id int64) *DcimVirtualChassisReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim virtual chassis read params +func (o *DcimVirtualChassisReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisReadParams) 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_virtual_chassis_read_responses.go b/netbox/client/dcim/dcim_virtual_chassis_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7f96c2b542b7ad10e51c1f63e3dde6c3a600fc21 --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// DcimVirtualChassisReadReader is a Reader for the DcimVirtualChassisRead structure. +type DcimVirtualChassisReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimVirtualChassisReadOK() + 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()) + } +} + +// NewDcimVirtualChassisReadOK creates a DcimVirtualChassisReadOK with default headers values +func NewDcimVirtualChassisReadOK() *DcimVirtualChassisReadOK { + return &DcimVirtualChassisReadOK{} +} + +/*DcimVirtualChassisReadOK handles this case with default header values. + +DcimVirtualChassisReadOK dcim virtual chassis read o k +*/ +type DcimVirtualChassisReadOK struct { + Payload *models.VirtualChassis +} + +func (o *DcimVirtualChassisReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/virtual-chassis/{id}/][%d] dcimVirtualChassisReadOK %+v", 200, o.Payload) +} + +func (o *DcimVirtualChassisReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualChassis) + + // 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_virtual_chassis_update_parameters.go b/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0ac2fe4b04c7f28b779beb3a8b7da6407d8e97d1 --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// NewDcimVirtualChassisUpdateParams creates a new DcimVirtualChassisUpdateParams object +// with the default values initialized. +func NewDcimVirtualChassisUpdateParams() *DcimVirtualChassisUpdateParams { + var () + return &DcimVirtualChassisUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimVirtualChassisUpdateParamsWithTimeout creates a new DcimVirtualChassisUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimVirtualChassisUpdateParamsWithTimeout(timeout time.Duration) *DcimVirtualChassisUpdateParams { + var () + return &DcimVirtualChassisUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimVirtualChassisUpdateParamsWithContext creates a new DcimVirtualChassisUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimVirtualChassisUpdateParamsWithContext(ctx context.Context) *DcimVirtualChassisUpdateParams { + var () + return &DcimVirtualChassisUpdateParams{ + + Context: ctx, + } +} + +// NewDcimVirtualChassisUpdateParamsWithHTTPClient creates a new DcimVirtualChassisUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimVirtualChassisUpdateParamsWithHTTPClient(client *http.Client) *DcimVirtualChassisUpdateParams { + var () + return &DcimVirtualChassisUpdateParams{ + HTTPClient: client, + } +} + +/*DcimVirtualChassisUpdateParams contains all the parameters to send to the API endpoint +for the dcim virtual chassis update operation typically these are written to a http.Request +*/ +type DcimVirtualChassisUpdateParams struct { + + /*Data*/ + Data *models.WritableVirtualChassis + /*ID + A unique integer value identifying this virtual chassis. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithTimeout(timeout time.Duration) *DcimVirtualChassisUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithContext(ctx context.Context) *DcimVirtualChassisUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithHTTPClient(client *http.Client) *DcimVirtualChassisUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithData(data *models.WritableVirtualChassis) *DcimVirtualChassisUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetData(data *models.WritableVirtualChassis) { + o.Data = data +} + +// WithID adds the id to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) WithID(id int64) *DcimVirtualChassisUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim virtual chassis update params +func (o *DcimVirtualChassisUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimVirtualChassisUpdateParams) 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_virtual_chassis_update_responses.go b/netbox/client/dcim/dcim_virtual_chassis_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5ae08a5c5dd5c50fca3c5288490474610dacd342 --- /dev/null +++ b/netbox/client/dcim/dcim_virtual_chassis_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// DcimVirtualChassisUpdateReader is a Reader for the DcimVirtualChassisUpdate structure. +type DcimVirtualChassisUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimVirtualChassisUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimVirtualChassisUpdateOK() + 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()) + } +} + +// NewDcimVirtualChassisUpdateOK creates a DcimVirtualChassisUpdateOK with default headers values +func NewDcimVirtualChassisUpdateOK() *DcimVirtualChassisUpdateOK { + return &DcimVirtualChassisUpdateOK{} +} + +/*DcimVirtualChassisUpdateOK handles this case with default header values. + +DcimVirtualChassisUpdateOK dcim virtual chassis update o k +*/ +type DcimVirtualChassisUpdateOK struct { + Payload *models.WritableVirtualChassis +} + +func (o *DcimVirtualChassisUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/virtual-chassis/{id}/][%d] dcimVirtualChassisUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimVirtualChassisUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualChassis) + + // 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_am_client.go b/netbox/client/ipam/ip_am_client.go index 9d0205f424a0a1d2e83223e2177f45623bff80e6..23f02d6da5260ded82f5f94837db9c11a04927a9 100644 --- a/netbox/client/ipam/ip_am_client.go +++ b/netbox/client/ipam/ip_am_client.go @@ -492,6 +492,64 @@ func (a *Client) IPAMPrefixesAvailableIpsRead(params *IPAMPrefixesAvailableIpsRe } +/* +IPAMPrefixesAvailablePrefixesCreate A convenience method for returning available child prefixes within a parent. +*/ +func (a *Client) IPAMPrefixesAvailablePrefixesCreate(params *IPAMPrefixesAvailablePrefixesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesAvailablePrefixesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesAvailablePrefixesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_available-prefixes_create", + Method: "POST", + PathPattern: "/ipam/prefixes/{id}/available-prefixes/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesAvailablePrefixesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesAvailablePrefixesCreateCreated), nil + +} + +/* +IPAMPrefixesAvailablePrefixesRead A convenience method for returning available child prefixes within a parent. +*/ +func (a *Client) IPAMPrefixesAvailablePrefixesRead(params *IPAMPrefixesAvailablePrefixesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesAvailablePrefixesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesAvailablePrefixesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_available-prefixes_read", + Method: "GET", + PathPattern: "/ipam/prefixes/{id}/available-prefixes/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesAvailablePrefixesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesAvailablePrefixesReadOK), nil + +} + /* IPAMPrefixesCreate ipam prefixes create API */ diff --git a/netbox/client/ipam/ip_amip_addresses_list_parameters.go b/netbox/client/ipam/ip_amip_addresses_list_parameters.go index b6872a821aee95bda3c059a2b71194a265fc8748..6adbd025dcc7e4ad30be8c9d268a5474892c6291 100644 --- a/netbox/client/ipam/ip_amip_addresses_list_parameters.go +++ b/netbox/client/ipam/ip_amip_addresses_list_parameters.go @@ -66,7 +66,7 @@ type IPAMIPAddressesListParams struct { /*Device*/ Device *string /*DeviceID*/ - DeviceID *string + DeviceID *float64 /*Family*/ Family *string /*IDIn @@ -159,13 +159,13 @@ func (o *IPAMIPAddressesListParams) SetDevice(device *string) { } // WithDeviceID adds the deviceID to the ipam ip addresses list params -func (o *IPAMIPAddressesListParams) WithDeviceID(deviceID *string) *IPAMIPAddressesListParams { +func (o *IPAMIPAddressesListParams) WithDeviceID(deviceID *float64) *IPAMIPAddressesListParams { o.SetDeviceID(deviceID) return o } // SetDeviceID adds the deviceId to the ipam ip addresses list params -func (o *IPAMIPAddressesListParams) SetDeviceID(deviceID *string) { +func (o *IPAMIPAddressesListParams) SetDeviceID(deviceID *float64) { o.DeviceID = deviceID } @@ -372,11 +372,11 @@ func (o *IPAMIPAddressesListParams) WriteToRequest(r runtime.ClientRequest, reg if o.DeviceID != nil { // query param device_id - var qrDeviceID string + var qrDeviceID float64 if o.DeviceID != nil { qrDeviceID = *o.DeviceID } - qDeviceID := qrDeviceID + qDeviceID := swag.FormatFloat64(qrDeviceID) if qDeviceID != "" { if err := r.SetQueryParam("device_id", qDeviceID); err != nil { return err diff --git a/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go b/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..45b16b7dd03c9e53b5575d9f4f2425fcb7839753 --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_available_prefixes_create_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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 ( + "net/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/davcamer/go-netbox/netbox/models" +) + +// NewIPAMPrefixesAvailablePrefixesCreateParams creates a new IPAMPrefixesAvailablePrefixesCreateParams object +// with the default values initialized. +func NewIPAMPrefixesAvailablePrefixesCreateParams() *IPAMPrefixesAvailablePrefixesCreateParams { + var () + return &IPAMPrefixesAvailablePrefixesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesAvailablePrefixesCreateParamsWithTimeout creates a new IPAMPrefixesAvailablePrefixesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesAvailablePrefixesCreateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesAvailablePrefixesCreateParams { + var () + return &IPAMPrefixesAvailablePrefixesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesAvailablePrefixesCreateParamsWithContext creates a new IPAMPrefixesAvailablePrefixesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesAvailablePrefixesCreateParamsWithContext(ctx context.Context) *IPAMPrefixesAvailablePrefixesCreateParams { + var () + return &IPAMPrefixesAvailablePrefixesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesAvailablePrefixesCreateParamsWithHTTPClient creates a new IPAMPrefixesAvailablePrefixesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesAvailablePrefixesCreateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesAvailablePrefixesCreateParams { + var () + return &IPAMPrefixesAvailablePrefixesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesAvailablePrefixesCreateParams contains all the parameters to send to the API endpoint +for the ipam prefixes available prefixes create operation typically these are written to a http.Request +*/ +type IPAMPrefixesAvailablePrefixesCreateParams struct { + + /*Data*/ + Data *models.Prefix + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithContext(ctx context.Context) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithData(data *models.Prefix) *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) { + o.Data = data +} + +// WithID adds the id to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) WithID(id int64) *IPAMPrefixesAvailablePrefixesCreateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes available prefixes create params +func (o *IPAMPrefixesAvailablePrefixesCreateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesAvailablePrefixesCreateParams) 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_available_prefixes_create_responses.go b/netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..259f02d6f83e0e06c2525e1cc15c19d177dff93a --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_available_prefixes_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// IPAMPrefixesAvailablePrefixesCreateReader is a Reader for the IPAMPrefixesAvailablePrefixesCreate structure. +type IPAMPrefixesAvailablePrefixesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesAvailablePrefixesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMPrefixesAvailablePrefixesCreateCreated() + 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()) + } +} + +// NewIPAMPrefixesAvailablePrefixesCreateCreated creates a IPAMPrefixesAvailablePrefixesCreateCreated with default headers values +func NewIPAMPrefixesAvailablePrefixesCreateCreated() *IPAMPrefixesAvailablePrefixesCreateCreated { + return &IPAMPrefixesAvailablePrefixesCreateCreated{} +} + +/*IPAMPrefixesAvailablePrefixesCreateCreated handles this case with default header values. + +IPAMPrefixesAvailablePrefixesCreateCreated ipam prefixes available prefixes create created +*/ +type IPAMPrefixesAvailablePrefixesCreateCreated struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesAvailablePrefixesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/prefixes/{id}/available-prefixes/][%d] ipamPrefixesAvailablePrefixesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMPrefixesAvailablePrefixesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Prefix) + + // 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_amprefixes_available_prefixes_read_parameters.go b/netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d44f6f9ebd8c043e32019fa36270780672677d52 --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_available_prefixes_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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 ( + "net/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" +) + +// NewIPAMPrefixesAvailablePrefixesReadParams creates a new IPAMPrefixesAvailablePrefixesReadParams object +// with the default values initialized. +func NewIPAMPrefixesAvailablePrefixesReadParams() *IPAMPrefixesAvailablePrefixesReadParams { + var () + return &IPAMPrefixesAvailablePrefixesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesAvailablePrefixesReadParamsWithTimeout creates a new IPAMPrefixesAvailablePrefixesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesAvailablePrefixesReadParamsWithTimeout(timeout time.Duration) *IPAMPrefixesAvailablePrefixesReadParams { + var () + return &IPAMPrefixesAvailablePrefixesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesAvailablePrefixesReadParamsWithContext creates a new IPAMPrefixesAvailablePrefixesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesAvailablePrefixesReadParamsWithContext(ctx context.Context) *IPAMPrefixesAvailablePrefixesReadParams { + var () + return &IPAMPrefixesAvailablePrefixesReadParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesAvailablePrefixesReadParamsWithHTTPClient creates a new IPAMPrefixesAvailablePrefixesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesAvailablePrefixesReadParamsWithHTTPClient(client *http.Client) *IPAMPrefixesAvailablePrefixesReadParams { + var () + return &IPAMPrefixesAvailablePrefixesReadParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesAvailablePrefixesReadParams contains all the parameters to send to the API endpoint +for the ipam prefixes available prefixes read operation typically these are written to a http.Request +*/ +type IPAMPrefixesAvailablePrefixesReadParams struct { + + /*ID + A unique integer value identifying this prefix. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) WithTimeout(timeout time.Duration) *IPAMPrefixesAvailablePrefixesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) WithContext(ctx context.Context) *IPAMPrefixesAvailablePrefixesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) WithHTTPClient(client *http.Client) *IPAMPrefixesAvailablePrefixesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) WithID(id int64) *IPAMPrefixesAvailablePrefixesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes available prefixes read params +func (o *IPAMPrefixesAvailablePrefixesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesAvailablePrefixesReadParams) 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_amprefixes_available_prefixes_read_responses.go b/netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3c3f6d01539f53c4072a036828cd1cef03970ec4 --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_available_prefixes_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/davcamer/go-netbox/netbox/models" +) + +// IPAMPrefixesAvailablePrefixesReadReader is a Reader for the IPAMPrefixesAvailablePrefixesRead structure. +type IPAMPrefixesAvailablePrefixesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesAvailablePrefixesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesAvailablePrefixesReadOK() + 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()) + } +} + +// NewIPAMPrefixesAvailablePrefixesReadOK creates a IPAMPrefixesAvailablePrefixesReadOK with default headers values +func NewIPAMPrefixesAvailablePrefixesReadOK() *IPAMPrefixesAvailablePrefixesReadOK { + return &IPAMPrefixesAvailablePrefixesReadOK{} +} + +/*IPAMPrefixesAvailablePrefixesReadOK handles this case with default header values. + +IPAMPrefixesAvailablePrefixesReadOK ipam prefixes available prefixes read o k +*/ +type IPAMPrefixesAvailablePrefixesReadOK struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesAvailablePrefixesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/{id}/available-prefixes/][%d] ipamPrefixesAvailablePrefixesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesAvailablePrefixesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Prefix) + + // 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_amprefixes_list_parameters.go b/netbox/client/ipam/ip_amprefixes_list_parameters.go index 3fe8d0ec04b155f3485d360ec4402b81c8de245c..15be08052eaf2c61c9a632aeba49c1d0315d5db6 100644 --- a/netbox/client/ipam/ip_amprefixes_list_parameters.go +++ b/netbox/client/ipam/ip_amprefixes_list_parameters.go @@ -86,8 +86,6 @@ type IPAMPrefixesListParams struct { */ Offset *int64 - /*Parent*/ - Parent *string /*Q*/ Q *string /*Role*/ @@ -232,17 +230,6 @@ func (o *IPAMPrefixesListParams) SetOffset(offset *int64) { o.Offset = offset } -// WithParent adds the parent to the ipam prefixes list params -func (o *IPAMPrefixesListParams) WithParent(parent *string) *IPAMPrefixesListParams { - o.SetParent(parent) - return o -} - -// SetParent adds the parent to the ipam prefixes list params -func (o *IPAMPrefixesListParams) SetParent(parent *string) { - o.Parent = parent -} - // WithQ adds the q to the ipam prefixes list params func (o *IPAMPrefixesListParams) WithQ(q *string) *IPAMPrefixesListParams { o.SetQ(q) @@ -517,22 +504,6 @@ func (o *IPAMPrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg str } - if o.Parent != nil { - - // query param parent - var qrParent string - if o.Parent != nil { - qrParent = *o.Parent - } - qParent := qrParent - if qParent != "" { - if err := r.SetQueryParam("parent", qParent); err != nil { - return err - } - } - - } - if o.Q != nil { // query param q diff --git a/netbox/models/aggregate.go b/netbox/models/aggregate.go index 39b9643b2d9607a02d1ad364514981c206f693d7..3b381c386d9c9a125743f5809a65cbd0d978e8d8 100644 --- a/netbox/models/aggregate.go +++ b/netbox/models/aggregate.go @@ -19,6 +19,10 @@ import ( // swagger:model Aggregate type Aggregate struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -37,6 +41,10 @@ type Aggregate struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Prefix // Required: true Prefix *string `json:"prefix"` diff --git a/netbox/models/circuit.go b/netbox/models/circuit.go index 6b3ca4efec5c088bc43d9bae09211b232d09eb90..d02d2022ced6ae96d8148d3bee2502da02bb51af 100644 --- a/netbox/models/circuit.go +++ b/netbox/models/circuit.go @@ -30,6 +30,10 @@ type Circuit struct { // Minimum: 0 CommitRate *int64 `json:"commit_rate,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -44,10 +48,18 @@ type Circuit struct { // Date installed InstallDate strfmt.Date `json:"install_date,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // provider // Required: true Provider *NestedProvider `json:"provider"` + // status + // Required: true + Status *CircuitStatus `json:"status"` + // tenant // Required: true Tenant *NestedTenant `json:"tenant"` @@ -81,6 +93,11 @@ func (m *Circuit) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + if err := m.validateTenant(formats); err != nil { // prop res = append(res, err) @@ -159,6 +176,25 @@ func (m *Circuit) validateProvider(formats strfmt.Registry) error { return nil } +func (m *Circuit) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + 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 *Circuit) validateTenant(formats strfmt.Registry) error { if err := validate.Required("tenant", "body", m.Tenant); err != nil { diff --git a/netbox/models/circuit_status.go b/netbox/models/circuit_status.go new file mode 100644 index 0000000000000000000000000000000000000000..7195c1988be2ff57ba8e3980d1fb8fe8566e45a9 --- /dev/null +++ b/netbox/models/circuit_status.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/cluster.go b/netbox/models/cluster.go index 1d52003a1c610d248bc87b17ce73e8297ad9b724..f22c733ba10427e41fc5136b32f6c86456844c5e 100644 --- a/netbox/models/cluster.go +++ b/netbox/models/cluster.go @@ -20,6 +20,10 @@ type Cluster struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -31,6 +35,10 @@ type Cluster struct { // 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: 100 diff --git a/netbox/models/console_port.go b/netbox/models/console_port.go index 9e7a36292bee58b8e135f1f6b5550bb97f0a34a7..276b827c06a39da72b9242c013c8d4a19686f462 100644 --- a/netbox/models/console_port.go +++ b/netbox/models/console_port.go @@ -6,6 +6,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" @@ -42,6 +44,11 @@ type ConsolePort struct { func (m *ConsolePort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + if err := m.validateCsPort(formats); err != nil { // prop res = append(res, err) @@ -63,6 +70,40 @@ func (m *ConsolePort) Validate(formats strfmt.Registry) error { return nil } +var consolePortTypeConnectionStatusPropEnum []interface{} + +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) + } +} + +// 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 + } + return nil +} + +func (m *ConsolePort) 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 *ConsolePort) validateCsPort(formats strfmt.Registry) error { if err := validate.Required("cs_port", "body", m.CsPort); err != nil { diff --git a/netbox/models/dcim_virtual_chassis_list_okbody.go b/netbox/models/dcim_virtual_chassis_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..d2569bdf17cb43e664a2041b29654a1201954905 --- /dev/null +++ b/netbox/models/dcim_virtual_chassis_list_okbody.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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 new file mode 100644 index 0000000000000000000000000000000000000000..dcc0132bd0b7d2be6ab322614fed8c3a35ea13d0 --- /dev/null +++ b/netbox/models/dcim_virtual_chassis_list_okbody_results.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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 fe3ce41ebe6eea4023685411d5a5968db890614c..aa3f7bba86880df42777addb359e33636b6dbebf 100644 --- a/netbox/models/device.go +++ b/netbox/models/device.go @@ -30,6 +30,10 @@ type Device struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -53,6 +57,10 @@ type Device struct { // 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"` @@ -104,6 +112,21 @@ type Device struct { // tenant // Required: true Tenant *NestedTenant `json:"tenant"` + + // Vc position + // Required: true + // Maximum: 255 + // Minimum: 0 + VcPosition *int64 `json:"vc_position"` + + // Vc priority + // Maximum: 255 + // Minimum: 0 + VcPriority *int64 `json:"vc_priority,omitempty"` + + // virtual chassis + // Required: true + VirtualChassis *DeviceVirtualChassis `json:"virtual_chassis"` } // Validate validates this device @@ -190,6 +213,21 @@ func (m *Device) Validate(formats strfmt.Registry) error { 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) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -480,6 +518,59 @@ func (m *Device) validateTenant(formats strfmt.Registry) error { return nil } +func (m *Device) validateVcPosition(formats strfmt.Registry) error { + + if err := validate.Required("vc_position", "body", m.VcPosition); err != nil { + return err + } + + 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 *Device) 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 *Device) validateVirtualChassis(formats strfmt.Registry) error { + + if err := validate.Required("virtual_chassis", "body", m.VirtualChassis); err != nil { + return err + } + + 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 *Device) MarshalBinary() ([]byte, error) { if m == nil { diff --git a/netbox/models/device_virtual_chassis.go b/netbox/models/device_virtual_chassis.go new file mode 100644 index 0000000000000000000000000000000000000000..9f4e559d2309308ec8554f12f7d3746fa17ceb0d --- /dev/null +++ b/netbox/models/device_virtual_chassis.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// DeviceVirtualChassis Virtual chassis +// swagger:model DeviceVirtualChassis +type DeviceVirtualChassis struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // master + // Required: true + Master *NestedDevice `json:"master"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this device virtual chassis +func (m *DeviceVirtualChassis) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMaster(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceVirtualChassis) 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") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceVirtualChassis) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceVirtualChassis) UnmarshalBinary(b []byte) error { + var res DeviceVirtualChassis + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface.go b/netbox/models/interface.go index 7b1a58d0e3b6885f5a07d52a28426b9fd8c8f0c5..c94fb5dd95a223c5f2b7d3c85f0dc8e97462d246 100644 --- a/netbox/models/interface.go +++ b/netbox/models/interface.go @@ -60,6 +60,10 @@ type Interface struct { // 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 @@ -69,6 +73,14 @@ type Interface struct { // 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 @@ -100,6 +112,11 @@ func (m *Interface) Validate(formats strfmt.Registry) error { 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) @@ -110,6 +127,16 @@ func (m *Interface) Validate(formats strfmt.Registry) error { 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...) } @@ -205,6 +232,25 @@ func (m *Interface) validateLag(formats strfmt.Registry) error { 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 @@ -235,6 +281,41 @@ func (m *Interface) validateName(formats strfmt.Registry) error { 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 { diff --git a/netbox/models/interface_mode.go b/netbox/models/interface_mode.go new file mode 100644 index 0000000000000000000000000000000000000000..9bdb4241cb29ac76a9a6f7c7ce3d5eb3c7e3f8e8 --- /dev/null +++ b/netbox/models/interface_mode.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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 new file mode 100644 index 0000000000000000000000000000000000000000..3d69d38c9aaf35d76b27959b94689f56815b8b6b --- /dev/null +++ b/netbox/models/interface_tagged_vlans.go @@ -0,0 +1,47 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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_vlan.go b/netbox/models/interface_vlan.go new file mode 100644 index 0000000000000000000000000000000000000000..9eb6ecaeaf4d56421fc67f22dda6bc599ffd3fc1 --- /dev/null +++ b/netbox/models/interface_vlan.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// InterfaceVLAN Untagged vlan +// swagger:model InterfaceVLAN +type InterfaceVLAN struct { + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Url + // Read Only: true + 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 { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceVLAN) 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 *InterfaceVLAN) validateVid(formats strfmt.Registry) error { + + if err := validate.Required("vid", "body", m.Vid); err != nil { + return err + } + + if err := validate.MinimumInt("vid", "body", int64(*m.Vid), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("vid", "body", int64(*m.Vid), 4094, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceVLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceVLAN) UnmarshalBinary(b []byte) error { + var res InterfaceVLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_address.go b/netbox/models/ip_address.go index 0f441fda40c7ce66a0b68bd0f60fea0b06549c6e..36ae47de93e3d95efd546c34cb799d9c06df74f4 100644 --- a/netbox/models/ip_address.go +++ b/netbox/models/ip_address.go @@ -23,6 +23,10 @@ type IPAddress struct { // Required: true Address *string `json:"address"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -42,6 +46,10 @@ type IPAddress struct { // Required: true Interface *IPAddressInterface `json:"interface"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // nat inside // Required: true NatInside *NestedIPAddress `json:"nat_inside"` diff --git a/netbox/models/ip_address_interface.go b/netbox/models/ip_address_interface.go index cb411f6a48af226dd281d2ee11f32a3397e0acf5..fc19c79e70839b5735aea70c915c96303c46575c 100644 --- a/netbox/models/ip_address_interface.go +++ b/netbox/models/ip_address_interface.go @@ -17,59 +17,23 @@ import ( // swagger:model IPAddressInterface type IPAddressInterface 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 *IPAddressInterfaceFormFactor `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"` - - // 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 string `json:"url,omitempty"` + // virtual machine // Required: true VirtualMachine *NestedVirtualMachine `json:"virtual_machine"` @@ -79,36 +43,11 @@ type IPAddressInterface struct { func (m *IPAddressInterface) 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.validateMtu(formats); err != nil { - // prop - res = append(res, err) - } - if err := m.validateName(formats); err != nil { // prop res = append(res, err) @@ -125,38 +64,6 @@ func (m *IPAddressInterface) Validate(formats strfmt.Registry) error { return nil } -func (m *IPAddressInterface) 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 *IPAddressInterface) 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 *IPAddressInterface) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { @@ -176,61 +83,6 @@ func (m *IPAddressInterface) validateDevice(formats strfmt.Registry) error { return nil } -func (m *IPAddressInterface) 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 *IPAddressInterface) 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 *IPAddressInterface) 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 *IPAddressInterface) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { diff --git a/netbox/models/platform.go b/netbox/models/platform.go index fe4b37845d644a960709de70db3bd1f80a1dc8cc..c7ca77f4367aed37f5e461276d4ead192065b2f5 100644 --- a/netbox/models/platform.go +++ b/netbox/models/platform.go @@ -23,6 +23,10 @@ type Platform struct { // Read Only: true ID int64 `json:"id,omitempty"` + // manufacturer + // Required: true + Manufacturer *NestedManufacturer `json:"manufacturer"` + // Name // Required: true // Max Length: 50 @@ -30,7 +34,7 @@ type Platform struct { // NAPALM driver // - // The name of the NAPALM driver to use when interacting with devices. + // The name of the NAPALM driver to use when interacting with devices // Max Length: 50 NapalmDriver string `json:"napalm_driver,omitempty"` @@ -48,6 +52,11 @@ type Platform struct { 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) @@ -74,6 +83,25 @@ func (m *Platform) Validate(formats strfmt.Registry) error { return nil } +func (m *Platform) validateManufacturer(formats strfmt.Registry) error { + + if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { + return err + } + + if m.Manufacturer != nil { + + if err := m.Manufacturer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("manufacturer") + } + return err + } + } + + return nil +} + func (m *Platform) validateName(formats strfmt.Registry) error { if err := validate.Required("name", "body", m.Name); err != nil { diff --git a/netbox/models/power_port.go b/netbox/models/power_port.go index 33e347a19540c48f445fc1885c8c8a4afd564cc1..acdc56811549ac5545330f2deaa735bf1f6b54bc 100644 --- a/netbox/models/power_port.go +++ b/netbox/models/power_port.go @@ -6,6 +6,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" @@ -42,6 +44,11 @@ type PowerPort struct { func (m *PowerPort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { // prop res = append(res, err) @@ -63,6 +70,40 @@ func (m *PowerPort) Validate(formats strfmt.Registry) error { return nil } +var powerPortTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + powerPortTypeConnectionStatusPropEnum = append(powerPortTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *PowerPort) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, powerPortTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *PowerPort) 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 *PowerPort) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { diff --git a/netbox/models/prefix.go b/netbox/models/prefix.go index 233cb0bdcb35d8dcba4ec3ff95963e143c86ff1f..437b09466dc8c6323325268f6ccc05e32aac52bf 100644 --- a/netbox/models/prefix.go +++ b/netbox/models/prefix.go @@ -17,6 +17,10 @@ import ( // swagger:model Prefix type Prefix struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -37,6 +41,10 @@ type Prefix struct { // All IP addresses within this prefix are considered usable IsPool bool `json:"is_pool,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Prefix // // IPv4 or IPv6 network with mask diff --git a/netbox/models/provider.go b/netbox/models/provider.go index d64fb5738344af7753371d46ba78352d63fad4ba..66ab8bdc088d2a3cca21c6fd8ca2ab277eeb7972 100644 --- a/netbox/models/provider.go +++ b/netbox/models/provider.go @@ -32,6 +32,10 @@ type Provider struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -39,6 +43,10 @@ type Provider struct { // 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 diff --git a/netbox/models/rack.go b/netbox/models/rack.go index b6d2cd97ddd594c439354c9844571da7c5903742..a6a2b90edfa41435acd3b76c87c2138ec0bf96f7 100644 --- a/netbox/models/rack.go +++ b/netbox/models/rack.go @@ -20,6 +20,10 @@ type Rack struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -45,6 +49,10 @@ type Rack struct { // 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 diff --git a/netbox/models/rack_reservation.go b/netbox/models/rack_reservation.go index 7c9096e39a9efb0668eff76c78acaaca123b7ce4..486709b75c91738d650be24979c758c06afaf26f 100644 --- a/netbox/models/rack_reservation.go +++ b/netbox/models/rack_reservation.go @@ -36,13 +36,17 @@ type RackReservation struct { // Required: true Rack *NestedRack `json:"rack"` + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + // units // Required: true Units []*int64 `json:"units"` - // User + // user // Required: true - User *int64 `json:"user"` + User *NestedUser `json:"user"` } // Validate validates this rack reservation @@ -59,6 +63,11 @@ func (m *RackReservation) Validate(formats strfmt.Registry) error { 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) @@ -107,6 +116,25 @@ func (m *RackReservation) validateRack(formats strfmt.Registry) error { return nil } +func (m *RackReservation) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + 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 *RackReservation) validateUnits(formats strfmt.Registry) error { if err := validate.Required("units", "body", m.Units); err != nil { @@ -138,6 +166,16 @@ func (m *RackReservation) validateUser(formats strfmt.Registry) error { 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 } diff --git a/netbox/models/service.go b/netbox/models/service.go index cf5cae55fba463829ef9586bb3ab58da1f545244..40e477a68c64554bf0ac612d492e7594974b0549 100644 --- a/netbox/models/service.go +++ b/netbox/models/service.go @@ -17,6 +17,10 @@ import ( // swagger:model Service type Service struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Description // Max Length: 100 Description string `json:"description,omitempty"` @@ -33,6 +37,10 @@ type Service struct { // Required: true Ipaddresses ServiceIpaddresses `json:"ipaddresses"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Name // Required: true // Max Length: 30 diff --git a/netbox/models/site.go b/netbox/models/site.go index df60b930d7e3c53acc06a11eada2f718c522ca5a..aa7358d9a59bbfb120a129fdf33f79c462332e68 100644 --- a/netbox/models/site.go +++ b/netbox/models/site.go @@ -57,9 +57,17 @@ type Site struct { // Read Only: true CountVlans string `json:"count_vlans,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // Facility // Max Length: 50 Facility string `json:"facility,omitempty"` @@ -68,6 +76,10 @@ type Site struct { // 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 @@ -91,9 +103,16 @@ type Site struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // status + // Required: true + Status *SiteStatus `json:"status"` + // tenant // Required: true Tenant *NestedTenant `json:"tenant"` + + // Time zone + TimeZone string `json:"time_zone,omitempty"` } // Validate validates this site @@ -120,6 +139,11 @@ func (m *Site) Validate(formats strfmt.Registry) error { 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) @@ -150,6 +174,11 @@ func (m *Site) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + if err := m.validateTenant(formats); err != nil { // prop res = append(res, err) @@ -221,6 +250,19 @@ func (m *Site) validateContactPhone(formats strfmt.Registry) error { return nil } +func (m *Site) 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 *Site) validateFacility(formats strfmt.Registry) error { if swag.IsZero(m.Facility) { // not required @@ -309,6 +351,25 @@ func (m *Site) validateSlug(formats strfmt.Registry) error { return nil } +func (m *Site) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + 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 *Site) validateTenant(formats strfmt.Registry) error { if err := validate.Required("tenant", "body", m.Tenant); err != nil { diff --git a/netbox/models/site_status.go b/netbox/models/site_status.go new file mode 100644 index 0000000000000000000000000000000000000000..452eb9724c1616d5e0664f7867f2ea319271b0d1 --- /dev/null +++ b/netbox/models/site_status.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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/tenant.go b/netbox/models/tenant.go index 20dea52b7b1cf5ab670166eb97f9e46ec72dac6d..1e7a0d929d67bbf70f7d72c24ff8e36842f74b7d 100644 --- a/netbox/models/tenant.go +++ b/netbox/models/tenant.go @@ -20,6 +20,10 @@ type Tenant struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -37,6 +41,10 @@ type Tenant struct { // 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: 30 diff --git a/netbox/models/virtual_chassis.go b/netbox/models/virtual_chassis.go new file mode 100644 index 0000000000000000000000000000000000000000..8e516a78d6b2e6f453b03e50c56f8f46935d6ce3 --- /dev/null +++ b/netbox/models/virtual_chassis.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// VirtualChassis virtual chassis +// swagger:model VirtualChassis +type VirtualChassis struct { + + // Domain + // Max Length: 30 + Domain string `json:"domain,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // master + // Required: true + Master *NestedDevice `json:"master"` +} + +// Validate validates this virtual chassis +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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualChassis) validateDomain(formats strfmt.Registry) error { + + if swag.IsZero(m.Domain) { // not required + return nil + } + + if err := validate.MaxLength("domain", "body", string(m.Domain), 30); err != nil { + return err + } + + return nil +} + +func (m *VirtualChassis) 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") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualChassis) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualChassis) UnmarshalBinary(b []byte) error { + var res VirtualChassis + 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.go index 2b7e7ccf95559185f3ba1fc6f393bcdd2b8a5307..0cb618ce4a03f5c1bb2d7b745df4d35a2e2d3f02 100644 --- a/netbox/models/virtual_machine.go +++ b/netbox/models/virtual_machine.go @@ -24,6 +24,10 @@ type VirtualMachine struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -36,6 +40,10 @@ type VirtualMachine struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Memory (MB) // Maximum: 2.147483647e+09 // Minimum: 0 diff --git a/netbox/models/vlan.go b/netbox/models/vlan.go index 042e6386175c43d19ca4044716ab52c45e073f1a..e5e20ea61f465c65dbba58c9c8608dffb73fc02c 100644 --- a/netbox/models/vlan.go +++ b/netbox/models/vlan.go @@ -17,6 +17,10 @@ import ( // swagger:model VLAN type VLAN struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -36,6 +40,10 @@ type VLAN struct { // 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: 64 diff --git a/netbox/models/vrf.go b/netbox/models/vrf.go index 8fcafbcf817b88fddca91cc07a16a407cc404ab2..3c4873bf9b47ffa2f25628b895ae4673e0c70be9 100644 --- a/netbox/models/vrf.go +++ b/netbox/models/vrf.go @@ -17,6 +17,10 @@ import ( // swagger:model VRF type VRF struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -37,6 +41,10 @@ type VRF struct { // 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 diff --git a/netbox/models/writable_aggregate.go b/netbox/models/writable_aggregate.go index 04a55ad27a3baaed0721b199da8c48bf7dd635c1..dd3ce113865129876d6628259aa6254298d6eef6 100644 --- a/netbox/models/writable_aggregate.go +++ b/netbox/models/writable_aggregate.go @@ -17,6 +17,10 @@ import ( // swagger:model WritableAggregate type WritableAggregate struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -31,6 +35,10 @@ type WritableAggregate struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Prefix // Required: true Prefix *string `json:"prefix"` diff --git a/netbox/models/writable_circuit.go b/netbox/models/writable_circuit.go index 41f490dc2d522f58dce33a835f0bbf29202e79c2..96979cbe5f9eb69d53319194522c16114b64f7ff 100644 --- a/netbox/models/writable_circuit.go +++ b/netbox/models/writable_circuit.go @@ -6,6 +6,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" @@ -30,6 +32,10 @@ type WritableCircuit struct { // Minimum: 0 CommitRate *int64 `json:"commit_rate,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -44,10 +50,17 @@ type WritableCircuit struct { // Date installed InstallDate strfmt.Date `json:"install_date,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Provider // Required: true Provider *int64 `json:"provider"` + // Status + Status int64 `json:"status,omitempty"` + // Tenant Tenant int64 `json:"tenant,omitempty"` @@ -80,6 +93,11 @@ func (m *WritableCircuit) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + if err := m.validateType(formats); err != nil { // prop res = append(res, err) @@ -143,6 +161,40 @@ func (m *WritableCircuit) validateProvider(formats strfmt.Registry) error { return nil } +var writableCircuitTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[2,3,1,4,0,5]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableCircuitTypeStatusPropEnum = append(writableCircuitTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableCircuit) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableCircuitTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableCircuit) 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 *WritableCircuit) validateType(formats strfmt.Registry) error { if err := validate.Required("type", "body", m.Type); err != nil { diff --git a/netbox/models/writable_cluster.go b/netbox/models/writable_cluster.go index e61b2f7dce518615e7364e52fa2ceb7dd4e9bbb7..4bff155276b4a9e6e79422a0d81bf487c760b903 100644 --- a/netbox/models/writable_cluster.go +++ b/netbox/models/writable_cluster.go @@ -20,6 +20,10 @@ type WritableCluster struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -30,6 +34,10 @@ type WritableCluster struct { // 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: 100 diff --git a/netbox/models/writable_console_port.go b/netbox/models/writable_console_port.go index bc5c34893abd0e897239fccc86e58418d4bab6cb..d52c6ae4dc119e98bb8f414d278bdce877c9718f 100644 --- a/netbox/models/writable_console_port.go +++ b/netbox/models/writable_console_port.go @@ -6,6 +6,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" @@ -41,6 +43,11 @@ type WritableConsolePort struct { func (m *WritableConsolePort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { // prop res = append(res, err) @@ -57,6 +64,40 @@ func (m *WritableConsolePort) Validate(formats strfmt.Registry) error { return nil } +var writableConsolePortTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableConsolePortTypeConnectionStatusPropEnum = append(writableConsolePortTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableConsolePort) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableConsolePortTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableConsolePort) 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 *WritableConsolePort) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { diff --git a/netbox/models/writable_device.go b/netbox/models/writable_device.go index 0990a7b24e7ba700a701bde4e21f73a831f8e06b..448fa6697d8f9416f311c1ef96593e87e8d62499 100644 --- a/netbox/models/writable_device.go +++ b/netbox/models/writable_device.go @@ -31,6 +31,10 @@ type WritableDevice struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -49,6 +53,10 @@ type WritableDevice struct { // 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"` @@ -85,6 +93,19 @@ type WritableDevice struct { // 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 @@ -136,6 +157,16 @@ func (m *WritableDevice) Validate(formats strfmt.Registry) error { 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...) } @@ -293,6 +324,40 @@ func (m *WritableDevice) validateStatus(formats strfmt.Registry) error { 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 { diff --git a/netbox/models/writable_interface.go b/netbox/models/writable_interface.go index 096ebc66fdf431056f607a868ea126bb452d3283..227e6b23dd1e56000ccc930dab0c296e5caf27c3 100644 --- a/netbox/models/writable_interface.go +++ b/netbox/models/writable_interface.go @@ -48,6 +48,9 @@ type WritableInterface struct { // 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 @@ -57,6 +60,13 @@ type WritableInterface struct { // 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 @@ -78,6 +88,11 @@ func (m *WritableInterface) Validate(formats strfmt.Registry) error { 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) @@ -88,6 +103,11 @@ func (m *WritableInterface) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateTaggedVlans(formats); err != nil { + // prop + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -150,6 +170,40 @@ func (m *WritableInterface) validateFormFactor(formats strfmt.Registry) error { 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 @@ -180,6 +234,19 @@ func (m *WritableInterface) validateName(formats strfmt.Registry) error { 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 { diff --git a/netbox/models/writable_interface_connection.go b/netbox/models/writable_interface_connection.go index 1366f1fe3674a470f84215331b2477f4fe5165cb..0c9d61ad8d06b44731d50b9d30fa93a8568cc06b 100644 --- a/netbox/models/writable_interface_connection.go +++ b/netbox/models/writable_interface_connection.go @@ -6,6 +6,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" @@ -37,6 +39,11 @@ type WritableInterfaceConnection struct { 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) @@ -53,6 +60,40 @@ func (m *WritableInterfaceConnection) Validate(formats strfmt.Registry) error { 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 { diff --git a/netbox/models/writable_ip_address.go b/netbox/models/writable_ip_address.go index 116d8bc85df5d0aaf06fd47da821dec5ee69d6d1..9b9d56b893176818db48a4533c7e0cb2dc1c7808 100644 --- a/netbox/models/writable_ip_address.go +++ b/netbox/models/writable_ip_address.go @@ -25,6 +25,10 @@ type WritableIPAddress struct { // Required: true Address *string `json:"address"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -39,6 +43,10 @@ type WritableIPAddress struct { // Interface Interface int64 `json:"interface,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // NAT (Inside) // // The IP for which this address is the "outside" IP diff --git a/netbox/models/writable_platform.go b/netbox/models/writable_platform.go new file mode 100644 index 0000000000000000000000000000000000000000..d8497a06b4ede02e00dd9b178b6f97c699519717 --- /dev/null +++ b/netbox/models/writable_platform.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// WritablePlatform writable platform +// swagger:model WritablePlatform +type WritablePlatform struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Manufacturer + // + // Optionally limit this platform to devices of a certain manufacturer + Manufacturer int64 `json:"manufacturer,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // 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 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable platform +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) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePlatform) 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 *WritablePlatform) validateNapalmDriver(formats strfmt.Registry) error { + + if swag.IsZero(m.NapalmDriver) { // not required + return nil + } + + if err := validate.MaxLength("napalm_driver", "body", string(m.NapalmDriver), 50); err != nil { + return err + } + + 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 + } + + // value enum + if err := m.validateRPCClientEnum("rpc_client", "body", m.RPCClient); err != nil { + return err + } + + return nil +} + +func (m *WritablePlatform) 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 *WritablePlatform) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePlatform) UnmarshalBinary(b []byte) error { + var res WritablePlatform + 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 1975e9c9d2a8361ea4d958b64991df7843e3a565..062ccdd9c036637f3d022dc77304db7ba12ba3cc 100644 --- a/netbox/models/writable_power_port.go +++ b/netbox/models/writable_power_port.go @@ -6,6 +6,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" @@ -41,6 +43,11 @@ type WritablePowerPort struct { func (m *WritablePowerPort) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + if err := m.validateDevice(formats); err != nil { // prop res = append(res, err) @@ -57,6 +64,40 @@ func (m *WritablePowerPort) Validate(formats strfmt.Registry) error { return nil } +var writablePowerPortTypeConnectionStatusPropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[false,true]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePowerPortTypeConnectionStatusPropEnum = append(writablePowerPortTypeConnectionStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritablePowerPort) validateConnectionStatusEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writablePowerPortTypeConnectionStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePowerPort) 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 *WritablePowerPort) validateDevice(formats strfmt.Registry) error { if err := validate.Required("device", "body", m.Device); err != nil { diff --git a/netbox/models/writable_prefix.go b/netbox/models/writable_prefix.go index eca4f005b2897681c85529beda6626aabe2ef780..3a5bdfebaec227ffa2b3d35dff3e9c6630909c53 100644 --- a/netbox/models/writable_prefix.go +++ b/netbox/models/writable_prefix.go @@ -19,6 +19,10 @@ import ( // swagger:model WritablePrefix type WritablePrefix struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -35,6 +39,10 @@ type WritablePrefix struct { // All IP addresses within this prefix are considered usable IsPool bool `json:"is_pool,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Prefix // // IPv4 or IPv6 network with mask diff --git a/netbox/models/writable_provider.go b/netbox/models/writable_provider.go index 86606a722ee04c74c9471f5e4b8dffa55b62ec55..ab006fa1c5ac02ed7ab66692355bdf55070ec6f5 100644 --- a/netbox/models/writable_provider.go +++ b/netbox/models/writable_provider.go @@ -32,6 +32,10 @@ type WritableProvider struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -39,6 +43,10 @@ type WritableProvider struct { // 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 diff --git a/netbox/models/writable_rack.go b/netbox/models/writable_rack.go index 2350a3f75b0a7f774715d32baa0bad423cb0c1dc..608687530ab064c5e27bbe9cc12031786d155825 100644 --- a/netbox/models/writable_rack.go +++ b/netbox/models/writable_rack.go @@ -22,6 +22,10 @@ type WritableRack struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -41,6 +45,10 @@ type WritableRack struct { // 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 diff --git a/netbox/models/writable_secret.go b/netbox/models/writable_secret.go index f799401e7ed7c8fbc2939bd8bb6ed7cff6c00f31..8c0efbe597da80a000aec0c895a52f78895ca583 100644 --- a/netbox/models/writable_secret.go +++ b/netbox/models/writable_secret.go @@ -17,14 +17,26 @@ import ( // swagger:model WritableSecret type WritableSecret struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Device // Required: true Device *int64 `json:"device"` + // Hash + // Read Only: true + Hash string `json:"hash,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: 100 Name string `json:"name,omitempty"` diff --git a/netbox/models/writable_service.go b/netbox/models/writable_service.go index 9a5a2d273fd23bd83db28fa212af529d4d050a70..7a841705b92f0b5476bfeb3863f6dbc2b83b8f42 100644 --- a/netbox/models/writable_service.go +++ b/netbox/models/writable_service.go @@ -19,6 +19,10 @@ import ( // swagger:model WritableService type WritableService struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Description // Max Length: 100 Description string `json:"description,omitempty"` @@ -34,6 +38,10 @@ type WritableService struct { // Unique: true Ipaddresses []int64 `json:"ipaddresses"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Name // Required: true // Max Length: 30 diff --git a/netbox/models/writable_site.go b/netbox/models/writable_site.go index 0cf9f53676bd5d9d3cb2dd630a09e89f918f6754..50e9d2b356ab3c33e8c3d321ad8fc2d6e94aeddb 100644 --- a/netbox/models/writable_site.go +++ b/netbox/models/writable_site.go @@ -6,6 +6,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" @@ -37,9 +39,17 @@ type WritableSite struct { // Max Length: 20 ContactPhone string `json:"contact_phone,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + // Facility // Max Length: 50 Facility string `json:"facility,omitempty"` @@ -48,6 +58,10 @@ type WritableSite struct { // 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 @@ -70,8 +84,14 @@ type WritableSite struct { // Pattern: ^[-a-zA-Z0-9_]+$ Slug *string `json:"slug"` + // Status + Status int64 `json:"status,omitempty"` + // Tenant Tenant int64 `json:"tenant,omitempty"` + + // Time zone + TimeZone string `json:"time_zone,omitempty"` } // Validate validates this writable site @@ -98,6 +118,11 @@ func (m *WritableSite) Validate(formats strfmt.Registry) error { 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) @@ -123,6 +148,11 @@ func (m *WritableSite) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -189,6 +219,19 @@ func (m *WritableSite) validateContactPhone(formats strfmt.Registry) error { return nil } +func (m *WritableSite) 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 *WritableSite) validateFacility(formats strfmt.Registry) error { if swag.IsZero(m.Facility) { // not required @@ -258,6 +301,40 @@ func (m *WritableSite) validateSlug(formats strfmt.Registry) error { return nil } +var writableSiteTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2,4]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableSiteTypeStatusPropEnum = append(writableSiteTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableSite) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableSiteTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableSite) 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 +} + // 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 f5b677f974e1a36e409f887d03e5a399954d95a0..6dd0f4fdaa506aed4ad0d500d520c9a73346110f 100644 --- a/netbox/models/writable_tenant.go +++ b/netbox/models/writable_tenant.go @@ -20,6 +20,10 @@ type WritableTenant struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -36,6 +40,10 @@ type WritableTenant struct { // 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: 30 diff --git a/netbox/models/writable_virtual_chassis.go b/netbox/models/writable_virtual_chassis.go new file mode 100644 index 0000000000000000000000000000000000000000..2c79b01dce70a86a36e794943e8c08969b7bdf66 --- /dev/null +++ b/netbox/models/writable_virtual_chassis.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +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" +) + +// WritableVirtualChassis writable virtual chassis +// swagger:model WritableVirtualChassis +type WritableVirtualChassis struct { + + // Domain + // Max Length: 30 + Domain string `json:"domain,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Master + // Required: true + Master *int64 `json:"master"` +} + +// Validate validates this writable virtual chassis +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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVirtualChassis) validateDomain(formats strfmt.Registry) error { + + if swag.IsZero(m.Domain) { // not required + return nil + } + + if err := validate.MaxLength("domain", "body", string(m.Domain), 30); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualChassis) validateMaster(formats strfmt.Registry) error { + + if err := validate.Required("master", "body", m.Master); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVirtualChassis) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVirtualChassis) UnmarshalBinary(b []byte) error { + var res WritableVirtualChassis + 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.go index 18c8c9c89958724d4f622f2682f68c4df9ee536e..fb80ce8ef6b20e37cd1d86eb85fa421e6f0c6315 100644 --- a/netbox/models/writable_virtual_machine.go +++ b/netbox/models/writable_virtual_machine.go @@ -26,6 +26,10 @@ type WritableVirtualMachine struct { // Comments Comments string `json:"comments,omitempty"` + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -38,6 +42,10 @@ type WritableVirtualMachine struct { // Read Only: true ID int64 `json:"id,omitempty"` + // Last updated + // Read Only: true + LastUpdated strfmt.DateTime `json:"last_updated,omitempty"` + // Memory (MB) // Maximum: 2.147483647e+09 // Minimum: 0 diff --git a/netbox/models/writable_vlan.go b/netbox/models/writable_vlan.go index a0e2791c14d87d1385dc3ede6a5a35d760d18ed6..ddd39d0e58c0e35c49b1f1ed4c357bc1fe3f900a 100644 --- a/netbox/models/writable_vlan.go +++ b/netbox/models/writable_vlan.go @@ -19,6 +19,10 @@ import ( // swagger:model WritableVLAN type WritableVLAN struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -33,6 +37,10 @@ type WritableVLAN struct { // 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: 64 diff --git a/netbox/models/writable_vrf.go b/netbox/models/writable_vrf.go index d9efce9a80bcca9e064db81bb6fc9b27574df6fd..2b6e9db6d4b7a0d1056962b98669e1c5ebe6be6f 100644 --- a/netbox/models/writable_vrf.go +++ b/netbox/models/writable_vrf.go @@ -17,6 +17,10 @@ import ( // swagger:model WritableVRF type WritableVRF struct { + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + // Custom fields CustomFields interface{} `json:"custom_fields,omitempty"` @@ -33,6 +37,10 @@ type WritableVRF struct { // 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 diff --git a/swagger.json b/swagger.json index 1931dab253b440d12acd4d80102425de311bf75e..5cb7eba3afb11273cfc498769fef3db1203d8ea5 100644 --- a/swagger.json +++ b/swagger.json @@ -10,7 +10,7 @@ "license": { "name": "Apache v2 License" }, - "version": "2.2" + "version": "2.3" }, "host": "localhost:8000", "schemes": [ @@ -559,6 +559,13 @@ "required": false, "type": "string" }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "tenant_id", "in": "query", @@ -2972,6 +2979,13 @@ "required": false, "type": "string" }, + { + "name": "virtual_chassis_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "limit", "in": "query", @@ -4294,6 +4308,20 @@ "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", @@ -4355,7 +4383,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Platform" + "$ref": "#/definitions/WritablePlatform" } } ], @@ -4363,7 +4391,7 @@ "201": { "description": "", "schema": { - "$ref": "#/definitions/Platform" + "$ref": "#/definitions/WritablePlatform" } } }, @@ -4399,7 +4427,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Platform" + "$ref": "#/definitions/WritablePlatform" } } ], @@ -4407,7 +4435,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/Platform" + "$ref": "#/definitions/WritablePlatform" } } }, @@ -4424,7 +4452,7 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/Platform" + "$ref": "#/definitions/WritablePlatform" } } ], @@ -4432,7 +4460,7 @@ "200": { "description": "", "schema": { - "$ref": "#/definitions/Platform" + "$ref": "#/definitions/WritablePlatform" } } }, @@ -5579,6 +5607,20 @@ "required": false, "type": "string" }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "user_id", "in": "query", @@ -6554,6 +6596,13 @@ "required": false, "type": "number" }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "region_id", "in": "query", @@ -6778,6 +6827,180 @@ } ] }, + "/dcim/virtual-chassis/": { + "get": { + "operationId": "dcim_virtual-chassis_list", + "description": "", + "parameters": [ + { + "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/VirtualChassis" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_virtual-chassis_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualChassis" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVirtualChassis" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/virtual-chassis/{id}/": { + "get": { + "operationId": "dcim_virtual-chassis_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualChassis" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_virtual-chassis_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualChassis" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVirtualChassis" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_virtual-chassis_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualChassis" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVirtualChassis" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_virtual-chassis_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this virtual chassis.", + "required": true, + "type": "integer" + } + ] + }, "/extras/_choices/": { "get": { "operationId": "extras__choices_list", @@ -8020,18 +8243,18 @@ "type": "string" }, { - "name": "device_id", + "name": "device", "in": "query", "description": "", "required": false, "type": "string" }, { - "name": "device", + "name": "device_id", "in": "query", "description": "", "required": false, - "type": "string" + "type": "number" }, { "name": "virtual_machine_id", @@ -8270,13 +8493,6 @@ "required": false, "type": "string" }, - { - "name": "parent", - "in": "query", - "description": "", - "required": false, - "type": "string" - }, { "name": "within", "in": "query", @@ -8603,18 +8819,70 @@ } ] }, - "/ipam/rirs/": { + "/ipam/prefixes/{id}/available-prefixes/": { "get": { - "operationId": "ipam_rirs_list", - "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/Prefix" + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_prefixes_available-prefixes_create", + "description": "A convenience method for returning available child prefixes within a parent.", "parameters": [ { - "name": "name", - "in": "query", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Prefix" + } + } + ], + "responses": { + "201": { "description": "", - "required": false, - "type": "string" - }, + "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": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, { "name": "slug", "in": "query", @@ -12151,6 +12419,43 @@ } } }, + "InterfaceVLAN": { + "title": "Untagged 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 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + } + } + }, "Interface": { "title": "Interface", "required": [ @@ -12158,7 +12463,10 @@ "name", "form_factor", "lag", - "circuit_termination" + "circuit_termination", + "mode", + "untagged_vlan", + "tagged_vlans" ], "type": "object", "properties": { @@ -12230,6 +12538,31 @@ }, "circuit_termination": { "$ref": "#/definitions/InterfaceCircuitTermination" + }, + "mode": { + "title": "Mode", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "untagged_vlan": { + "$ref": "#/definitions/InterfaceVLAN" + }, + "tagged_vlans": { + "type": "array", + "items": { + "$ref": "#/definitions/InterfaceVLAN" + } } } }, @@ -12479,6 +12812,7 @@ "cid", "provider", "type", + "status", "tenant" ], "type": "object", @@ -12499,6 +12833,22 @@ "type": { "$ref": "#/definitions/NestedCircuitType" }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, "tenant": { "$ref": "#/definitions/NestedTenant" }, @@ -12525,6 +12875,18 @@ "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 } } }, @@ -12554,6 +12916,18 @@ "title": "Type", "type": "integer" }, + "status": { + "title": "Status", + "type": "integer", + "enum": [ + 2, + 3, + 1, + 4, + 0, + 5 + ] + }, "tenant": { "title": "Tenant", "type": "integer" @@ -12581,6 +12955,18 @@ "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 } } }, @@ -12640,6 +13026,18 @@ "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 } } }, @@ -12699,6 +13097,18 @@ "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 } } }, @@ -12756,7 +13166,11 @@ }, "connection_status": { "title": "Connection status", - "type": "boolean" + "type": "boolean", + "enum": [ + false, + true + ] } } }, @@ -12902,7 +13316,11 @@ }, "connection_status": { "title": "Connection status", - "type": "boolean" + "type": "boolean", + "enum": [ + false, + true + ] } } }, @@ -13461,6 +13879,29 @@ } } }, + "DeviceVirtualChassis": { + "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" + } + } + }, "Device": { "required": [ "device_type", @@ -13475,7 +13916,9 @@ "primary_ip", "primary_ip4", "primary_ip6", - "cluster" + "cluster", + "virtual_chassis", + "vc_position" ], "type": "object", "properties": { @@ -13580,6 +14023,21 @@ "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" @@ -13587,6 +14045,18 @@ "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 } } }, @@ -13682,6 +14152,22 @@ "title": "Cluster", "type": "integer" }, + "virtual_chassis": { + "title": "Virtual chassis", + "type": "integer" + }, + "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" @@ -13689,6 +14175,18 @@ "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 } } }, @@ -13826,7 +14324,11 @@ }, "connection_status": { "title": "Status", - "type": "boolean" + "type": "boolean", + "enum": [ + false, + true + ] } } }, @@ -14038,6 +14540,27 @@ "title": "Description", "type": "string", "maxLength": 100 + }, + "mode": { + "title": "Mode", + "type": "integer", + "enum": [ + 100, + 200, + 300 + ] + }, + "untagged_vlan": { + "title": "Untagged VLAN", + "type": "integer" + }, + "tagged_vlans": { + "type": "array", + "items": { + "title": "Tagged VLANs", + "type": "integer" + }, + "uniqueItems": true } } }, @@ -14182,7 +14705,8 @@ "Platform": { "required": [ "name", - "slug" + "slug", + "manufacturer" ], "type": "object", "properties": { @@ -14203,9 +14727,12 @@ "pattern": "^[-a-zA-Z0-9_]+$", "maxLength": 50 }, + "manufacturer": { + "$ref": "#/definitions/NestedManufacturer" + }, "napalm_driver": { "title": "NAPALM driver", - "description": "The name of the NAPALM driver to use when interacting with devices.", + "description": "The name of the NAPALM driver to use when interacting with devices", "type": "string", "maxLength": 50 }, @@ -14220,7 +14747,53 @@ } } }, - "PowerOutlet": { + "WritablePlatform": { + "required": [ + "name", + "slug" + ], + "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 + }, + "manufacturer": { + "title": "Manufacturer", + "description": "Optionally limit this platform to devices of a certain manufacturer", + "type": "integer" + }, + "napalm_driver": { + "title": "NAPALM driver", + "description": "The name of the NAPALM driver to use when interacting with devices", + "type": "string", + "maxLength": 50 + }, + "rpc_client": { + "title": "Legacy RPC client", + "type": "string", + "enum": [ + "juniper-junos", + "cisco-ios", + "opengear" + ] + } + } + }, + "PowerOutlet": { "title": "Power outlet", "required": [ "device", @@ -14274,7 +14847,11 @@ }, "connection_status": { "title": "Connection status", - "type": "boolean" + "type": "boolean", + "enum": [ + false, + true + ] } } }, @@ -14418,7 +14995,11 @@ }, "connection_status": { "title": "Connection status", - "type": "boolean" + "type": "boolean", + "enum": [ + false, + true + ] } } }, @@ -14483,11 +15064,33 @@ } } }, + "NestedUser": { + "title": "User", + "required": [ + "username" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "username": { + "title": "Username", + "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.", + "type": "string", + "pattern": "^[\\w.@+-]+$", + "maxLength": 150 + } + } + }, "RackReservation": { "required": [ "rack", "units", "user", + "tenant", "description" ], "type": "object", @@ -14516,8 +15119,10 @@ "readOnly": true }, "user": { - "title": "User", - "type": "integer" + "$ref": "#/definitions/NestedUser" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" }, "description": { "title": "Description", @@ -14763,6 +15368,18 @@ "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 } } }, @@ -14847,6 +15464,18 @@ "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 } } }, @@ -14947,6 +15576,7 @@ "required": [ "name", "slug", + "status", "region", "tenant" ], @@ -14969,6 +15599,22 @@ "pattern": "^[-a-zA-Z0-9_]+$", "maxLength": 50 }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, "region": { "$ref": "#/definitions/NestedRegion" }, @@ -14986,6 +15632,15 @@ "maximum": 4294967295, "minimum": 1 }, + "time_zone": { + "title": "Time zone", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, "physical_address": { "title": "Physical address", "type": "string", @@ -15020,6 +15675,18 @@ "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 + }, "count_prefixes": { "title": "Count prefixes", "type": "string", @@ -15071,6 +15738,15 @@ "pattern": "^[-a-zA-Z0-9_]+$", "maxLength": 50 }, + "status": { + "title": "Status", + "type": "integer", + "enum": [ + 1, + 2, + 4 + ] + }, "region": { "title": "Region", "type": "integer" @@ -15090,6 +15766,15 @@ "maximum": 4294967295, "minimum": 1 }, + "time_zone": { + "title": "Time zone", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, "physical_address": { "title": "Physical address", "type": "string", @@ -15123,6 +15808,61 @@ "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 + } + } + }, + "VirtualChassis": { + "required": [ + "master" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "master": { + "$ref": "#/definitions/NestedDevice" + }, + "domain": { + "title": "Domain", + "type": "string", + "maxLength": 30 + } + } + }, + "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 } } }, @@ -15353,27 +16093,6 @@ } } }, - "NestedUser": { - "title": "User", - "required": [ - "username" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "username": { - "title": "Username", - "description": "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.", - "type": "string", - "pattern": "^[\\w.@+-]+$", - "maxLength": 150 - } - } - }, "UserAction": { "required": [ "user", @@ -15573,6 +16292,18 @@ "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 } } }, @@ -15609,6 +16340,18 @@ "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 } } }, @@ -15650,107 +16393,53 @@ ], "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": 64 - } - } - }, - "IPAddressInterface": { - "title": "Interface", - "required": [ - "device", - "virtual_machine", - "name", - "form_factor", - "lag", - "circuit_termination" - ], - "type": "object", - "properties": { - "id": { - "title": "ID", - "type": "integer", - "readOnly": true - }, - "device": { - "$ref": "#/definitions/NestedDevice" - }, - "virtual_machine": { - "$ref": "#/definitions/NestedVirtualMachine" - }, - "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" - }, - "mtu": { - "title": "MTU", - "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" + "id": { + "title": "ID", + "type": "integer", + "readOnly": true }, - "description": { - "title": "Description", + "url": { + "title": "Url", "type": "string", - "maxLength": 100 + "format": "uri", + "readOnly": true }, - "is_connected": { - "title": "Is connected", + "name": { + "title": "Name", "type": "string", + "maxLength": 64 + } + } + }, + "IPAddressInterface": { + "title": "Interface", + "required": [ + "device", + "virtual_machine", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", "readOnly": true }, - "interface_connection": { - "title": "Interface connection", + "url": { + "title": "Url", "type": "string", "readOnly": true }, - "circuit_termination": { - "$ref": "#/definitions/InterfaceCircuitTermination" + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "virtual_machine": { + "$ref": "#/definitions/NestedVirtualMachine" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 } } }, @@ -15867,6 +16556,18 @@ "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 } } }, @@ -15937,6 +16638,18 @@ "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 } } }, @@ -16081,6 +16794,18 @@ "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 } } }, @@ -16145,6 +16870,18 @@ "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 } } }, @@ -16270,6 +17007,18 @@ "title": "Description", "type": "string", "maxLength": 100 + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true } } }, @@ -16325,6 +17074,18 @@ "title": "Description", "type": "string", "maxLength": 100 + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true } } }, @@ -16490,6 +17251,18 @@ "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 } } }, @@ -16549,6 +17322,18 @@ "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 } } }, @@ -16596,6 +17381,18 @@ "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 } } }, @@ -16638,6 +17435,18 @@ "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 } } }, @@ -16777,6 +17586,23 @@ "plaintext": { "title": "Plaintext", "type": "string" + }, + "hash": { + "title": "Hash", + "type": "string", + "readOnly": true + }, + "created": { + "title": "Created", + "type": "string", + "format": "date", + "readOnly": true + }, + "last_updated": { + "title": "Last updated", + "type": "string", + "format": "date-time", + "readOnly": true } } }, @@ -16880,6 +17706,18 @@ "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 } } }, @@ -16924,6 +17762,18 @@ "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 } } }, @@ -17080,6 +17930,18 @@ "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 } } }, @@ -17119,6 +17981,18 @@ "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 } } }, @@ -17238,6 +18112,18 @@ "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 } } }, @@ -17316,6 +18202,18 @@ "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 } } }