diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..9b8ed84ebbd0c797dcac8e01872a7f889e8612a8 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ + +generate: + swagger generate client --target=./netbox --spec=./swagger.json \ No newline at end of file diff --git a/netbox/client.go b/netbox/client.go deleted file mode 100644 index 11dcf8a347ec434d4b2da5ad42b88165d862dec9..0000000000000000000000000000000000000000 --- a/netbox/client.go +++ /dev/null @@ -1,222 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "bytes" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "strings" -) - -// A Client is a NetBox client. It can be used to retrieve network and -// datacenter infrastructure information from a NetBox server. -type Client struct { - // DCIM provides access to methods in NetBox's DCIM API. - DCIM *DCIMService - - // IPAM provides access to methods in NetBox's IPAM API. - IPAM *IPAMService - - // Tenancy provides access to methods in NetBox's Tenancy API. - Tenancy *TenancyService - - token string - u *url.URL - client *http.Client -} - -// NewClient returns a new instance of a NetBox client. addr specifies the address -// of the NetBox server, token specifies the api key to use, -// and client specifies an optional HTTP client to use for requests. -// -// If token is the empty string, no Authentication will be included in requests, -// providing anonymous read-only access depending on your NetBox config. -// -// If client is nil, a default HTTP client will be used. -func NewClient(addr string, token string, client *http.Client) (*Client, error) { - if client == nil { - client = &http.Client{} - } - - // Append trailing slash there is none. This is necessary - // to be able to concat url parts in a correct manner. - // See NewRequest - if !strings.HasSuffix(addr, "/") { - addr = addr + "/" - } - - u, err := url.Parse(addr) - if err != nil { - return nil, err - } - - c := &Client{ - token: token, - u: u, - client: client, - } - - c.DCIM = NewDCIMService(c) - c.IPAM = NewIPAMService(c) - c.Tenancy = NewTenancyService(c) - - return c, nil -} - -// NewRequest creates a HTTP request using the input HTTP method, URL -// endpoint, and a Valuer which creates URL parameters for the request. -// -// If a nil Valuer is specified, no query parameters will be sent with the -// request. -func (c *Client) NewRequest(method string, endpoint string, options Valuer) (*http.Request, error) { - return c.NewDataRequest(method, endpoint, options, nil) -} - -// NewDataRequest creates a HTTP request using the input HTTP method, URL -// endpoint, a Valuer which creates URL parameters for the request, and -// a io.Reader as the body of the request. -// -// If a nil Valuer is specified, no query parameters will be sent with the -// request. -// -// If a nil io.Reader is specified, no body will be sent with the request. -func (c *Client) NewDataRequest(method string, endpoint string, options Valuer, body io.Reader) (*http.Request, error) { - // Allow specifying a base path for API requests, so if a NetBox server - // resides at a path like http://example.com/netbox/, API requests will - // be sent to http://example.com/netbox/api/... - // - // Enables support of: https://github.com/digitalocean/netbox/issues/212. - // - // Remove leading slash if there is one. This is necessary to be able to - // concat url parts in a correct manner. We can not use path.Join here, - // because this always trims the trailing slash, which causes the - // Do function to always run into 301 and then retry the correct - // Location. With GET, it does work with one useless request, but it breaks - // each other http method. - // Doing this, because out-of-tree extensions are more robust. If someone - // implements an own API-call, we do not override parts of c.u, even if - // the caller uses "/api/...". - rel, err := url.Parse(strings.TrimLeft(endpoint, "/")) - if err != nil { - return nil, err - } - - u := c.u.ResolveReference(rel) - - // If a valuer is specified, add the values as the query string - if options != nil { - values, err := options.Values() - if err != nil { - return nil, err - } - u.RawQuery = values.Encode() - } - - req, err := http.NewRequest(method, u.String(), body) - if err != nil { - return nil, err - } - if c.token != "" { - req.Header.Set("Authorization", fmt.Sprintf("Token %s", c.token)) - } - return req, nil -} - -// NewJSONRequest creates a HTTP request using the input HTTP method, URL -// endpoint, a Valuer which creates URL parameters for the request, and -// an io.Reader as the body of the request. -// -// If a nil Valuer is specified, no query parameters will be sent with the -// request. -// -// The body parameter is marshaled to JSON and sent as a HTTP request body. -// Body must not be nil. -func (c *Client) NewJSONRequest(method string, endpoint string, options Valuer, body interface{}) (*http.Request, error) { - if body == nil { - return nil, errors.New("expected body to be not nil") - } - - b := new(bytes.Buffer) - err := json.NewEncoder(b).Encode(body) - if err != nil { - return nil, err - } - - req, err := c.NewDataRequest( - method, - endpoint, - options, - b, - ) - if err != nil { - return nil, err - } - - req.Header.Set("Content-Type", "application/json; charset=utf-8") - return req, nil -} - -// Do executes an HTTP request and if v is not nil, Do unmarshals result -// JSON onto v. -func (c *Client) Do(req *http.Request, v interface{}) error { - res, err := c.client.Do(req) - if err != nil { - return err - } - defer func() { - _ = res.Body.Close() - }() - // Test if the request was successful. - // If not, do not try to decode the body. This would result in - // misleading error messages - err = httpStatusOK(res) - if err != nil { - return err - } - - if v == nil { - return nil - } - - return json.NewDecoder(res.Body).Decode(v) -} - -// httpStatusOK tests if the StatusCode of res is smaller than 300. Tries to -// Unmarshal the response into json, and returns only the detail -// if this exists. Otherwise returns the status code with the raw Body data. -func httpStatusOK(res *http.Response) error { - if res.StatusCode >= http.StatusMultipleChoices { - errDetail := struct { - Detail string `json:"detail"` - }{} - bodyData, err := ioutil.ReadAll(res.Body) - if err != nil { - return fmt.Errorf("%d - %v", res.StatusCode, err) - } - err = json.Unmarshal(bodyData, &errDetail) - if err == nil && errDetail.Detail != "" { - return fmt.Errorf("%d - %s", res.StatusCode, errDetail.Detail) - } - - return fmt.Errorf("%d - %s", res.StatusCode, bodyData) - } - return nil -} diff --git a/netbox/client/circuits/circuits_choices_list_parameters.go b/netbox/client/circuits/circuits_choices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..775bca36758e181b2bbd1b6403b445e29bf7ab7f --- /dev/null +++ b/netbox/client/circuits/circuits_choices_list_parameters.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsChoicesListParams creates a new CircuitsChoicesListParams object +// with the default values initialized. +func NewCircuitsChoicesListParams() *CircuitsChoicesListParams { + + return &CircuitsChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsChoicesListParamsWithTimeout creates a new CircuitsChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsChoicesListParamsWithTimeout(timeout time.Duration) *CircuitsChoicesListParams { + + return &CircuitsChoicesListParams{ + + timeout: timeout, + } +} + +// NewCircuitsChoicesListParamsWithContext creates a new CircuitsChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsChoicesListParamsWithContext(ctx context.Context) *CircuitsChoicesListParams { + + return &CircuitsChoicesListParams{ + + Context: ctx, + } +} + +// NewCircuitsChoicesListParamsWithHTTPClient creates a new CircuitsChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsChoicesListParamsWithHTTPClient(client *http.Client) *CircuitsChoicesListParams { + + return &CircuitsChoicesListParams{ + HTTPClient: client, + } +} + +/*CircuitsChoicesListParams contains all the parameters to send to the API endpoint +for the circuits choices list operation typically these are written to a http.Request +*/ +type CircuitsChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits choices list params +func (o *CircuitsChoicesListParams) WithTimeout(timeout time.Duration) *CircuitsChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits choices list params +func (o *CircuitsChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits choices list params +func (o *CircuitsChoicesListParams) WithContext(ctx context.Context) *CircuitsChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits choices list params +func (o *CircuitsChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits choices list params +func (o *CircuitsChoicesListParams) WithHTTPClient(client *http.Client) *CircuitsChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits choices list params +func (o *CircuitsChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsChoicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/circuits/circuits_choices_list_responses.go b/netbox/client/circuits/circuits_choices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2929f8535d08ef42d68723604f66a684b37d986d --- /dev/null +++ b/netbox/client/circuits/circuits_choices_list_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsChoicesListReader is a Reader for the CircuitsChoicesList structure. +type CircuitsChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsChoicesListOK() + 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()) + } +} + +// NewCircuitsChoicesListOK creates a CircuitsChoicesListOK with default headers values +func NewCircuitsChoicesListOK() *CircuitsChoicesListOK { + return &CircuitsChoicesListOK{} +} + +/*CircuitsChoicesListOK handles this case with default header values. + +CircuitsChoicesListOK circuits choices list o k +*/ +type CircuitsChoicesListOK struct { +} + +func (o *CircuitsChoicesListOK) Error() string { + return fmt.Sprintf("[GET /circuits/_choices/][%d] circuitsChoicesListOK ", 200) +} + +func (o *CircuitsChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/circuits/circuits_choices_read_parameters.go b/netbox/client/circuits/circuits_choices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b9e2f7d53ab88b58a85c2d29010085eb7cf21fba --- /dev/null +++ b/netbox/client/circuits/circuits_choices_read_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsChoicesReadParams creates a new CircuitsChoicesReadParams object +// with the default values initialized. +func NewCircuitsChoicesReadParams() *CircuitsChoicesReadParams { + var () + return &CircuitsChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsChoicesReadParamsWithTimeout creates a new CircuitsChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsChoicesReadParamsWithTimeout(timeout time.Duration) *CircuitsChoicesReadParams { + var () + return &CircuitsChoicesReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsChoicesReadParamsWithContext creates a new CircuitsChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsChoicesReadParamsWithContext(ctx context.Context) *CircuitsChoicesReadParams { + var () + return &CircuitsChoicesReadParams{ + + Context: ctx, + } +} + +// NewCircuitsChoicesReadParamsWithHTTPClient creates a new CircuitsChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsChoicesReadParamsWithHTTPClient(client *http.Client) *CircuitsChoicesReadParams { + var () + return &CircuitsChoicesReadParams{ + HTTPClient: client, + } +} + +/*CircuitsChoicesReadParams contains all the parameters to send to the API endpoint +for the circuits choices read operation typically these are written to a http.Request +*/ +type CircuitsChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits choices read params +func (o *CircuitsChoicesReadParams) WithTimeout(timeout time.Duration) *CircuitsChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits choices read params +func (o *CircuitsChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits choices read params +func (o *CircuitsChoicesReadParams) WithContext(ctx context.Context) *CircuitsChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits choices read params +func (o *CircuitsChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits choices read params +func (o *CircuitsChoicesReadParams) WithHTTPClient(client *http.Client) *CircuitsChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits choices read params +func (o *CircuitsChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits choices read params +func (o *CircuitsChoicesReadParams) WithID(id string) *CircuitsChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits choices read params +func (o *CircuitsChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsChoicesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/circuits/circuits_choices_read_responses.go b/netbox/client/circuits/circuits_choices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3dfddbc41361505dbacf3fd278dd99c0aa42ad3a --- /dev/null +++ b/netbox/client/circuits/circuits_choices_read_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsChoicesReadReader is a Reader for the CircuitsChoicesRead structure. +type CircuitsChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsChoicesReadOK() + 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()) + } +} + +// NewCircuitsChoicesReadOK creates a CircuitsChoicesReadOK with default headers values +func NewCircuitsChoicesReadOK() *CircuitsChoicesReadOK { + return &CircuitsChoicesReadOK{} +} + +/*CircuitsChoicesReadOK handles this case with default header values. + +CircuitsChoicesReadOK circuits choices read o k +*/ +type CircuitsChoicesReadOK struct { +} + +func (o *CircuitsChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/_choices/{id}/][%d] circuitsChoicesReadOK ", 200) +} + +func (o *CircuitsChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7f8b5306f637f31fea6ce7fe4e5445c7480d87bd --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTerminationsCreateParams creates a new CircuitsCircuitTerminationsCreateParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsCreateParams() *CircuitsCircuitTerminationsCreateParams { + var () + return &CircuitsCircuitTerminationsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsCreateParamsWithTimeout creates a new CircuitsCircuitTerminationsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsCreateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsCreateParams { + var () + return &CircuitsCircuitTerminationsCreateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsCreateParamsWithContext creates a new CircuitsCircuitTerminationsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsCreateParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsCreateParams { + var () + return &CircuitsCircuitTerminationsCreateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsCreateParamsWithHTTPClient creates a new CircuitsCircuitTerminationsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsCreateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsCreateParams { + var () + return &CircuitsCircuitTerminationsCreateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsCreateParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations create operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsCreateParams struct { + + /*Data*/ + Data *models.WritableCircuitTermination + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) WithData(data *models.WritableCircuitTermination) *CircuitsCircuitTerminationsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit terminations create params +func (o *CircuitsCircuitTerminationsCreateParams) SetData(data *models.WritableCircuitTermination) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsCreateParams) 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/circuits/circuits_circuit_terminations_create_responses.go b/netbox/client/circuits/circuits_circuit_terminations_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cd1ee763f270ecd7b44b0370956ea3839db0cb17 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTerminationsCreateReader is a Reader for the CircuitsCircuitTerminationsCreate structure. +type CircuitsCircuitTerminationsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewCircuitsCircuitTerminationsCreateCreated() + 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()) + } +} + +// NewCircuitsCircuitTerminationsCreateCreated creates a CircuitsCircuitTerminationsCreateCreated with default headers values +func NewCircuitsCircuitTerminationsCreateCreated() *CircuitsCircuitTerminationsCreateCreated { + return &CircuitsCircuitTerminationsCreateCreated{} +} + +/*CircuitsCircuitTerminationsCreateCreated handles this case with default header values. + +CircuitsCircuitTerminationsCreateCreated circuits circuit terminations create created +*/ +type CircuitsCircuitTerminationsCreateCreated struct { + Payload *models.WritableCircuitTermination +} + +func (o *CircuitsCircuitTerminationsCreateCreated) Error() string { + return fmt.Sprintf("[POST /circuits/circuit-terminations/][%d] circuitsCircuitTerminationsCreateCreated %+v", 201, o.Payload) +} + +func (o *CircuitsCircuitTerminationsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuitTermination) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2c2cc5bac390036fae181465f9c98ceffb322aed --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTerminationsDeleteParams creates a new CircuitsCircuitTerminationsDeleteParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsDeleteParams() *CircuitsCircuitTerminationsDeleteParams { + var () + return &CircuitsCircuitTerminationsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsDeleteParamsWithTimeout creates a new CircuitsCircuitTerminationsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsDeleteParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsDeleteParams { + var () + return &CircuitsCircuitTerminationsDeleteParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsDeleteParamsWithContext creates a new CircuitsCircuitTerminationsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsDeleteParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsDeleteParams { + var () + return &CircuitsCircuitTerminationsDeleteParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsDeleteParamsWithHTTPClient creates a new CircuitsCircuitTerminationsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsDeleteParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsDeleteParams { + var () + return &CircuitsCircuitTerminationsDeleteParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsDeleteParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations delete operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsDeleteParams struct { + + /*ID + A unique integer value identifying this circuit termination. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) WithID(id int64) *CircuitsCircuitTerminationsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit terminations delete params +func (o *CircuitsCircuitTerminationsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsDeleteParams) 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/circuits/circuits_circuit_terminations_delete_responses.go b/netbox/client/circuits/circuits_circuit_terminations_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b34dd79554a4abe2d70e17fc3457fd7fbe3c054c --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTerminationsDeleteReader is a Reader for the CircuitsCircuitTerminationsDelete structure. +type CircuitsCircuitTerminationsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewCircuitsCircuitTerminationsDeleteNoContent() + 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()) + } +} + +// NewCircuitsCircuitTerminationsDeleteNoContent creates a CircuitsCircuitTerminationsDeleteNoContent with default headers values +func NewCircuitsCircuitTerminationsDeleteNoContent() *CircuitsCircuitTerminationsDeleteNoContent { + return &CircuitsCircuitTerminationsDeleteNoContent{} +} + +/*CircuitsCircuitTerminationsDeleteNoContent handles this case with default header values. + +CircuitsCircuitTerminationsDeleteNoContent circuits circuit terminations delete no content +*/ +type CircuitsCircuitTerminationsDeleteNoContent struct { +} + +func (o *CircuitsCircuitTerminationsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /circuits/circuit-terminations/{id}/][%d] circuitsCircuitTerminationsDeleteNoContent ", 204) +} + +func (o *CircuitsCircuitTerminationsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1cc0ff07e7213ebc6db182f17274caa0ada0c780 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_list_parameters.go @@ -0,0 +1,413 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTerminationsListParams creates a new CircuitsCircuitTerminationsListParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsListParams() *CircuitsCircuitTerminationsListParams { + var () + return &CircuitsCircuitTerminationsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsListParamsWithTimeout creates a new CircuitsCircuitTerminationsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsListParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsListParams { + var () + return &CircuitsCircuitTerminationsListParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsListParamsWithContext creates a new CircuitsCircuitTerminationsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsListParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsListParams { + var () + return &CircuitsCircuitTerminationsListParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsListParamsWithHTTPClient creates a new CircuitsCircuitTerminationsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsListParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsListParams { + var () + return &CircuitsCircuitTerminationsListParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsListParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations list operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsListParams struct { + + /*CircuitID*/ + CircuitID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*PortSpeed*/ + PortSpeed *float64 + /*Q*/ + Q *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*TermSide*/ + TermSide *string + /*UpstreamSpeed*/ + UpstreamSpeed *float64 + /*XconnectID*/ + XconnectID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCircuitID adds the circuitID to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithCircuitID(circuitID *string) *CircuitsCircuitTerminationsListParams { + o.SetCircuitID(circuitID) + return o +} + +// SetCircuitID adds the circuitId to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetCircuitID(circuitID *string) { + o.CircuitID = circuitID +} + +// WithLimit adds the limit to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithLimit(limit *int64) *CircuitsCircuitTerminationsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithOffset(offset *int64) *CircuitsCircuitTerminationsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPortSpeed adds the portSpeed to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithPortSpeed(portSpeed *float64) *CircuitsCircuitTerminationsListParams { + o.SetPortSpeed(portSpeed) + return o +} + +// SetPortSpeed adds the portSpeed to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetPortSpeed(portSpeed *float64) { + o.PortSpeed = portSpeed +} + +// WithQ adds the q to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithQ(q *string) *CircuitsCircuitTerminationsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSite adds the site to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithSite(site *string) *CircuitsCircuitTerminationsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithSiteID(siteID *string) *CircuitsCircuitTerminationsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithTermSide adds the termSide to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithTermSide(termSide *string) *CircuitsCircuitTerminationsListParams { + o.SetTermSide(termSide) + return o +} + +// SetTermSide adds the termSide to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetTermSide(termSide *string) { + o.TermSide = termSide +} + +// WithUpstreamSpeed adds the upstreamSpeed to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithUpstreamSpeed(upstreamSpeed *float64) *CircuitsCircuitTerminationsListParams { + o.SetUpstreamSpeed(upstreamSpeed) + return o +} + +// SetUpstreamSpeed adds the upstreamSpeed to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetUpstreamSpeed(upstreamSpeed *float64) { + o.UpstreamSpeed = upstreamSpeed +} + +// WithXconnectID adds the xconnectID to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) WithXconnectID(xconnectID *string) *CircuitsCircuitTerminationsListParams { + o.SetXconnectID(xconnectID) + return o +} + +// SetXconnectID adds the xconnectId to the circuits circuit terminations list params +func (o *CircuitsCircuitTerminationsListParams) SetXconnectID(xconnectID *string) { + o.XconnectID = xconnectID +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.CircuitID != nil { + + // query param circuit_id + var qrCircuitID string + if o.CircuitID != nil { + qrCircuitID = *o.CircuitID + } + qCircuitID := qrCircuitID + if qCircuitID != "" { + if err := r.SetQueryParam("circuit_id", qCircuitID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.PortSpeed != nil { + + // query param port_speed + var qrPortSpeed float64 + if o.PortSpeed != nil { + qrPortSpeed = *o.PortSpeed + } + qPortSpeed := swag.FormatFloat64(qrPortSpeed) + if qPortSpeed != "" { + if err := r.SetQueryParam("port_speed", qPortSpeed); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.TermSide != nil { + + // query param term_side + var qrTermSide string + if o.TermSide != nil { + qrTermSide = *o.TermSide + } + qTermSide := qrTermSide + if qTermSide != "" { + if err := r.SetQueryParam("term_side", qTermSide); err != nil { + return err + } + } + + } + + if o.UpstreamSpeed != nil { + + // query param upstream_speed + var qrUpstreamSpeed float64 + if o.UpstreamSpeed != nil { + qrUpstreamSpeed = *o.UpstreamSpeed + } + qUpstreamSpeed := swag.FormatFloat64(qrUpstreamSpeed) + if qUpstreamSpeed != "" { + if err := r.SetQueryParam("upstream_speed", qUpstreamSpeed); err != nil { + return err + } + } + + } + + if o.XconnectID != nil { + + // query param xconnect_id + var qrXconnectID string + if o.XconnectID != nil { + qrXconnectID = *o.XconnectID + } + qXconnectID := qrXconnectID + if qXconnectID != "" { + if err := r.SetQueryParam("xconnect_id", qXconnectID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_terminations_list_responses.go b/netbox/client/circuits/circuits_circuit_terminations_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..80b33eae3896536d03a58e9afb15c0b9efa17f96 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTerminationsListReader is a Reader for the CircuitsCircuitTerminationsList structure. +type CircuitsCircuitTerminationsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTerminationsListOK() + 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()) + } +} + +// NewCircuitsCircuitTerminationsListOK creates a CircuitsCircuitTerminationsListOK with default headers values +func NewCircuitsCircuitTerminationsListOK() *CircuitsCircuitTerminationsListOK { + return &CircuitsCircuitTerminationsListOK{} +} + +/*CircuitsCircuitTerminationsListOK handles this case with default header values. + +CircuitsCircuitTerminationsListOK circuits circuit terminations list o k +*/ +type CircuitsCircuitTerminationsListOK struct { + Payload *models.CircuitsCircuitTerminationsListOKBody +} + +func (o *CircuitsCircuitTerminationsListOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuit-terminations/][%d] circuitsCircuitTerminationsListOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTerminationsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitsCircuitTerminationsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6258f143cbe91fa8ed45fc4c8691182af7dc07f9 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTerminationsPartialUpdateParams creates a new CircuitsCircuitTerminationsPartialUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsPartialUpdateParams() *CircuitsCircuitTerminationsPartialUpdateParams { + var () + return &CircuitsCircuitTerminationsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsPartialUpdateParamsWithTimeout creates a new CircuitsCircuitTerminationsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsPartialUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsPartialUpdateParams { + var () + return &CircuitsCircuitTerminationsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsPartialUpdateParamsWithContext creates a new CircuitsCircuitTerminationsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsPartialUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsPartialUpdateParams { + var () + return &CircuitsCircuitTerminationsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsPartialUpdateParamsWithHTTPClient creates a new CircuitsCircuitTerminationsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsPartialUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsPartialUpdateParams { + var () + return &CircuitsCircuitTerminationsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsPartialUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations partial update operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableCircuitTermination + /*ID + A unique integer value identifying this circuit termination. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithData(data *models.WritableCircuitTermination) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetData(data *models.WritableCircuitTermination) { + o.Data = data +} + +// WithID adds the id to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) WithID(id int64) *CircuitsCircuitTerminationsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit terminations partial update params +func (o *CircuitsCircuitTerminationsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsPartialUpdateParams) 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/circuits/circuits_circuit_terminations_partial_update_responses.go b/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3bd9c6e8cb8e98287c54d47385e7109ac74de93e --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTerminationsPartialUpdateReader is a Reader for the CircuitsCircuitTerminationsPartialUpdate structure. +type CircuitsCircuitTerminationsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTerminationsPartialUpdateOK() + 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()) + } +} + +// NewCircuitsCircuitTerminationsPartialUpdateOK creates a CircuitsCircuitTerminationsPartialUpdateOK with default headers values +func NewCircuitsCircuitTerminationsPartialUpdateOK() *CircuitsCircuitTerminationsPartialUpdateOK { + return &CircuitsCircuitTerminationsPartialUpdateOK{} +} + +/*CircuitsCircuitTerminationsPartialUpdateOK handles this case with default header values. + +CircuitsCircuitTerminationsPartialUpdateOK circuits circuit terminations partial update o k +*/ +type CircuitsCircuitTerminationsPartialUpdateOK struct { + Payload *models.WritableCircuitTermination +} + +func (o *CircuitsCircuitTerminationsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /circuits/circuit-terminations/{id}/][%d] circuitsCircuitTerminationsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTerminationsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuitTermination) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..529532881ac2b4da04692464edb0c3d9010a88ae --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTerminationsReadParams creates a new CircuitsCircuitTerminationsReadParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsReadParams() *CircuitsCircuitTerminationsReadParams { + var () + return &CircuitsCircuitTerminationsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsReadParamsWithTimeout creates a new CircuitsCircuitTerminationsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsReadParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsReadParams { + var () + return &CircuitsCircuitTerminationsReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsReadParamsWithContext creates a new CircuitsCircuitTerminationsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsReadParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsReadParams { + var () + return &CircuitsCircuitTerminationsReadParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsReadParamsWithHTTPClient creates a new CircuitsCircuitTerminationsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsReadParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsReadParams { + var () + return &CircuitsCircuitTerminationsReadParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsReadParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations read operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsReadParams struct { + + /*ID + A unique integer value identifying this circuit termination. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) WithID(id int64) *CircuitsCircuitTerminationsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit terminations read params +func (o *CircuitsCircuitTerminationsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsReadParams) 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/circuits/circuits_circuit_terminations_read_responses.go b/netbox/client/circuits/circuits_circuit_terminations_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..39fc422b0e6dbbed629c5c9c264702bbecdc4d05 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTerminationsReadReader is a Reader for the CircuitsCircuitTerminationsRead structure. +type CircuitsCircuitTerminationsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTerminationsReadOK() + 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()) + } +} + +// NewCircuitsCircuitTerminationsReadOK creates a CircuitsCircuitTerminationsReadOK with default headers values +func NewCircuitsCircuitTerminationsReadOK() *CircuitsCircuitTerminationsReadOK { + return &CircuitsCircuitTerminationsReadOK{} +} + +/*CircuitsCircuitTerminationsReadOK handles this case with default header values. + +CircuitsCircuitTerminationsReadOK circuits circuit terminations read o k +*/ +type CircuitsCircuitTerminationsReadOK struct { + Payload *models.CircuitTermination +} + +func (o *CircuitsCircuitTerminationsReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuit-terminations/{id}/][%d] circuitsCircuitTerminationsReadOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTerminationsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitTermination) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go b/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..40314b623194ff4b40761311e6506b82a745e3e7 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTerminationsUpdateParams creates a new CircuitsCircuitTerminationsUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitTerminationsUpdateParams() *CircuitsCircuitTerminationsUpdateParams { + var () + return &CircuitsCircuitTerminationsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTerminationsUpdateParamsWithTimeout creates a new CircuitsCircuitTerminationsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTerminationsUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsUpdateParams { + var () + return &CircuitsCircuitTerminationsUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTerminationsUpdateParamsWithContext creates a new CircuitsCircuitTerminationsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTerminationsUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitTerminationsUpdateParams { + var () + return &CircuitsCircuitTerminationsUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTerminationsUpdateParamsWithHTTPClient creates a new CircuitsCircuitTerminationsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTerminationsUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsUpdateParams { + var () + return &CircuitsCircuitTerminationsUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTerminationsUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuit terminations update operation typically these are written to a http.Request +*/ +type CircuitsCircuitTerminationsUpdateParams struct { + + /*Data*/ + Data *models.WritableCircuitTermination + /*ID + A unique integer value identifying this circuit termination. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTerminationsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitTerminationsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTerminationsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithData(data *models.WritableCircuitTermination) *CircuitsCircuitTerminationsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetData(data *models.WritableCircuitTermination) { + o.Data = data +} + +// WithID adds the id to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) WithID(id int64) *CircuitsCircuitTerminationsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit terminations update params +func (o *CircuitsCircuitTerminationsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTerminationsUpdateParams) 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/circuits/circuits_circuit_terminations_update_responses.go b/netbox/client/circuits/circuits_circuit_terminations_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4a542b5dabfabb708b59450043df9b9bab4ebe63 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_terminations_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTerminationsUpdateReader is a Reader for the CircuitsCircuitTerminationsUpdate structure. +type CircuitsCircuitTerminationsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTerminationsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTerminationsUpdateOK() + 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()) + } +} + +// NewCircuitsCircuitTerminationsUpdateOK creates a CircuitsCircuitTerminationsUpdateOK with default headers values +func NewCircuitsCircuitTerminationsUpdateOK() *CircuitsCircuitTerminationsUpdateOK { + return &CircuitsCircuitTerminationsUpdateOK{} +} + +/*CircuitsCircuitTerminationsUpdateOK handles this case with default header values. + +CircuitsCircuitTerminationsUpdateOK circuits circuit terminations update o k +*/ +type CircuitsCircuitTerminationsUpdateOK struct { + Payload *models.WritableCircuitTermination +} + +func (o *CircuitsCircuitTerminationsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /circuits/circuit-terminations/{id}/][%d] circuitsCircuitTerminationsUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTerminationsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuitTermination) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_types_create_parameters.go b/netbox/client/circuits/circuits_circuit_types_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..71bf0f98dcb44a77bb5c9830dd1455e3ab7e401d --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTypesCreateParams creates a new CircuitsCircuitTypesCreateParams object +// with the default values initialized. +func NewCircuitsCircuitTypesCreateParams() *CircuitsCircuitTypesCreateParams { + var () + return &CircuitsCircuitTypesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesCreateParamsWithTimeout creates a new CircuitsCircuitTypesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesCreateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesCreateParams { + var () + return &CircuitsCircuitTypesCreateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesCreateParamsWithContext creates a new CircuitsCircuitTypesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesCreateParamsWithContext(ctx context.Context) *CircuitsCircuitTypesCreateParams { + var () + return &CircuitsCircuitTypesCreateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesCreateParamsWithHTTPClient creates a new CircuitsCircuitTypesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesCreateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesCreateParams { + var () + return &CircuitsCircuitTypesCreateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesCreateParams contains all the parameters to send to the API endpoint +for the circuits circuit types create operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesCreateParams struct { + + /*Data*/ + Data *models.CircuitType + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) WithContext(ctx context.Context) *CircuitsCircuitTypesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) WithData(data *models.CircuitType) *CircuitsCircuitTypesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit types create params +func (o *CircuitsCircuitTypesCreateParams) SetData(data *models.CircuitType) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesCreateParams) 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/circuits/circuits_circuit_types_create_responses.go b/netbox/client/circuits/circuits_circuit_types_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..99f77d96862f2f49d0a6b1018f2fda197a4f8f65 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTypesCreateReader is a Reader for the CircuitsCircuitTypesCreate structure. +type CircuitsCircuitTypesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewCircuitsCircuitTypesCreateCreated() + 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()) + } +} + +// NewCircuitsCircuitTypesCreateCreated creates a CircuitsCircuitTypesCreateCreated with default headers values +func NewCircuitsCircuitTypesCreateCreated() *CircuitsCircuitTypesCreateCreated { + return &CircuitsCircuitTypesCreateCreated{} +} + +/*CircuitsCircuitTypesCreateCreated handles this case with default header values. + +CircuitsCircuitTypesCreateCreated circuits circuit types create created +*/ +type CircuitsCircuitTypesCreateCreated struct { + Payload *models.CircuitType +} + +func (o *CircuitsCircuitTypesCreateCreated) Error() string { + return fmt.Sprintf("[POST /circuits/circuit-types/][%d] circuitsCircuitTypesCreateCreated %+v", 201, o.Payload) +} + +func (o *CircuitsCircuitTypesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_types_delete_parameters.go b/netbox/client/circuits/circuits_circuit_types_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..532e0534b571e761cea1e07c83bf949636e8c8fc --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTypesDeleteParams creates a new CircuitsCircuitTypesDeleteParams object +// with the default values initialized. +func NewCircuitsCircuitTypesDeleteParams() *CircuitsCircuitTypesDeleteParams { + var () + return &CircuitsCircuitTypesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesDeleteParamsWithTimeout creates a new CircuitsCircuitTypesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesDeleteParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesDeleteParams { + var () + return &CircuitsCircuitTypesDeleteParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesDeleteParamsWithContext creates a new CircuitsCircuitTypesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesDeleteParamsWithContext(ctx context.Context) *CircuitsCircuitTypesDeleteParams { + var () + return &CircuitsCircuitTypesDeleteParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesDeleteParamsWithHTTPClient creates a new CircuitsCircuitTypesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesDeleteParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesDeleteParams { + var () + return &CircuitsCircuitTypesDeleteParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesDeleteParams contains all the parameters to send to the API endpoint +for the circuits circuit types delete operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesDeleteParams struct { + + /*ID + A unique integer value identifying this circuit type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) WithContext(ctx context.Context) *CircuitsCircuitTypesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) WithID(id int64) *CircuitsCircuitTypesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types delete params +func (o *CircuitsCircuitTypesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesDeleteParams) 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/circuits/circuits_circuit_types_delete_responses.go b/netbox/client/circuits/circuits_circuit_types_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3677836ecce21fbe645fed397bf30bfbf5baf0af --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTypesDeleteReader is a Reader for the CircuitsCircuitTypesDelete structure. +type CircuitsCircuitTypesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewCircuitsCircuitTypesDeleteNoContent() + 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()) + } +} + +// NewCircuitsCircuitTypesDeleteNoContent creates a CircuitsCircuitTypesDeleteNoContent with default headers values +func NewCircuitsCircuitTypesDeleteNoContent() *CircuitsCircuitTypesDeleteNoContent { + return &CircuitsCircuitTypesDeleteNoContent{} +} + +/*CircuitsCircuitTypesDeleteNoContent handles this case with default header values. + +CircuitsCircuitTypesDeleteNoContent circuits circuit types delete no content +*/ +type CircuitsCircuitTypesDeleteNoContent struct { +} + +func (o *CircuitsCircuitTypesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /circuits/circuit-types/{id}/][%d] circuitsCircuitTypesDeleteNoContent ", 204) +} + +func (o *CircuitsCircuitTypesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_types_list_parameters.go b/netbox/client/circuits/circuits_circuit_types_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..667a76439f70019f6631b24618bb700881195c50 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_list_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTypesListParams creates a new CircuitsCircuitTypesListParams object +// with the default values initialized. +func NewCircuitsCircuitTypesListParams() *CircuitsCircuitTypesListParams { + var () + return &CircuitsCircuitTypesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesListParamsWithTimeout creates a new CircuitsCircuitTypesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesListParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesListParams { + var () + return &CircuitsCircuitTypesListParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesListParamsWithContext creates a new CircuitsCircuitTypesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesListParamsWithContext(ctx context.Context) *CircuitsCircuitTypesListParams { + var () + return &CircuitsCircuitTypesListParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesListParamsWithHTTPClient creates a new CircuitsCircuitTypesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesListParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesListParams { + var () + return &CircuitsCircuitTypesListParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesListParams contains all the parameters to send to the API endpoint +for the circuits circuit types list operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithContext(ctx context.Context) *CircuitsCircuitTypesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithLimit(limit *int64) *CircuitsCircuitTypesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithName(name *string) *CircuitsCircuitTypesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithOffset(offset *int64) *CircuitsCircuitTypesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) WithSlug(slug *string) *CircuitsCircuitTypesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the circuits circuit types list params +func (o *CircuitsCircuitTypesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_types_list_responses.go b/netbox/client/circuits/circuits_circuit_types_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..54270bcd39c05ad61f054224728bfb023edbe8c4 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTypesListReader is a Reader for the CircuitsCircuitTypesList structure. +type CircuitsCircuitTypesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTypesListOK() + 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()) + } +} + +// NewCircuitsCircuitTypesListOK creates a CircuitsCircuitTypesListOK with default headers values +func NewCircuitsCircuitTypesListOK() *CircuitsCircuitTypesListOK { + return &CircuitsCircuitTypesListOK{} +} + +/*CircuitsCircuitTypesListOK handles this case with default header values. + +CircuitsCircuitTypesListOK circuits circuit types list o k +*/ +type CircuitsCircuitTypesListOK struct { + Payload *models.CircuitsCircuitTypesListOKBody +} + +func (o *CircuitsCircuitTypesListOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuit-types/][%d] circuitsCircuitTypesListOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitsCircuitTypesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go b/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..641d324afff110bd806a271e962c345d0c620224 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTypesPartialUpdateParams creates a new CircuitsCircuitTypesPartialUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitTypesPartialUpdateParams() *CircuitsCircuitTypesPartialUpdateParams { + var () + return &CircuitsCircuitTypesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesPartialUpdateParamsWithTimeout creates a new CircuitsCircuitTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesPartialUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesPartialUpdateParams { + var () + return &CircuitsCircuitTypesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesPartialUpdateParamsWithContext creates a new CircuitsCircuitTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesPartialUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitTypesPartialUpdateParams { + var () + return &CircuitsCircuitTypesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesPartialUpdateParamsWithHTTPClient creates a new CircuitsCircuitTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesPartialUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesPartialUpdateParams { + var () + return &CircuitsCircuitTypesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesPartialUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuit types partial update operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesPartialUpdateParams struct { + + /*Data*/ + Data *models.CircuitType + /*ID + A unique integer value identifying this circuit type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitTypesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithData(data *models.CircuitType) *CircuitsCircuitTypesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetData(data *models.CircuitType) { + o.Data = data +} + +// WithID adds the id to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) WithID(id int64) *CircuitsCircuitTypesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types partial update params +func (o *CircuitsCircuitTypesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesPartialUpdateParams) 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/circuits/circuits_circuit_types_partial_update_responses.go b/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..81773131449636a4a396aef6281cf851931dc10c --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTypesPartialUpdateReader is a Reader for the CircuitsCircuitTypesPartialUpdate structure. +type CircuitsCircuitTypesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTypesPartialUpdateOK() + 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()) + } +} + +// NewCircuitsCircuitTypesPartialUpdateOK creates a CircuitsCircuitTypesPartialUpdateOK with default headers values +func NewCircuitsCircuitTypesPartialUpdateOK() *CircuitsCircuitTypesPartialUpdateOK { + return &CircuitsCircuitTypesPartialUpdateOK{} +} + +/*CircuitsCircuitTypesPartialUpdateOK handles this case with default header values. + +CircuitsCircuitTypesPartialUpdateOK circuits circuit types partial update o k +*/ +type CircuitsCircuitTypesPartialUpdateOK struct { + Payload *models.CircuitType +} + +func (o *CircuitsCircuitTypesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /circuits/circuit-types/{id}/][%d] circuitsCircuitTypesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTypesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_types_read_parameters.go b/netbox/client/circuits/circuits_circuit_types_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1446e3b6e4ef9d13379e0d1ae47577ec21da900f --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTypesReadParams creates a new CircuitsCircuitTypesReadParams object +// with the default values initialized. +func NewCircuitsCircuitTypesReadParams() *CircuitsCircuitTypesReadParams { + var () + return &CircuitsCircuitTypesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesReadParamsWithTimeout creates a new CircuitsCircuitTypesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesReadParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesReadParams { + var () + return &CircuitsCircuitTypesReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesReadParamsWithContext creates a new CircuitsCircuitTypesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesReadParamsWithContext(ctx context.Context) *CircuitsCircuitTypesReadParams { + var () + return &CircuitsCircuitTypesReadParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesReadParamsWithHTTPClient creates a new CircuitsCircuitTypesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesReadParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesReadParams { + var () + return &CircuitsCircuitTypesReadParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesReadParams contains all the parameters to send to the API endpoint +for the circuits circuit types read operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesReadParams struct { + + /*ID + A unique integer value identifying this circuit type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) WithContext(ctx context.Context) *CircuitsCircuitTypesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) WithID(id int64) *CircuitsCircuitTypesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types read params +func (o *CircuitsCircuitTypesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesReadParams) 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/circuits/circuits_circuit_types_read_responses.go b/netbox/client/circuits/circuits_circuit_types_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8b38832774eb0a101396442c6cd808efc01ac511 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTypesReadReader is a Reader for the CircuitsCircuitTypesRead structure. +type CircuitsCircuitTypesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTypesReadOK() + 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()) + } +} + +// NewCircuitsCircuitTypesReadOK creates a CircuitsCircuitTypesReadOK with default headers values +func NewCircuitsCircuitTypesReadOK() *CircuitsCircuitTypesReadOK { + return &CircuitsCircuitTypesReadOK{} +} + +/*CircuitsCircuitTypesReadOK handles this case with default header values. + +CircuitsCircuitTypesReadOK circuits circuit types read o k +*/ +type CircuitsCircuitTypesReadOK struct { + Payload *models.CircuitType +} + +func (o *CircuitsCircuitTypesReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuit-types/{id}/][%d] circuitsCircuitTypesReadOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTypesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuit_types_update_parameters.go b/netbox/client/circuits/circuits_circuit_types_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4ba9b6960070fa5d39235d03f7463c095b822208 --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitTypesUpdateParams creates a new CircuitsCircuitTypesUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitTypesUpdateParams() *CircuitsCircuitTypesUpdateParams { + var () + return &CircuitsCircuitTypesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitTypesUpdateParamsWithTimeout creates a new CircuitsCircuitTypesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitTypesUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitTypesUpdateParams { + var () + return &CircuitsCircuitTypesUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitTypesUpdateParamsWithContext creates a new CircuitsCircuitTypesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitTypesUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitTypesUpdateParams { + var () + return &CircuitsCircuitTypesUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitTypesUpdateParamsWithHTTPClient creates a new CircuitsCircuitTypesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitTypesUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitTypesUpdateParams { + var () + return &CircuitsCircuitTypesUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitTypesUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuit types update operation typically these are written to a http.Request +*/ +type CircuitsCircuitTypesUpdateParams struct { + + /*Data*/ + Data *models.CircuitType + /*ID + A unique integer value identifying this circuit type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitTypesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitTypesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitTypesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithData(data *models.CircuitType) *CircuitsCircuitTypesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetData(data *models.CircuitType) { + o.Data = data +} + +// WithID adds the id to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) WithID(id int64) *CircuitsCircuitTypesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuit types update params +func (o *CircuitsCircuitTypesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitTypesUpdateParams) 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/circuits/circuits_circuit_types_update_responses.go b/netbox/client/circuits/circuits_circuit_types_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f4215e69b8feb50b62dccbe05843f1ec5b2309fe --- /dev/null +++ b/netbox/client/circuits/circuits_circuit_types_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitTypesUpdateReader is a Reader for the CircuitsCircuitTypesUpdate structure. +type CircuitsCircuitTypesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitTypesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitTypesUpdateOK() + 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()) + } +} + +// NewCircuitsCircuitTypesUpdateOK creates a CircuitsCircuitTypesUpdateOK with default headers values +func NewCircuitsCircuitTypesUpdateOK() *CircuitsCircuitTypesUpdateOK { + return &CircuitsCircuitTypesUpdateOK{} +} + +/*CircuitsCircuitTypesUpdateOK handles this case with default header values. + +CircuitsCircuitTypesUpdateOK circuits circuit types update o k +*/ +type CircuitsCircuitTypesUpdateOK struct { + Payload *models.CircuitType +} + +func (o *CircuitsCircuitTypesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /circuits/circuit-types/{id}/][%d] circuitsCircuitTypesUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitTypesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuits_create_parameters.go b/netbox/client/circuits/circuits_circuits_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..01a2ff4db84c55b518a4408925aceca4cf85c8e7 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitsCreateParams creates a new CircuitsCircuitsCreateParams object +// with the default values initialized. +func NewCircuitsCircuitsCreateParams() *CircuitsCircuitsCreateParams { + var () + return &CircuitsCircuitsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsCreateParamsWithTimeout creates a new CircuitsCircuitsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsCreateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsCreateParams { + var () + return &CircuitsCircuitsCreateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsCreateParamsWithContext creates a new CircuitsCircuitsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsCreateParamsWithContext(ctx context.Context) *CircuitsCircuitsCreateParams { + var () + return &CircuitsCircuitsCreateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsCreateParamsWithHTTPClient creates a new CircuitsCircuitsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsCreateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsCreateParams { + var () + return &CircuitsCircuitsCreateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsCreateParams contains all the parameters to send to the API endpoint +for the circuits circuits create operation typically these are written to a http.Request +*/ +type CircuitsCircuitsCreateParams struct { + + /*Data*/ + Data *models.WritableCircuit + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) WithContext(ctx context.Context) *CircuitsCircuitsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) WithData(data *models.WritableCircuit) *CircuitsCircuitsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuits create params +func (o *CircuitsCircuitsCreateParams) SetData(data *models.WritableCircuit) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsCreateParams) 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/circuits/circuits_circuits_create_responses.go b/netbox/client/circuits/circuits_circuits_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..67b5f21d35ce5dfecf3e0029b3fab9c70d5f5a99 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitsCreateReader is a Reader for the CircuitsCircuitsCreate structure. +type CircuitsCircuitsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewCircuitsCircuitsCreateCreated() + 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()) + } +} + +// NewCircuitsCircuitsCreateCreated creates a CircuitsCircuitsCreateCreated with default headers values +func NewCircuitsCircuitsCreateCreated() *CircuitsCircuitsCreateCreated { + return &CircuitsCircuitsCreateCreated{} +} + +/*CircuitsCircuitsCreateCreated handles this case with default header values. + +CircuitsCircuitsCreateCreated circuits circuits create created +*/ +type CircuitsCircuitsCreateCreated struct { + Payload *models.WritableCircuit +} + +func (o *CircuitsCircuitsCreateCreated) Error() string { + return fmt.Sprintf("[POST /circuits/circuits/][%d] circuitsCircuitsCreateCreated %+v", 201, o.Payload) +} + +func (o *CircuitsCircuitsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuit) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuits_delete_parameters.go b/netbox/client/circuits/circuits_circuits_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7ed89bbc0141af4374a6d424bb40bdef61ff6e48 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitsDeleteParams creates a new CircuitsCircuitsDeleteParams object +// with the default values initialized. +func NewCircuitsCircuitsDeleteParams() *CircuitsCircuitsDeleteParams { + var () + return &CircuitsCircuitsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsDeleteParamsWithTimeout creates a new CircuitsCircuitsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsDeleteParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsDeleteParams { + var () + return &CircuitsCircuitsDeleteParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsDeleteParamsWithContext creates a new CircuitsCircuitsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsDeleteParamsWithContext(ctx context.Context) *CircuitsCircuitsDeleteParams { + var () + return &CircuitsCircuitsDeleteParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsDeleteParamsWithHTTPClient creates a new CircuitsCircuitsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsDeleteParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsDeleteParams { + var () + return &CircuitsCircuitsDeleteParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsDeleteParams contains all the parameters to send to the API endpoint +for the circuits circuits delete operation typically these are written to a http.Request +*/ +type CircuitsCircuitsDeleteParams struct { + + /*ID + A unique integer value identifying this circuit. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) WithContext(ctx context.Context) *CircuitsCircuitsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) WithID(id int64) *CircuitsCircuitsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuits delete params +func (o *CircuitsCircuitsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsDeleteParams) 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/circuits/circuits_circuits_delete_responses.go b/netbox/client/circuits/circuits_circuits_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..508c23a4cee4166525f427c134bc6f13d1c12acc --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitsDeleteReader is a Reader for the CircuitsCircuitsDelete structure. +type CircuitsCircuitsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewCircuitsCircuitsDeleteNoContent() + 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()) + } +} + +// NewCircuitsCircuitsDeleteNoContent creates a CircuitsCircuitsDeleteNoContent with default headers values +func NewCircuitsCircuitsDeleteNoContent() *CircuitsCircuitsDeleteNoContent { + return &CircuitsCircuitsDeleteNoContent{} +} + +/*CircuitsCircuitsDeleteNoContent handles this case with default header values. + +CircuitsCircuitsDeleteNoContent circuits circuits delete no content +*/ +type CircuitsCircuitsDeleteNoContent struct { +} + +func (o *CircuitsCircuitsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /circuits/circuits/{id}/][%d] circuitsCircuitsDeleteNoContent ", 204) +} + +func (o *CircuitsCircuitsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/circuits/circuits_circuits_list_parameters.go b/netbox/client/circuits/circuits_circuits_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..953df19c3285428de9842d7ddc7c433d78dc2420 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_list_parameters.go @@ -0,0 +1,561 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitsListParams creates a new CircuitsCircuitsListParams object +// with the default values initialized. +func NewCircuitsCircuitsListParams() *CircuitsCircuitsListParams { + var () + return &CircuitsCircuitsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsListParamsWithTimeout creates a new CircuitsCircuitsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsListParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsListParams { + var () + return &CircuitsCircuitsListParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsListParamsWithContext creates a new CircuitsCircuitsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsListParamsWithContext(ctx context.Context) *CircuitsCircuitsListParams { + var () + return &CircuitsCircuitsListParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsListParamsWithHTTPClient creates a new CircuitsCircuitsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsListParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsListParams { + var () + return &CircuitsCircuitsListParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsListParams contains all the parameters to send to the API endpoint +for the circuits circuits list operation typically these are written to a http.Request +*/ +type CircuitsCircuitsListParams struct { + + /*Cid*/ + Cid *string + /*CommitRate*/ + CommitRate *float64 + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*InstallDate*/ + InstallDate *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Provider*/ + Provider *string + /*ProviderID*/ + ProviderID *string + /*Q*/ + Q *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*Type*/ + Type *string + /*TypeID*/ + TypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithContext(ctx context.Context) *CircuitsCircuitsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCid adds the cid to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithCid(cid *string) *CircuitsCircuitsListParams { + o.SetCid(cid) + return o +} + +// SetCid adds the cid to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetCid(cid *string) { + o.Cid = cid +} + +// WithCommitRate adds the commitRate to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithCommitRate(commitRate *float64) *CircuitsCircuitsListParams { + o.SetCommitRate(commitRate) + return o +} + +// SetCommitRate adds the commitRate to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetCommitRate(commitRate *float64) { + o.CommitRate = commitRate +} + +// WithIDIn adds the iDIn to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithIDIn(iDIn *float64) *CircuitsCircuitsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithInstallDate adds the installDate to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithInstallDate(installDate *string) *CircuitsCircuitsListParams { + o.SetInstallDate(installDate) + return o +} + +// SetInstallDate adds the installDate to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetInstallDate(installDate *string) { + o.InstallDate = installDate +} + +// WithLimit adds the limit to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithLimit(limit *int64) *CircuitsCircuitsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithOffset(offset *int64) *CircuitsCircuitsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithProvider adds the provider to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithProvider(provider *string) *CircuitsCircuitsListParams { + o.SetProvider(provider) + return o +} + +// SetProvider adds the provider to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetProvider(provider *string) { + o.Provider = provider +} + +// WithProviderID adds the providerID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithProviderID(providerID *string) *CircuitsCircuitsListParams { + o.SetProviderID(providerID) + return o +} + +// SetProviderID adds the providerId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetProviderID(providerID *string) { + o.ProviderID = providerID +} + +// WithQ adds the q to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithQ(q *string) *CircuitsCircuitsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSite adds the site to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithSite(site *string) *CircuitsCircuitsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithSiteID(siteID *string) *CircuitsCircuitsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithTenant adds the tenant to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTenant(tenant *string) *CircuitsCircuitsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTenantID(tenantID *string) *CircuitsCircuitsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithType adds the typeVar to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithType(typeVar *string) *CircuitsCircuitsListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithTypeID adds the typeID to the circuits circuits list params +func (o *CircuitsCircuitsListParams) WithTypeID(typeID *string) *CircuitsCircuitsListParams { + o.SetTypeID(typeID) + return o +} + +// SetTypeID adds the typeId to the circuits circuits list params +func (o *CircuitsCircuitsListParams) SetTypeID(typeID *string) { + o.TypeID = typeID +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cid != nil { + + // query param cid + var qrCid string + if o.Cid != nil { + qrCid = *o.Cid + } + qCid := qrCid + if qCid != "" { + if err := r.SetQueryParam("cid", qCid); err != nil { + return err + } + } + + } + + if o.CommitRate != nil { + + // query param commit_rate + var qrCommitRate float64 + if o.CommitRate != nil { + qrCommitRate = *o.CommitRate + } + qCommitRate := swag.FormatFloat64(qrCommitRate) + if qCommitRate != "" { + if err := r.SetQueryParam("commit_rate", qCommitRate); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.InstallDate != nil { + + // query param install_date + var qrInstallDate string + if o.InstallDate != nil { + qrInstallDate = *o.InstallDate + } + qInstallDate := qrInstallDate + if qInstallDate != "" { + if err := r.SetQueryParam("install_date", qInstallDate); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Provider != nil { + + // query param provider + var qrProvider string + if o.Provider != nil { + qrProvider = *o.Provider + } + qProvider := qrProvider + if qProvider != "" { + if err := r.SetQueryParam("provider", qProvider); err != nil { + return err + } + } + + } + + if o.ProviderID != nil { + + // query param provider_id + var qrProviderID string + if o.ProviderID != nil { + qrProviderID = *o.ProviderID + } + qProviderID := qrProviderID + if qProviderID != "" { + if err := r.SetQueryParam("provider_id", qProviderID); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Tenant != nil { + + // query param tenant + var qrTenant string + if o.Tenant != nil { + qrTenant = *o.Tenant + } + qTenant := qrTenant + if qTenant != "" { + if err := r.SetQueryParam("tenant", qTenant); err != nil { + return err + } + } + + } + + if o.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.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if o.TypeID != nil { + + // query param type_id + var qrTypeID string + if o.TypeID != nil { + qrTypeID = *o.TypeID + } + qTypeID := qrTypeID + if qTypeID != "" { + if err := r.SetQueryParam("type_id", qTypeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/circuits/circuits_circuits_list_responses.go b/netbox/client/circuits/circuits_circuits_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..654e00947e85ac31aaa30cac7e55bd91f0fa43d0 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitsListReader is a Reader for the CircuitsCircuitsList structure. +type CircuitsCircuitsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitsListOK() + 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()) + } +} + +// NewCircuitsCircuitsListOK creates a CircuitsCircuitsListOK with default headers values +func NewCircuitsCircuitsListOK() *CircuitsCircuitsListOK { + return &CircuitsCircuitsListOK{} +} + +/*CircuitsCircuitsListOK handles this case with default header values. + +CircuitsCircuitsListOK circuits circuits list o k +*/ +type CircuitsCircuitsListOK struct { + Payload *models.CircuitsCircuitsListOKBody +} + +func (o *CircuitsCircuitsListOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuits/][%d] circuitsCircuitsListOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitsCircuitsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuits_partial_update_parameters.go b/netbox/client/circuits/circuits_circuits_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8876c714352428f6997290ef12219692adf344e7 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitsPartialUpdateParams creates a new CircuitsCircuitsPartialUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitsPartialUpdateParams() *CircuitsCircuitsPartialUpdateParams { + var () + return &CircuitsCircuitsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsPartialUpdateParamsWithTimeout creates a new CircuitsCircuitsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsPartialUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsPartialUpdateParams { + var () + return &CircuitsCircuitsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsPartialUpdateParamsWithContext creates a new CircuitsCircuitsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsPartialUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitsPartialUpdateParams { + var () + return &CircuitsCircuitsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsPartialUpdateParamsWithHTTPClient creates a new CircuitsCircuitsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsPartialUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsPartialUpdateParams { + var () + return &CircuitsCircuitsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsPartialUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuits partial update operation typically these are written to a http.Request +*/ +type CircuitsCircuitsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableCircuit + /*ID + A unique integer value identifying this circuit. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithData(data *models.WritableCircuit) *CircuitsCircuitsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetData(data *models.WritableCircuit) { + o.Data = data +} + +// WithID adds the id to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) WithID(id int64) *CircuitsCircuitsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuits partial update params +func (o *CircuitsCircuitsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsPartialUpdateParams) 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/circuits/circuits_circuits_partial_update_responses.go b/netbox/client/circuits/circuits_circuits_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e82119444c4ec86f65d384a2f54cf96fbb01e30b --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitsPartialUpdateReader is a Reader for the CircuitsCircuitsPartialUpdate structure. +type CircuitsCircuitsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitsPartialUpdateOK() + 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()) + } +} + +// NewCircuitsCircuitsPartialUpdateOK creates a CircuitsCircuitsPartialUpdateOK with default headers values +func NewCircuitsCircuitsPartialUpdateOK() *CircuitsCircuitsPartialUpdateOK { + return &CircuitsCircuitsPartialUpdateOK{} +} + +/*CircuitsCircuitsPartialUpdateOK handles this case with default header values. + +CircuitsCircuitsPartialUpdateOK circuits circuits partial update o k +*/ +type CircuitsCircuitsPartialUpdateOK struct { + Payload *models.WritableCircuit +} + +func (o *CircuitsCircuitsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /circuits/circuits/{id}/][%d] circuitsCircuitsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuit) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuits_read_parameters.go b/netbox/client/circuits/circuits_circuits_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..170b447341aa72ae1beccca38bf295cb04fabdb1 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitsReadParams creates a new CircuitsCircuitsReadParams object +// with the default values initialized. +func NewCircuitsCircuitsReadParams() *CircuitsCircuitsReadParams { + var () + return &CircuitsCircuitsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsReadParamsWithTimeout creates a new CircuitsCircuitsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsReadParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsReadParams { + var () + return &CircuitsCircuitsReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsReadParamsWithContext creates a new CircuitsCircuitsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsReadParamsWithContext(ctx context.Context) *CircuitsCircuitsReadParams { + var () + return &CircuitsCircuitsReadParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsReadParamsWithHTTPClient creates a new CircuitsCircuitsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsReadParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsReadParams { + var () + return &CircuitsCircuitsReadParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsReadParams contains all the parameters to send to the API endpoint +for the circuits circuits read operation typically these are written to a http.Request +*/ +type CircuitsCircuitsReadParams struct { + + /*ID + A unique integer value identifying this circuit. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) WithContext(ctx context.Context) *CircuitsCircuitsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) WithID(id int64) *CircuitsCircuitsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuits read params +func (o *CircuitsCircuitsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsReadParams) 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/circuits/circuits_circuits_read_responses.go b/netbox/client/circuits/circuits_circuits_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4f29ab343fc0c8a62adf40b0a44a1c599ab430ef --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitsReadReader is a Reader for the CircuitsCircuitsRead structure. +type CircuitsCircuitsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitsReadOK() + 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()) + } +} + +// NewCircuitsCircuitsReadOK creates a CircuitsCircuitsReadOK with default headers values +func NewCircuitsCircuitsReadOK() *CircuitsCircuitsReadOK { + return &CircuitsCircuitsReadOK{} +} + +/*CircuitsCircuitsReadOK handles this case with default header values. + +CircuitsCircuitsReadOK circuits circuits read o k +*/ +type CircuitsCircuitsReadOK struct { + Payload *models.Circuit +} + +func (o *CircuitsCircuitsReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/circuits/{id}/][%d] circuitsCircuitsReadOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Circuit) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_circuits_update_parameters.go b/netbox/client/circuits/circuits_circuits_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..48fa29e09dd7aa2cd87e698f665deedef6372bc8 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsCircuitsUpdateParams creates a new CircuitsCircuitsUpdateParams object +// with the default values initialized. +func NewCircuitsCircuitsUpdateParams() *CircuitsCircuitsUpdateParams { + var () + return &CircuitsCircuitsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsCircuitsUpdateParamsWithTimeout creates a new CircuitsCircuitsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsCircuitsUpdateParamsWithTimeout(timeout time.Duration) *CircuitsCircuitsUpdateParams { + var () + return &CircuitsCircuitsUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsCircuitsUpdateParamsWithContext creates a new CircuitsCircuitsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsCircuitsUpdateParamsWithContext(ctx context.Context) *CircuitsCircuitsUpdateParams { + var () + return &CircuitsCircuitsUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsCircuitsUpdateParamsWithHTTPClient creates a new CircuitsCircuitsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsCircuitsUpdateParamsWithHTTPClient(client *http.Client) *CircuitsCircuitsUpdateParams { + var () + return &CircuitsCircuitsUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsCircuitsUpdateParams contains all the parameters to send to the API endpoint +for the circuits circuits update operation typically these are written to a http.Request +*/ +type CircuitsCircuitsUpdateParams struct { + + /*Data*/ + Data *models.WritableCircuit + /*ID + A unique integer value identifying this circuit. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithTimeout(timeout time.Duration) *CircuitsCircuitsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithContext(ctx context.Context) *CircuitsCircuitsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithHTTPClient(client *http.Client) *CircuitsCircuitsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithData(data *models.WritableCircuit) *CircuitsCircuitsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetData(data *models.WritableCircuit) { + o.Data = data +} + +// WithID adds the id to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) WithID(id int64) *CircuitsCircuitsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits circuits update params +func (o *CircuitsCircuitsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsCircuitsUpdateParams) 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/circuits/circuits_circuits_update_responses.go b/netbox/client/circuits/circuits_circuits_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..057b7d72d927b4651d4a712d767b65be0365f044 --- /dev/null +++ b/netbox/client/circuits/circuits_circuits_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsCircuitsUpdateReader is a Reader for the CircuitsCircuitsUpdate structure. +type CircuitsCircuitsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsCircuitsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsCircuitsUpdateOK() + 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()) + } +} + +// NewCircuitsCircuitsUpdateOK creates a CircuitsCircuitsUpdateOK with default headers values +func NewCircuitsCircuitsUpdateOK() *CircuitsCircuitsUpdateOK { + return &CircuitsCircuitsUpdateOK{} +} + +/*CircuitsCircuitsUpdateOK handles this case with default header values. + +CircuitsCircuitsUpdateOK circuits circuits update o k +*/ +type CircuitsCircuitsUpdateOK struct { + Payload *models.WritableCircuit +} + +func (o *CircuitsCircuitsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /circuits/circuits/{id}/][%d] circuitsCircuitsUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsCircuitsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCircuit) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_client.go b/netbox/client/circuits/circuits_client.go new file mode 100644 index 0000000000000000000000000000000000000000..63e228795987272cd8050d944b6dc91006641511 --- /dev/null +++ b/netbox/client/circuits/circuits_client.go @@ -0,0 +1,813 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new circuits API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for circuits API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +CircuitsChoicesList circuits choices list API +*/ +func (a *Client) CircuitsChoicesList(params *CircuitsChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits__choices_list", + Method: "GET", + PathPattern: "/circuits/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsChoicesListOK), nil + +} + +/* +CircuitsChoicesRead circuits choices read API +*/ +func (a *Client) CircuitsChoicesRead(params *CircuitsChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits__choices_read", + Method: "GET", + PathPattern: "/circuits/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsChoicesReadOK), nil + +} + +/* +CircuitsCircuitTerminationsCreate circuits circuit terminations create API +*/ +func (a *Client) CircuitsCircuitTerminationsCreate(params *CircuitsCircuitTerminationsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_create", + Method: "POST", + PathPattern: "/circuits/circuit-terminations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsCreateCreated), nil + +} + +/* +CircuitsCircuitTerminationsDelete circuits circuit terminations delete API +*/ +func (a *Client) CircuitsCircuitTerminationsDelete(params *CircuitsCircuitTerminationsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_delete", + Method: "DELETE", + PathPattern: "/circuits/circuit-terminations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsDeleteNoContent), nil + +} + +/* +CircuitsCircuitTerminationsList circuits circuit terminations list API +*/ +func (a *Client) CircuitsCircuitTerminationsList(params *CircuitsCircuitTerminationsListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_list", + Method: "GET", + PathPattern: "/circuits/circuit-terminations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsListOK), nil + +} + +/* +CircuitsCircuitTerminationsPartialUpdate circuits circuit terminations partial update API +*/ +func (a *Client) CircuitsCircuitTerminationsPartialUpdate(params *CircuitsCircuitTerminationsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_partial_update", + Method: "PATCH", + PathPattern: "/circuits/circuit-terminations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsPartialUpdateOK), nil + +} + +/* +CircuitsCircuitTerminationsRead circuits circuit terminations read API +*/ +func (a *Client) CircuitsCircuitTerminationsRead(params *CircuitsCircuitTerminationsReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_read", + Method: "GET", + PathPattern: "/circuits/circuit-terminations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsReadOK), nil + +} + +/* +CircuitsCircuitTerminationsUpdate circuits circuit terminations update API +*/ +func (a *Client) CircuitsCircuitTerminationsUpdate(params *CircuitsCircuitTerminationsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTerminationsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTerminationsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-terminations_update", + Method: "PUT", + PathPattern: "/circuits/circuit-terminations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTerminationsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTerminationsUpdateOK), nil + +} + +/* +CircuitsCircuitTypesCreate circuits circuit types create API +*/ +func (a *Client) CircuitsCircuitTypesCreate(params *CircuitsCircuitTypesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_create", + Method: "POST", + PathPattern: "/circuits/circuit-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesCreateCreated), nil + +} + +/* +CircuitsCircuitTypesDelete circuits circuit types delete API +*/ +func (a *Client) CircuitsCircuitTypesDelete(params *CircuitsCircuitTypesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_delete", + Method: "DELETE", + PathPattern: "/circuits/circuit-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesDeleteNoContent), nil + +} + +/* +CircuitsCircuitTypesList circuits circuit types list API +*/ +func (a *Client) CircuitsCircuitTypesList(params *CircuitsCircuitTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_list", + Method: "GET", + PathPattern: "/circuits/circuit-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesListOK), nil + +} + +/* +CircuitsCircuitTypesPartialUpdate circuits circuit types partial update API +*/ +func (a *Client) CircuitsCircuitTypesPartialUpdate(params *CircuitsCircuitTypesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_partial_update", + Method: "PATCH", + PathPattern: "/circuits/circuit-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesPartialUpdateOK), nil + +} + +/* +CircuitsCircuitTypesRead circuits circuit types read API +*/ +func (a *Client) CircuitsCircuitTypesRead(params *CircuitsCircuitTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_read", + Method: "GET", + PathPattern: "/circuits/circuit-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesReadOK), nil + +} + +/* +CircuitsCircuitTypesUpdate circuits circuit types update API +*/ +func (a *Client) CircuitsCircuitTypesUpdate(params *CircuitsCircuitTypesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitTypesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitTypesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuit-types_update", + Method: "PUT", + PathPattern: "/circuits/circuit-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitTypesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitTypesUpdateOK), nil + +} + +/* +CircuitsCircuitsCreate circuits circuits create API +*/ +func (a *Client) CircuitsCircuitsCreate(params *CircuitsCircuitsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_create", + Method: "POST", + PathPattern: "/circuits/circuits/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsCreateCreated), nil + +} + +/* +CircuitsCircuitsDelete circuits circuits delete API +*/ +func (a *Client) CircuitsCircuitsDelete(params *CircuitsCircuitsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_delete", + Method: "DELETE", + PathPattern: "/circuits/circuits/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsDeleteNoContent), nil + +} + +/* +CircuitsCircuitsList circuits circuits list API +*/ +func (a *Client) CircuitsCircuitsList(params *CircuitsCircuitsListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_list", + Method: "GET", + PathPattern: "/circuits/circuits/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsListOK), nil + +} + +/* +CircuitsCircuitsPartialUpdate circuits circuits partial update API +*/ +func (a *Client) CircuitsCircuitsPartialUpdate(params *CircuitsCircuitsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_partial_update", + Method: "PATCH", + PathPattern: "/circuits/circuits/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsPartialUpdateOK), nil + +} + +/* +CircuitsCircuitsRead circuits circuits read API +*/ +func (a *Client) CircuitsCircuitsRead(params *CircuitsCircuitsReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_read", + Method: "GET", + PathPattern: "/circuits/circuits/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsReadOK), nil + +} + +/* +CircuitsCircuitsUpdate circuits circuits update API +*/ +func (a *Client) CircuitsCircuitsUpdate(params *CircuitsCircuitsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsCircuitsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsCircuitsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_circuits_update", + Method: "PUT", + PathPattern: "/circuits/circuits/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsCircuitsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsCircuitsUpdateOK), nil + +} + +/* +CircuitsProvidersCreate circuits providers create API +*/ +func (a *Client) CircuitsProvidersCreate(params *CircuitsProvidersCreateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_create", + Method: "POST", + PathPattern: "/circuits/providers/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersCreateCreated), nil + +} + +/* +CircuitsProvidersDelete circuits providers delete API +*/ +func (a *Client) CircuitsProvidersDelete(params *CircuitsProvidersDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_delete", + Method: "DELETE", + PathPattern: "/circuits/providers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersDeleteNoContent), nil + +} + +/* +CircuitsProvidersGraphs A convenience method for rendering graphs for a particular provider. +*/ +func (a *Client) CircuitsProvidersGraphs(params *CircuitsProvidersGraphsParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersGraphsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersGraphsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_graphs", + Method: "GET", + PathPattern: "/circuits/providers/{id}/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersGraphsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersGraphsOK), nil + +} + +/* +CircuitsProvidersList circuits providers list API +*/ +func (a *Client) CircuitsProvidersList(params *CircuitsProvidersListParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_list", + Method: "GET", + PathPattern: "/circuits/providers/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersListOK), nil + +} + +/* +CircuitsProvidersPartialUpdate circuits providers partial update API +*/ +func (a *Client) CircuitsProvidersPartialUpdate(params *CircuitsProvidersPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_partial_update", + Method: "PATCH", + PathPattern: "/circuits/providers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersPartialUpdateOK), nil + +} + +/* +CircuitsProvidersRead circuits providers read API +*/ +func (a *Client) CircuitsProvidersRead(params *CircuitsProvidersReadParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_read", + Method: "GET", + PathPattern: "/circuits/providers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersReadOK), nil + +} + +/* +CircuitsProvidersUpdate circuits providers update API +*/ +func (a *Client) CircuitsProvidersUpdate(params *CircuitsProvidersUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*CircuitsProvidersUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCircuitsProvidersUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "circuits_providers_update", + Method: "PUT", + PathPattern: "/circuits/providers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CircuitsProvidersUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*CircuitsProvidersUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/netbox/client/circuits/circuits_providers_create_parameters.go b/netbox/client/circuits/circuits_providers_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..25b1a65e62cecc5a46ce7c18fc57c9aae17d5248 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsProvidersCreateParams creates a new CircuitsProvidersCreateParams object +// with the default values initialized. +func NewCircuitsProvidersCreateParams() *CircuitsProvidersCreateParams { + var () + return &CircuitsProvidersCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersCreateParamsWithTimeout creates a new CircuitsProvidersCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersCreateParamsWithTimeout(timeout time.Duration) *CircuitsProvidersCreateParams { + var () + return &CircuitsProvidersCreateParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersCreateParamsWithContext creates a new CircuitsProvidersCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersCreateParamsWithContext(ctx context.Context) *CircuitsProvidersCreateParams { + var () + return &CircuitsProvidersCreateParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersCreateParamsWithHTTPClient creates a new CircuitsProvidersCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersCreateParamsWithHTTPClient(client *http.Client) *CircuitsProvidersCreateParams { + var () + return &CircuitsProvidersCreateParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersCreateParams contains all the parameters to send to the API endpoint +for the circuits providers create operation typically these are written to a http.Request +*/ +type CircuitsProvidersCreateParams struct { + + /*Data*/ + Data *models.WritableProvider + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers create params +func (o *CircuitsProvidersCreateParams) WithTimeout(timeout time.Duration) *CircuitsProvidersCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers create params +func (o *CircuitsProvidersCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers create params +func (o *CircuitsProvidersCreateParams) WithContext(ctx context.Context) *CircuitsProvidersCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers create params +func (o *CircuitsProvidersCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers create params +func (o *CircuitsProvidersCreateParams) WithHTTPClient(client *http.Client) *CircuitsProvidersCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers create params +func (o *CircuitsProvidersCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits providers create params +func (o *CircuitsProvidersCreateParams) WithData(data *models.WritableProvider) *CircuitsProvidersCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits providers create params +func (o *CircuitsProvidersCreateParams) SetData(data *models.WritableProvider) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersCreateParams) 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/circuits/circuits_providers_create_responses.go b/netbox/client/circuits/circuits_providers_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c63a14732f00ffb875ba9f12d968c1b1d3c83237 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsProvidersCreateReader is a Reader for the CircuitsProvidersCreate structure. +type CircuitsProvidersCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewCircuitsProvidersCreateCreated() + 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()) + } +} + +// NewCircuitsProvidersCreateCreated creates a CircuitsProvidersCreateCreated with default headers values +func NewCircuitsProvidersCreateCreated() *CircuitsProvidersCreateCreated { + return &CircuitsProvidersCreateCreated{} +} + +/*CircuitsProvidersCreateCreated handles this case with default header values. + +CircuitsProvidersCreateCreated circuits providers create created +*/ +type CircuitsProvidersCreateCreated struct { + Payload *models.WritableProvider +} + +func (o *CircuitsProvidersCreateCreated) Error() string { + return fmt.Sprintf("[POST /circuits/providers/][%d] circuitsProvidersCreateCreated %+v", 201, o.Payload) +} + +func (o *CircuitsProvidersCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableProvider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_providers_delete_parameters.go b/netbox/client/circuits/circuits_providers_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..55875358aa35fd79ab54e1bb67f2f40f53e91e70 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsProvidersDeleteParams creates a new CircuitsProvidersDeleteParams object +// with the default values initialized. +func NewCircuitsProvidersDeleteParams() *CircuitsProvidersDeleteParams { + var () + return &CircuitsProvidersDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersDeleteParamsWithTimeout creates a new CircuitsProvidersDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersDeleteParamsWithTimeout(timeout time.Duration) *CircuitsProvidersDeleteParams { + var () + return &CircuitsProvidersDeleteParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersDeleteParamsWithContext creates a new CircuitsProvidersDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersDeleteParamsWithContext(ctx context.Context) *CircuitsProvidersDeleteParams { + var () + return &CircuitsProvidersDeleteParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersDeleteParamsWithHTTPClient creates a new CircuitsProvidersDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersDeleteParamsWithHTTPClient(client *http.Client) *CircuitsProvidersDeleteParams { + var () + return &CircuitsProvidersDeleteParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersDeleteParams contains all the parameters to send to the API endpoint +for the circuits providers delete operation typically these are written to a http.Request +*/ +type CircuitsProvidersDeleteParams struct { + + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) WithTimeout(timeout time.Duration) *CircuitsProvidersDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) WithContext(ctx context.Context) *CircuitsProvidersDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) WithHTTPClient(client *http.Client) *CircuitsProvidersDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) WithID(id int64) *CircuitsProvidersDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers delete params +func (o *CircuitsProvidersDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersDeleteParams) 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/circuits/circuits_providers_delete_responses.go b/netbox/client/circuits/circuits_providers_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..676b4303b712ac2538d9a1b8660a249c7ff096b9 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsProvidersDeleteReader is a Reader for the CircuitsProvidersDelete structure. +type CircuitsProvidersDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewCircuitsProvidersDeleteNoContent() + 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()) + } +} + +// NewCircuitsProvidersDeleteNoContent creates a CircuitsProvidersDeleteNoContent with default headers values +func NewCircuitsProvidersDeleteNoContent() *CircuitsProvidersDeleteNoContent { + return &CircuitsProvidersDeleteNoContent{} +} + +/*CircuitsProvidersDeleteNoContent handles this case with default header values. + +CircuitsProvidersDeleteNoContent circuits providers delete no content +*/ +type CircuitsProvidersDeleteNoContent struct { +} + +func (o *CircuitsProvidersDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /circuits/providers/{id}/][%d] circuitsProvidersDeleteNoContent ", 204) +} + +func (o *CircuitsProvidersDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/circuits/circuits_providers_graphs_parameters.go b/netbox/client/circuits/circuits_providers_graphs_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..22137026cd6b7c35d2d1abf3a6e91f30593f27cc --- /dev/null +++ b/netbox/client/circuits/circuits_providers_graphs_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsProvidersGraphsParams creates a new CircuitsProvidersGraphsParams object +// with the default values initialized. +func NewCircuitsProvidersGraphsParams() *CircuitsProvidersGraphsParams { + var () + return &CircuitsProvidersGraphsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersGraphsParamsWithTimeout creates a new CircuitsProvidersGraphsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersGraphsParamsWithTimeout(timeout time.Duration) *CircuitsProvidersGraphsParams { + var () + return &CircuitsProvidersGraphsParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersGraphsParamsWithContext creates a new CircuitsProvidersGraphsParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersGraphsParamsWithContext(ctx context.Context) *CircuitsProvidersGraphsParams { + var () + return &CircuitsProvidersGraphsParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersGraphsParamsWithHTTPClient creates a new CircuitsProvidersGraphsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersGraphsParamsWithHTTPClient(client *http.Client) *CircuitsProvidersGraphsParams { + var () + return &CircuitsProvidersGraphsParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersGraphsParams contains all the parameters to send to the API endpoint +for the circuits providers graphs operation typically these are written to a http.Request +*/ +type CircuitsProvidersGraphsParams struct { + + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) WithTimeout(timeout time.Duration) *CircuitsProvidersGraphsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) WithContext(ctx context.Context) *CircuitsProvidersGraphsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) WithHTTPClient(client *http.Client) *CircuitsProvidersGraphsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) WithID(id int64) *CircuitsProvidersGraphsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers graphs params +func (o *CircuitsProvidersGraphsParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersGraphsParams) 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/circuits/circuits_providers_graphs_responses.go b/netbox/client/circuits/circuits_providers_graphs_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..df291c52fd1d9bfa2c33da3c5745028b5e902b24 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_graphs_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsProvidersGraphsReader is a Reader for the CircuitsProvidersGraphs structure. +type CircuitsProvidersGraphsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersGraphsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersGraphsOK() + 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()) + } +} + +// NewCircuitsProvidersGraphsOK creates a CircuitsProvidersGraphsOK with default headers values +func NewCircuitsProvidersGraphsOK() *CircuitsProvidersGraphsOK { + return &CircuitsProvidersGraphsOK{} +} + +/*CircuitsProvidersGraphsOK handles this case with default header values. + +CircuitsProvidersGraphsOK circuits providers graphs o k +*/ +type CircuitsProvidersGraphsOK struct { + Payload *models.Provider +} + +func (o *CircuitsProvidersGraphsOK) Error() string { + return fmt.Sprintf("[GET /circuits/providers/{id}/graphs/][%d] circuitsProvidersGraphsOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersGraphsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Provider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_providers_list_parameters.go b/netbox/client/circuits/circuits_providers_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e6c7e296c5d07b9e543a84ce75883ef9aced7c21 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_list_parameters.go @@ -0,0 +1,416 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsProvidersListParams creates a new CircuitsProvidersListParams object +// with the default values initialized. +func NewCircuitsProvidersListParams() *CircuitsProvidersListParams { + var () + return &CircuitsProvidersListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersListParamsWithTimeout creates a new CircuitsProvidersListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersListParamsWithTimeout(timeout time.Duration) *CircuitsProvidersListParams { + var () + return &CircuitsProvidersListParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersListParamsWithContext creates a new CircuitsProvidersListParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersListParamsWithContext(ctx context.Context) *CircuitsProvidersListParams { + var () + return &CircuitsProvidersListParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersListParamsWithHTTPClient creates a new CircuitsProvidersListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersListParamsWithHTTPClient(client *http.Client) *CircuitsProvidersListParams { + var () + return &CircuitsProvidersListParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersListParams contains all the parameters to send to the API endpoint +for the circuits providers list operation typically these are written to a http.Request +*/ +type CircuitsProvidersListParams struct { + + /*Account*/ + Account *string + /*Asn*/ + Asn *float64 + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers list params +func (o *CircuitsProvidersListParams) WithTimeout(timeout time.Duration) *CircuitsProvidersListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers list params +func (o *CircuitsProvidersListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers list params +func (o *CircuitsProvidersListParams) WithContext(ctx context.Context) *CircuitsProvidersListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers list params +func (o *CircuitsProvidersListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers list params +func (o *CircuitsProvidersListParams) WithHTTPClient(client *http.Client) *CircuitsProvidersListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers list params +func (o *CircuitsProvidersListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAccount adds the account to the circuits providers list params +func (o *CircuitsProvidersListParams) WithAccount(account *string) *CircuitsProvidersListParams { + o.SetAccount(account) + return o +} + +// SetAccount adds the account to the circuits providers list params +func (o *CircuitsProvidersListParams) SetAccount(account *string) { + o.Account = account +} + +// WithAsn adds the asn to the circuits providers list params +func (o *CircuitsProvidersListParams) WithAsn(asn *float64) *CircuitsProvidersListParams { + o.SetAsn(asn) + return o +} + +// SetAsn adds the asn to the circuits providers list params +func (o *CircuitsProvidersListParams) SetAsn(asn *float64) { + o.Asn = asn +} + +// WithIDIn adds the iDIn to the circuits providers list params +func (o *CircuitsProvidersListParams) WithIDIn(iDIn *float64) *CircuitsProvidersListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the circuits providers list params +func (o *CircuitsProvidersListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the circuits providers list params +func (o *CircuitsProvidersListParams) WithLimit(limit *int64) *CircuitsProvidersListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the circuits providers list params +func (o *CircuitsProvidersListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the circuits providers list params +func (o *CircuitsProvidersListParams) WithName(name *string) *CircuitsProvidersListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the circuits providers list params +func (o *CircuitsProvidersListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the circuits providers list params +func (o *CircuitsProvidersListParams) WithOffset(offset *int64) *CircuitsProvidersListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the circuits providers list params +func (o *CircuitsProvidersListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the circuits providers list params +func (o *CircuitsProvidersListParams) WithQ(q *string) *CircuitsProvidersListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the circuits providers list params +func (o *CircuitsProvidersListParams) SetQ(q *string) { + o.Q = q +} + +// WithSite adds the site to the circuits providers list params +func (o *CircuitsProvidersListParams) WithSite(site *string) *CircuitsProvidersListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the circuits providers list params +func (o *CircuitsProvidersListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the circuits providers list params +func (o *CircuitsProvidersListParams) WithSiteID(siteID *string) *CircuitsProvidersListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the circuits providers list params +func (o *CircuitsProvidersListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSlug adds the slug to the circuits providers list params +func (o *CircuitsProvidersListParams) WithSlug(slug *string) *CircuitsProvidersListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the circuits providers list params +func (o *CircuitsProvidersListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Account != nil { + + // query param account + var qrAccount string + if o.Account != nil { + qrAccount = *o.Account + } + qAccount := qrAccount + if qAccount != "" { + if err := r.SetQueryParam("account", qAccount); err != nil { + return err + } + } + + } + + if o.Asn != nil { + + // query param asn + var qrAsn float64 + if o.Asn != nil { + qrAsn = *o.Asn + } + qAsn := swag.FormatFloat64(qrAsn) + if qAsn != "" { + if err := r.SetQueryParam("asn", qAsn); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/circuits/circuits_providers_list_responses.go b/netbox/client/circuits/circuits_providers_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..eddd24f801b9dbeafa51fa82ea1e06407adec0bc --- /dev/null +++ b/netbox/client/circuits/circuits_providers_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsProvidersListReader is a Reader for the CircuitsProvidersList structure. +type CircuitsProvidersListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersListOK() + 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()) + } +} + +// NewCircuitsProvidersListOK creates a CircuitsProvidersListOK with default headers values +func NewCircuitsProvidersListOK() *CircuitsProvidersListOK { + return &CircuitsProvidersListOK{} +} + +/*CircuitsProvidersListOK handles this case with default header values. + +CircuitsProvidersListOK circuits providers list o k +*/ +type CircuitsProvidersListOK struct { + Payload *models.CircuitsProvidersListOKBody +} + +func (o *CircuitsProvidersListOK) Error() string { + return fmt.Sprintf("[GET /circuits/providers/][%d] circuitsProvidersListOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.CircuitsProvidersListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_providers_partial_update_parameters.go b/netbox/client/circuits/circuits_providers_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d622c5eea29ed7013f840a9ee58b6c57045dc5d8 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsProvidersPartialUpdateParams creates a new CircuitsProvidersPartialUpdateParams object +// with the default values initialized. +func NewCircuitsProvidersPartialUpdateParams() *CircuitsProvidersPartialUpdateParams { + var () + return &CircuitsProvidersPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersPartialUpdateParamsWithTimeout creates a new CircuitsProvidersPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersPartialUpdateParamsWithTimeout(timeout time.Duration) *CircuitsProvidersPartialUpdateParams { + var () + return &CircuitsProvidersPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersPartialUpdateParamsWithContext creates a new CircuitsProvidersPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersPartialUpdateParamsWithContext(ctx context.Context) *CircuitsProvidersPartialUpdateParams { + var () + return &CircuitsProvidersPartialUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersPartialUpdateParamsWithHTTPClient creates a new CircuitsProvidersPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersPartialUpdateParamsWithHTTPClient(client *http.Client) *CircuitsProvidersPartialUpdateParams { + var () + return &CircuitsProvidersPartialUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersPartialUpdateParams contains all the parameters to send to the API endpoint +for the circuits providers partial update operation typically these are written to a http.Request +*/ +type CircuitsProvidersPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableProvider + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithTimeout(timeout time.Duration) *CircuitsProvidersPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithContext(ctx context.Context) *CircuitsProvidersPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithHTTPClient(client *http.Client) *CircuitsProvidersPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithData(data *models.WritableProvider) *CircuitsProvidersPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetData(data *models.WritableProvider) { + o.Data = data +} + +// WithID adds the id to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) WithID(id int64) *CircuitsProvidersPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers partial update params +func (o *CircuitsProvidersPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersPartialUpdateParams) 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/circuits/circuits_providers_partial_update_responses.go b/netbox/client/circuits/circuits_providers_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b2047d2ddc741ede94f4c543f885a6a0f30154dd --- /dev/null +++ b/netbox/client/circuits/circuits_providers_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsProvidersPartialUpdateReader is a Reader for the CircuitsProvidersPartialUpdate structure. +type CircuitsProvidersPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersPartialUpdateOK() + 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()) + } +} + +// NewCircuitsProvidersPartialUpdateOK creates a CircuitsProvidersPartialUpdateOK with default headers values +func NewCircuitsProvidersPartialUpdateOK() *CircuitsProvidersPartialUpdateOK { + return &CircuitsProvidersPartialUpdateOK{} +} + +/*CircuitsProvidersPartialUpdateOK handles this case with default header values. + +CircuitsProvidersPartialUpdateOK circuits providers partial update o k +*/ +type CircuitsProvidersPartialUpdateOK struct { + Payload *models.WritableProvider +} + +func (o *CircuitsProvidersPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /circuits/providers/{id}/][%d] circuitsProvidersPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableProvider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_providers_read_parameters.go b/netbox/client/circuits/circuits_providers_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..36670e23b370c99378da5e3d17690fb3c6450b2a --- /dev/null +++ b/netbox/client/circuits/circuits_providers_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsProvidersReadParams creates a new CircuitsProvidersReadParams object +// with the default values initialized. +func NewCircuitsProvidersReadParams() *CircuitsProvidersReadParams { + var () + return &CircuitsProvidersReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersReadParamsWithTimeout creates a new CircuitsProvidersReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersReadParamsWithTimeout(timeout time.Duration) *CircuitsProvidersReadParams { + var () + return &CircuitsProvidersReadParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersReadParamsWithContext creates a new CircuitsProvidersReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersReadParamsWithContext(ctx context.Context) *CircuitsProvidersReadParams { + var () + return &CircuitsProvidersReadParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersReadParamsWithHTTPClient creates a new CircuitsProvidersReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersReadParamsWithHTTPClient(client *http.Client) *CircuitsProvidersReadParams { + var () + return &CircuitsProvidersReadParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersReadParams contains all the parameters to send to the API endpoint +for the circuits providers read operation typically these are written to a http.Request +*/ +type CircuitsProvidersReadParams struct { + + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers read params +func (o *CircuitsProvidersReadParams) WithTimeout(timeout time.Duration) *CircuitsProvidersReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers read params +func (o *CircuitsProvidersReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers read params +func (o *CircuitsProvidersReadParams) WithContext(ctx context.Context) *CircuitsProvidersReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers read params +func (o *CircuitsProvidersReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers read params +func (o *CircuitsProvidersReadParams) WithHTTPClient(client *http.Client) *CircuitsProvidersReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers read params +func (o *CircuitsProvidersReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the circuits providers read params +func (o *CircuitsProvidersReadParams) WithID(id int64) *CircuitsProvidersReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers read params +func (o *CircuitsProvidersReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersReadParams) 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/circuits/circuits_providers_read_responses.go b/netbox/client/circuits/circuits_providers_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a1b6d9d1bf61188c424d5a6c40f68e9c2e369c20 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsProvidersReadReader is a Reader for the CircuitsProvidersRead structure. +type CircuitsProvidersReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersReadOK() + 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()) + } +} + +// NewCircuitsProvidersReadOK creates a CircuitsProvidersReadOK with default headers values +func NewCircuitsProvidersReadOK() *CircuitsProvidersReadOK { + return &CircuitsProvidersReadOK{} +} + +/*CircuitsProvidersReadOK handles this case with default header values. + +CircuitsProvidersReadOK circuits providers read o k +*/ +type CircuitsProvidersReadOK struct { + Payload *models.Provider +} + +func (o *CircuitsProvidersReadOK) Error() string { + return fmt.Sprintf("[GET /circuits/providers/{id}/][%d] circuitsProvidersReadOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Provider) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/circuits/circuits_providers_update_parameters.go b/netbox/client/circuits/circuits_providers_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7889f13abfd075782b792fe1d31988fa31cdd4d6 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// NewCircuitsProvidersUpdateParams creates a new CircuitsProvidersUpdateParams object +// with the default values initialized. +func NewCircuitsProvidersUpdateParams() *CircuitsProvidersUpdateParams { + var () + return &CircuitsProvidersUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewCircuitsProvidersUpdateParamsWithTimeout creates a new CircuitsProvidersUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewCircuitsProvidersUpdateParamsWithTimeout(timeout time.Duration) *CircuitsProvidersUpdateParams { + var () + return &CircuitsProvidersUpdateParams{ + + timeout: timeout, + } +} + +// NewCircuitsProvidersUpdateParamsWithContext creates a new CircuitsProvidersUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewCircuitsProvidersUpdateParamsWithContext(ctx context.Context) *CircuitsProvidersUpdateParams { + var () + return &CircuitsProvidersUpdateParams{ + + Context: ctx, + } +} + +// NewCircuitsProvidersUpdateParamsWithHTTPClient creates a new CircuitsProvidersUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewCircuitsProvidersUpdateParamsWithHTTPClient(client *http.Client) *CircuitsProvidersUpdateParams { + var () + return &CircuitsProvidersUpdateParams{ + HTTPClient: client, + } +} + +/*CircuitsProvidersUpdateParams contains all the parameters to send to the API endpoint +for the circuits providers update operation typically these are written to a http.Request +*/ +type CircuitsProvidersUpdateParams struct { + + /*Data*/ + Data *models.WritableProvider + /*ID + A unique integer value identifying this provider. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithTimeout(timeout time.Duration) *CircuitsProvidersUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithContext(ctx context.Context) *CircuitsProvidersUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithHTTPClient(client *http.Client) *CircuitsProvidersUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithData(data *models.WritableProvider) *CircuitsProvidersUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetData(data *models.WritableProvider) { + o.Data = data +} + +// WithID adds the id to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) WithID(id int64) *CircuitsProvidersUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the circuits providers update params +func (o *CircuitsProvidersUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *CircuitsProvidersUpdateParams) 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/circuits/circuits_providers_update_responses.go b/netbox/client/circuits/circuits_providers_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9007fd43337b5407ccb1ee0f85e9bc997ebf6442 --- /dev/null +++ b/netbox/client/circuits/circuits_providers_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package circuits + +// 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" +) + +// CircuitsProvidersUpdateReader is a Reader for the CircuitsProvidersUpdate structure. +type CircuitsProvidersUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CircuitsProvidersUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewCircuitsProvidersUpdateOK() + 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()) + } +} + +// NewCircuitsProvidersUpdateOK creates a CircuitsProvidersUpdateOK with default headers values +func NewCircuitsProvidersUpdateOK() *CircuitsProvidersUpdateOK { + return &CircuitsProvidersUpdateOK{} +} + +/*CircuitsProvidersUpdateOK handles this case with default header values. + +CircuitsProvidersUpdateOK circuits providers update o k +*/ +type CircuitsProvidersUpdateOK struct { + Payload *models.WritableProvider +} + +func (o *CircuitsProvidersUpdateOK) Error() string { + return fmt.Sprintf("[PUT /circuits/providers/{id}/][%d] circuitsProvidersUpdateOK %+v", 200, o.Payload) +} + +func (o *CircuitsProvidersUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableProvider) + + // 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_choices_list_parameters.go b/netbox/client/dcim/dcim_choices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..fdbfe2705f944f638e991fc3932ee2f712ec36d5 --- /dev/null +++ b/netbox/client/dcim/dcim_choices_list_parameters.go @@ -0,0 +1,114 @@ +// 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" +) + +// NewDcimChoicesListParams creates a new DcimChoicesListParams object +// with the default values initialized. +func NewDcimChoicesListParams() *DcimChoicesListParams { + + return &DcimChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimChoicesListParamsWithTimeout creates a new DcimChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimChoicesListParamsWithTimeout(timeout time.Duration) *DcimChoicesListParams { + + return &DcimChoicesListParams{ + + timeout: timeout, + } +} + +// NewDcimChoicesListParamsWithContext creates a new DcimChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimChoicesListParamsWithContext(ctx context.Context) *DcimChoicesListParams { + + return &DcimChoicesListParams{ + + Context: ctx, + } +} + +// NewDcimChoicesListParamsWithHTTPClient creates a new DcimChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimChoicesListParamsWithHTTPClient(client *http.Client) *DcimChoicesListParams { + + return &DcimChoicesListParams{ + HTTPClient: client, + } +} + +/*DcimChoicesListParams contains all the parameters to send to the API endpoint +for the dcim choices list operation typically these are written to a http.Request +*/ +type DcimChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim choices list params +func (o *DcimChoicesListParams) WithTimeout(timeout time.Duration) *DcimChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim choices list params +func (o *DcimChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim choices list params +func (o *DcimChoicesListParams) WithContext(ctx context.Context) *DcimChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim choices list params +func (o *DcimChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim choices list params +func (o *DcimChoicesListParams) WithHTTPClient(client *http.Client) *DcimChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim choices list params +func (o *DcimChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimChoicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_choices_list_responses.go b/netbox/client/dcim/dcim_choices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..874d387f01d28efade2b52a2ffe1decfa8f11569 --- /dev/null +++ b/netbox/client/dcim/dcim_choices_list_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" +) + +// DcimChoicesListReader is a Reader for the DcimChoicesList structure. +type DcimChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimChoicesListOK() + 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()) + } +} + +// NewDcimChoicesListOK creates a DcimChoicesListOK with default headers values +func NewDcimChoicesListOK() *DcimChoicesListOK { + return &DcimChoicesListOK{} +} + +/*DcimChoicesListOK handles this case with default header values. + +DcimChoicesListOK dcim choices list o k +*/ +type DcimChoicesListOK struct { +} + +func (o *DcimChoicesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/_choices/][%d] dcimChoicesListOK ", 200) +} + +func (o *DcimChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_choices_read_parameters.go b/netbox/client/dcim/dcim_choices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9bd9feec7f528c13a0c269d9acf8fe732a8aa11b --- /dev/null +++ b/netbox/client/dcim/dcim_choices_read_parameters.go @@ -0,0 +1,134 @@ +// 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" +) + +// NewDcimChoicesReadParams creates a new DcimChoicesReadParams object +// with the default values initialized. +func NewDcimChoicesReadParams() *DcimChoicesReadParams { + var () + return &DcimChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimChoicesReadParamsWithTimeout creates a new DcimChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimChoicesReadParamsWithTimeout(timeout time.Duration) *DcimChoicesReadParams { + var () + return &DcimChoicesReadParams{ + + timeout: timeout, + } +} + +// NewDcimChoicesReadParamsWithContext creates a new DcimChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimChoicesReadParamsWithContext(ctx context.Context) *DcimChoicesReadParams { + var () + return &DcimChoicesReadParams{ + + Context: ctx, + } +} + +// NewDcimChoicesReadParamsWithHTTPClient creates a new DcimChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimChoicesReadParamsWithHTTPClient(client *http.Client) *DcimChoicesReadParams { + var () + return &DcimChoicesReadParams{ + HTTPClient: client, + } +} + +/*DcimChoicesReadParams contains all the parameters to send to the API endpoint +for the dcim choices read operation typically these are written to a http.Request +*/ +type DcimChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim choices read params +func (o *DcimChoicesReadParams) WithTimeout(timeout time.Duration) *DcimChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim choices read params +func (o *DcimChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim choices read params +func (o *DcimChoicesReadParams) WithContext(ctx context.Context) *DcimChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim choices read params +func (o *DcimChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim choices read params +func (o *DcimChoicesReadParams) WithHTTPClient(client *http.Client) *DcimChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim choices read params +func (o *DcimChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim choices read params +func (o *DcimChoicesReadParams) WithID(id string) *DcimChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim choices read params +func (o *DcimChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimChoicesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_choices_read_responses.go b/netbox/client/dcim/dcim_choices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b6a045648613d0cda6418a02c048bda20ec4e33d --- /dev/null +++ b/netbox/client/dcim/dcim_choices_read_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" +) + +// DcimChoicesReadReader is a Reader for the DcimChoicesRead structure. +type DcimChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimChoicesReadOK() + 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()) + } +} + +// NewDcimChoicesReadOK creates a DcimChoicesReadOK with default headers values +func NewDcimChoicesReadOK() *DcimChoicesReadOK { + return &DcimChoicesReadOK{} +} + +/*DcimChoicesReadOK handles this case with default header values. + +DcimChoicesReadOK dcim choices read o k +*/ +type DcimChoicesReadOK struct { +} + +func (o *DcimChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/_choices/{id}/][%d] dcimChoicesReadOK ", 200) +} + +func (o *DcimChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_client.go b/netbox/client/dcim/dcim_client.go new file mode 100644 index 0000000000000000000000000000000000000000..2091c9c833b73310976179b0eeced2a8531f1629 --- /dev/null +++ b/netbox/client/dcim/dcim_client.go @@ -0,0 +1,4646 @@ +// 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 ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new dcim API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for dcim API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +DcimChoicesList dcim choices list API +*/ +func (a *Client) DcimChoicesList(params *DcimChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim__choices_list", + Method: "GET", + PathPattern: "/dcim/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimChoicesListOK), nil + +} + +/* +DcimChoicesRead dcim choices read API +*/ +func (a *Client) DcimChoicesRead(params *DcimChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim__choices_read", + Method: "GET", + PathPattern: "/dcim/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimChoicesReadOK), nil + +} + +/* +DcimConnectedDeviceList This endpoint allows a user to determine what device (if any) is connected to a given peer device and peer +interface. This is useful in a situation where a device boots with no configuration, but can detect its neighbors +via a protocol such as LLDP. Two query parameters must be included in the request: + +* `peer-device`: The name of the peer device +* `peer-interface`: The name of the peer interface +*/ +func (a *Client) DcimConnectedDeviceList(params *DcimConnectedDeviceListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConnectedDeviceListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConnectedDeviceListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_connected-device_list", + Method: "GET", + PathPattern: "/dcim/connected-device/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConnectedDeviceListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConnectedDeviceListOK), nil + +} + +/* +DcimConsoleConnectionsList dcim console connections list API +*/ +func (a *Client) DcimConsoleConnectionsList(params *DcimConsoleConnectionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleConnectionsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleConnectionsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-connections_list", + Method: "GET", + PathPattern: "/dcim/console-connections/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleConnectionsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleConnectionsListOK), nil + +} + +/* +DcimConsolePortTemplatesCreate dcim console port templates create API +*/ +func (a *Client) DcimConsolePortTemplatesCreate(params *DcimConsolePortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_create", + Method: "POST", + PathPattern: "/dcim/console-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesCreateCreated), nil + +} + +/* +DcimConsolePortTemplatesDelete dcim console port templates delete API +*/ +func (a *Client) DcimConsolePortTemplatesDelete(params *DcimConsolePortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/console-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesDeleteNoContent), nil + +} + +/* +DcimConsolePortTemplatesList dcim console port templates list API +*/ +func (a *Client) DcimConsolePortTemplatesList(params *DcimConsolePortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_list", + Method: "GET", + PathPattern: "/dcim/console-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesListOK), nil + +} + +/* +DcimConsolePortTemplatesPartialUpdate dcim console port templates partial update API +*/ +func (a *Client) DcimConsolePortTemplatesPartialUpdate(params *DcimConsolePortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/console-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesPartialUpdateOK), nil + +} + +/* +DcimConsolePortTemplatesRead dcim console port templates read API +*/ +func (a *Client) DcimConsolePortTemplatesRead(params *DcimConsolePortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_read", + Method: "GET", + PathPattern: "/dcim/console-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesReadOK), nil + +} + +/* +DcimConsolePortTemplatesUpdate dcim console port templates update API +*/ +func (a *Client) DcimConsolePortTemplatesUpdate(params *DcimConsolePortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-port-templates_update", + Method: "PUT", + PathPattern: "/dcim/console-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortTemplatesUpdateOK), nil + +} + +/* +DcimConsolePortsCreate dcim console ports create API +*/ +func (a *Client) DcimConsolePortsCreate(params *DcimConsolePortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_create", + Method: "POST", + PathPattern: "/dcim/console-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsCreateCreated), nil + +} + +/* +DcimConsolePortsDelete dcim console ports delete API +*/ +func (a *Client) DcimConsolePortsDelete(params *DcimConsolePortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_delete", + Method: "DELETE", + PathPattern: "/dcim/console-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsDeleteNoContent), nil + +} + +/* +DcimConsolePortsList dcim console ports list API +*/ +func (a *Client) DcimConsolePortsList(params *DcimConsolePortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_list", + Method: "GET", + PathPattern: "/dcim/console-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsListOK), nil + +} + +/* +DcimConsolePortsPartialUpdate dcim console ports partial update API +*/ +func (a *Client) DcimConsolePortsPartialUpdate(params *DcimConsolePortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_partial_update", + Method: "PATCH", + PathPattern: "/dcim/console-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsPartialUpdateOK), nil + +} + +/* +DcimConsolePortsRead dcim console ports read API +*/ +func (a *Client) DcimConsolePortsRead(params *DcimConsolePortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_read", + Method: "GET", + PathPattern: "/dcim/console-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsReadOK), nil + +} + +/* +DcimConsolePortsUpdate dcim console ports update API +*/ +func (a *Client) DcimConsolePortsUpdate(params *DcimConsolePortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsolePortsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsolePortsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-ports_update", + Method: "PUT", + PathPattern: "/dcim/console-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsolePortsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsolePortsUpdateOK), nil + +} + +/* +DcimConsoleServerPortTemplatesCreate dcim console server port templates create API +*/ +func (a *Client) DcimConsoleServerPortTemplatesCreate(params *DcimConsoleServerPortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_create", + Method: "POST", + PathPattern: "/dcim/console-server-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesCreateCreated), nil + +} + +/* +DcimConsoleServerPortTemplatesDelete dcim console server port templates delete API +*/ +func (a *Client) DcimConsoleServerPortTemplatesDelete(params *DcimConsoleServerPortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/console-server-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesDeleteNoContent), nil + +} + +/* +DcimConsoleServerPortTemplatesList dcim console server port templates list API +*/ +func (a *Client) DcimConsoleServerPortTemplatesList(params *DcimConsoleServerPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_list", + Method: "GET", + PathPattern: "/dcim/console-server-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesListOK), nil + +} + +/* +DcimConsoleServerPortTemplatesPartialUpdate dcim console server port templates partial update API +*/ +func (a *Client) DcimConsoleServerPortTemplatesPartialUpdate(params *DcimConsoleServerPortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/console-server-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesPartialUpdateOK), nil + +} + +/* +DcimConsoleServerPortTemplatesRead dcim console server port templates read API +*/ +func (a *Client) DcimConsoleServerPortTemplatesRead(params *DcimConsoleServerPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_read", + Method: "GET", + PathPattern: "/dcim/console-server-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesReadOK), nil + +} + +/* +DcimConsoleServerPortTemplatesUpdate dcim console server port templates update API +*/ +func (a *Client) DcimConsoleServerPortTemplatesUpdate(params *DcimConsoleServerPortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-port-templates_update", + Method: "PUT", + PathPattern: "/dcim/console-server-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortTemplatesUpdateOK), nil + +} + +/* +DcimConsoleServerPortsCreate dcim console server ports create API +*/ +func (a *Client) DcimConsoleServerPortsCreate(params *DcimConsoleServerPortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_create", + Method: "POST", + PathPattern: "/dcim/console-server-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsCreateCreated), nil + +} + +/* +DcimConsoleServerPortsDelete dcim console server ports delete API +*/ +func (a *Client) DcimConsoleServerPortsDelete(params *DcimConsoleServerPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_delete", + Method: "DELETE", + PathPattern: "/dcim/console-server-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsDeleteNoContent), nil + +} + +/* +DcimConsoleServerPortsList dcim console server ports list API +*/ +func (a *Client) DcimConsoleServerPortsList(params *DcimConsoleServerPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_list", + Method: "GET", + PathPattern: "/dcim/console-server-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsListOK), nil + +} + +/* +DcimConsoleServerPortsPartialUpdate dcim console server ports partial update API +*/ +func (a *Client) DcimConsoleServerPortsPartialUpdate(params *DcimConsoleServerPortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_partial_update", + Method: "PATCH", + PathPattern: "/dcim/console-server-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsPartialUpdateOK), nil + +} + +/* +DcimConsoleServerPortsRead dcim console server ports read API +*/ +func (a *Client) DcimConsoleServerPortsRead(params *DcimConsoleServerPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_read", + Method: "GET", + PathPattern: "/dcim/console-server-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsReadOK), nil + +} + +/* +DcimConsoleServerPortsUpdate dcim console server ports update API +*/ +func (a *Client) DcimConsoleServerPortsUpdate(params *DcimConsoleServerPortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimConsoleServerPortsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimConsoleServerPortsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_console-server-ports_update", + Method: "PUT", + PathPattern: "/dcim/console-server-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimConsoleServerPortsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimConsoleServerPortsUpdateOK), nil + +} + +/* +DcimDeviceBayTemplatesCreate dcim device bay templates create API +*/ +func (a *Client) DcimDeviceBayTemplatesCreate(params *DcimDeviceBayTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_create", + Method: "POST", + PathPattern: "/dcim/device-bay-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesCreateCreated), nil + +} + +/* +DcimDeviceBayTemplatesDelete dcim device bay templates delete API +*/ +func (a *Client) DcimDeviceBayTemplatesDelete(params *DcimDeviceBayTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/device-bay-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesDeleteNoContent), nil + +} + +/* +DcimDeviceBayTemplatesList dcim device bay templates list API +*/ +func (a *Client) DcimDeviceBayTemplatesList(params *DcimDeviceBayTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_list", + Method: "GET", + PathPattern: "/dcim/device-bay-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesListOK), nil + +} + +/* +DcimDeviceBayTemplatesPartialUpdate dcim device bay templates partial update API +*/ +func (a *Client) DcimDeviceBayTemplatesPartialUpdate(params *DcimDeviceBayTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/device-bay-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesPartialUpdateOK), nil + +} + +/* +DcimDeviceBayTemplatesRead dcim device bay templates read API +*/ +func (a *Client) DcimDeviceBayTemplatesRead(params *DcimDeviceBayTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_read", + Method: "GET", + PathPattern: "/dcim/device-bay-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesReadOK), nil + +} + +/* +DcimDeviceBayTemplatesUpdate dcim device bay templates update API +*/ +func (a *Client) DcimDeviceBayTemplatesUpdate(params *DcimDeviceBayTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBayTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBayTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bay-templates_update", + Method: "PUT", + PathPattern: "/dcim/device-bay-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBayTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBayTemplatesUpdateOK), nil + +} + +/* +DcimDeviceBaysCreate dcim device bays create API +*/ +func (a *Client) DcimDeviceBaysCreate(params *DcimDeviceBaysCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_create", + Method: "POST", + PathPattern: "/dcim/device-bays/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysCreateCreated), nil + +} + +/* +DcimDeviceBaysDelete dcim device bays delete API +*/ +func (a *Client) DcimDeviceBaysDelete(params *DcimDeviceBaysDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_delete", + Method: "DELETE", + PathPattern: "/dcim/device-bays/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysDeleteNoContent), nil + +} + +/* +DcimDeviceBaysList dcim device bays list API +*/ +func (a *Client) DcimDeviceBaysList(params *DcimDeviceBaysListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_list", + Method: "GET", + PathPattern: "/dcim/device-bays/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysListOK), nil + +} + +/* +DcimDeviceBaysPartialUpdate dcim device bays partial update API +*/ +func (a *Client) DcimDeviceBaysPartialUpdate(params *DcimDeviceBaysPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_partial_update", + Method: "PATCH", + PathPattern: "/dcim/device-bays/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysPartialUpdateOK), nil + +} + +/* +DcimDeviceBaysRead dcim device bays read API +*/ +func (a *Client) DcimDeviceBaysRead(params *DcimDeviceBaysReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_read", + Method: "GET", + PathPattern: "/dcim/device-bays/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysReadOK), nil + +} + +/* +DcimDeviceBaysUpdate dcim device bays update API +*/ +func (a *Client) DcimDeviceBaysUpdate(params *DcimDeviceBaysUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceBaysUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceBaysUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-bays_update", + Method: "PUT", + PathPattern: "/dcim/device-bays/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceBaysUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceBaysUpdateOK), nil + +} + +/* +DcimDeviceRolesCreate dcim device roles create API +*/ +func (a *Client) DcimDeviceRolesCreate(params *DcimDeviceRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_create", + Method: "POST", + PathPattern: "/dcim/device-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesCreateCreated), nil + +} + +/* +DcimDeviceRolesDelete dcim device roles delete API +*/ +func (a *Client) DcimDeviceRolesDelete(params *DcimDeviceRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_delete", + Method: "DELETE", + PathPattern: "/dcim/device-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesDeleteNoContent), nil + +} + +/* +DcimDeviceRolesList dcim device roles list API +*/ +func (a *Client) DcimDeviceRolesList(params *DcimDeviceRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_list", + Method: "GET", + PathPattern: "/dcim/device-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesListOK), nil + +} + +/* +DcimDeviceRolesPartialUpdate dcim device roles partial update API +*/ +func (a *Client) DcimDeviceRolesPartialUpdate(params *DcimDeviceRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_partial_update", + Method: "PATCH", + PathPattern: "/dcim/device-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesPartialUpdateOK), nil + +} + +/* +DcimDeviceRolesRead dcim device roles read API +*/ +func (a *Client) DcimDeviceRolesRead(params *DcimDeviceRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_read", + Method: "GET", + PathPattern: "/dcim/device-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesReadOK), nil + +} + +/* +DcimDeviceRolesUpdate dcim device roles update API +*/ +func (a *Client) DcimDeviceRolesUpdate(params *DcimDeviceRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceRolesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-roles_update", + Method: "PUT", + PathPattern: "/dcim/device-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceRolesUpdateOK), nil + +} + +/* +DcimDeviceTypesCreate dcim device types create API +*/ +func (a *Client) DcimDeviceTypesCreate(params *DcimDeviceTypesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_create", + Method: "POST", + PathPattern: "/dcim/device-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesCreateCreated), nil + +} + +/* +DcimDeviceTypesDelete dcim device types delete API +*/ +func (a *Client) DcimDeviceTypesDelete(params *DcimDeviceTypesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_delete", + Method: "DELETE", + PathPattern: "/dcim/device-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesDeleteNoContent), nil + +} + +/* +DcimDeviceTypesList dcim device types list API +*/ +func (a *Client) DcimDeviceTypesList(params *DcimDeviceTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_list", + Method: "GET", + PathPattern: "/dcim/device-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesListOK), nil + +} + +/* +DcimDeviceTypesPartialUpdate dcim device types partial update API +*/ +func (a *Client) DcimDeviceTypesPartialUpdate(params *DcimDeviceTypesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_partial_update", + Method: "PATCH", + PathPattern: "/dcim/device-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesPartialUpdateOK), nil + +} + +/* +DcimDeviceTypesRead dcim device types read API +*/ +func (a *Client) DcimDeviceTypesRead(params *DcimDeviceTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_read", + Method: "GET", + PathPattern: "/dcim/device-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesReadOK), nil + +} + +/* +DcimDeviceTypesUpdate dcim device types update API +*/ +func (a *Client) DcimDeviceTypesUpdate(params *DcimDeviceTypesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDeviceTypesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDeviceTypesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_device-types_update", + Method: "PUT", + PathPattern: "/dcim/device-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDeviceTypesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDeviceTypesUpdateOK), nil + +} + +/* +DcimDevicesCreate dcim devices create API +*/ +func (a *Client) DcimDevicesCreate(params *DcimDevicesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_create", + Method: "POST", + PathPattern: "/dcim/devices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesCreateCreated), nil + +} + +/* +DcimDevicesDelete dcim devices delete API +*/ +func (a *Client) DcimDevicesDelete(params *DcimDevicesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_delete", + Method: "DELETE", + PathPattern: "/dcim/devices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesDeleteNoContent), nil + +} + +/* +DcimDevicesList dcim devices list API +*/ +func (a *Client) DcimDevicesList(params *DcimDevicesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_list", + Method: "GET", + PathPattern: "/dcim/devices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesListOK), nil + +} + +/* +DcimDevicesNapalm Execute a NAPALM method on a Device +*/ +func (a *Client) DcimDevicesNapalm(params *DcimDevicesNapalmParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesNapalmOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesNapalmParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_napalm", + Method: "GET", + PathPattern: "/dcim/devices/{id}/napalm/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesNapalmReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesNapalmOK), nil + +} + +/* +DcimDevicesPartialUpdate dcim devices partial update API +*/ +func (a *Client) DcimDevicesPartialUpdate(params *DcimDevicesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_partial_update", + Method: "PATCH", + PathPattern: "/dcim/devices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesPartialUpdateOK), nil + +} + +/* +DcimDevicesRead dcim devices read API +*/ +func (a *Client) DcimDevicesRead(params *DcimDevicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_read", + Method: "GET", + PathPattern: "/dcim/devices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesReadOK), nil + +} + +/* +DcimDevicesUpdate dcim devices update API +*/ +func (a *Client) DcimDevicesUpdate(params *DcimDevicesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimDevicesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimDevicesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_devices_update", + Method: "PUT", + PathPattern: "/dcim/devices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimDevicesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimDevicesUpdateOK), nil + +} + +/* +DcimInterfaceConnectionsCreate dcim interface connections create API +*/ +func (a *Client) DcimInterfaceConnectionsCreate(params *DcimInterfaceConnectionsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_create", + Method: "POST", + PathPattern: "/dcim/interface-connections/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsCreateCreated), nil + +} + +/* +DcimInterfaceConnectionsDelete dcim interface connections delete API +*/ +func (a *Client) DcimInterfaceConnectionsDelete(params *DcimInterfaceConnectionsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_delete", + Method: "DELETE", + PathPattern: "/dcim/interface-connections/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsDeleteNoContent), nil + +} + +/* +DcimInterfaceConnectionsList dcim interface connections list API +*/ +func (a *Client) DcimInterfaceConnectionsList(params *DcimInterfaceConnectionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_list", + Method: "GET", + PathPattern: "/dcim/interface-connections/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsListOK), nil + +} + +/* +DcimInterfaceConnectionsPartialUpdate dcim interface connections partial update API +*/ +func (a *Client) DcimInterfaceConnectionsPartialUpdate(params *DcimInterfaceConnectionsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_partial_update", + Method: "PATCH", + PathPattern: "/dcim/interface-connections/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsPartialUpdateOK), nil + +} + +/* +DcimInterfaceConnectionsRead dcim interface connections read API +*/ +func (a *Client) DcimInterfaceConnectionsRead(params *DcimInterfaceConnectionsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_read", + Method: "GET", + PathPattern: "/dcim/interface-connections/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsReadOK), nil + +} + +/* +DcimInterfaceConnectionsUpdate dcim interface connections update API +*/ +func (a *Client) DcimInterfaceConnectionsUpdate(params *DcimInterfaceConnectionsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceConnectionsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceConnectionsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-connections_update", + Method: "PUT", + PathPattern: "/dcim/interface-connections/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceConnectionsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceConnectionsUpdateOK), nil + +} + +/* +DcimInterfaceTemplatesCreate dcim interface templates create API +*/ +func (a *Client) DcimInterfaceTemplatesCreate(params *DcimInterfaceTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_create", + Method: "POST", + PathPattern: "/dcim/interface-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesCreateCreated), nil + +} + +/* +DcimInterfaceTemplatesDelete dcim interface templates delete API +*/ +func (a *Client) DcimInterfaceTemplatesDelete(params *DcimInterfaceTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesDeleteNoContent), nil + +} + +/* +DcimInterfaceTemplatesList dcim interface templates list API +*/ +func (a *Client) DcimInterfaceTemplatesList(params *DcimInterfaceTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_list", + Method: "GET", + PathPattern: "/dcim/interface-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesListOK), nil + +} + +/* +DcimInterfaceTemplatesPartialUpdate dcim interface templates partial update API +*/ +func (a *Client) DcimInterfaceTemplatesPartialUpdate(params *DcimInterfaceTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesPartialUpdateOK), nil + +} + +/* +DcimInterfaceTemplatesRead dcim interface templates read API +*/ +func (a *Client) DcimInterfaceTemplatesRead(params *DcimInterfaceTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_read", + Method: "GET", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesReadOK), nil + +} + +/* +DcimInterfaceTemplatesUpdate dcim interface templates update API +*/ +func (a *Client) DcimInterfaceTemplatesUpdate(params *DcimInterfaceTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfaceTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfaceTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interface-templates_update", + Method: "PUT", + PathPattern: "/dcim/interface-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfaceTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfaceTemplatesUpdateOK), nil + +} + +/* +DcimInterfacesCreate dcim interfaces create API +*/ +func (a *Client) DcimInterfacesCreate(params *DcimInterfacesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_create", + Method: "POST", + PathPattern: "/dcim/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesCreateCreated), nil + +} + +/* +DcimInterfacesDelete dcim interfaces delete API +*/ +func (a *Client) DcimInterfacesDelete(params *DcimInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_delete", + Method: "DELETE", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesDeleteNoContent), nil + +} + +/* +DcimInterfacesGraphs A convenience method for rendering graphs for a particular interface. +*/ +func (a *Client) DcimInterfacesGraphs(params *DcimInterfacesGraphsParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesGraphsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesGraphsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_graphs", + Method: "GET", + PathPattern: "/dcim/interfaces/{id}/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesGraphsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesGraphsOK), nil + +} + +/* +DcimInterfacesList dcim interfaces list API +*/ +func (a *Client) DcimInterfacesList(params *DcimInterfacesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_list", + Method: "GET", + PathPattern: "/dcim/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesListOK), nil + +} + +/* +DcimInterfacesPartialUpdate dcim interfaces partial update API +*/ +func (a *Client) DcimInterfacesPartialUpdate(params *DcimInterfacesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_partial_update", + Method: "PATCH", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesPartialUpdateOK), nil + +} + +/* +DcimInterfacesRead dcim interfaces read API +*/ +func (a *Client) DcimInterfacesRead(params *DcimInterfacesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_read", + Method: "GET", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesReadOK), nil + +} + +/* +DcimInterfacesUpdate dcim interfaces update API +*/ +func (a *Client) DcimInterfacesUpdate(params *DcimInterfacesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInterfacesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInterfacesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_interfaces_update", + Method: "PUT", + PathPattern: "/dcim/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInterfacesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInterfacesUpdateOK), nil + +} + +/* +DcimInventoryItemsCreate dcim inventory items create API +*/ +func (a *Client) DcimInventoryItemsCreate(params *DcimInventoryItemsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_create", + Method: "POST", + PathPattern: "/dcim/inventory-items/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsCreateCreated), nil + +} + +/* +DcimInventoryItemsDelete dcim inventory items delete API +*/ +func (a *Client) DcimInventoryItemsDelete(params *DcimInventoryItemsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_delete", + Method: "DELETE", + PathPattern: "/dcim/inventory-items/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsDeleteNoContent), nil + +} + +/* +DcimInventoryItemsList dcim inventory items list API +*/ +func (a *Client) DcimInventoryItemsList(params *DcimInventoryItemsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_list", + Method: "GET", + PathPattern: "/dcim/inventory-items/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsListOK), nil + +} + +/* +DcimInventoryItemsPartialUpdate dcim inventory items partial update API +*/ +func (a *Client) DcimInventoryItemsPartialUpdate(params *DcimInventoryItemsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_partial_update", + Method: "PATCH", + PathPattern: "/dcim/inventory-items/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsPartialUpdateOK), nil + +} + +/* +DcimInventoryItemsRead dcim inventory items read API +*/ +func (a *Client) DcimInventoryItemsRead(params *DcimInventoryItemsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_read", + Method: "GET", + PathPattern: "/dcim/inventory-items/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsReadOK), nil + +} + +/* +DcimInventoryItemsUpdate dcim inventory items update API +*/ +func (a *Client) DcimInventoryItemsUpdate(params *DcimInventoryItemsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimInventoryItemsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimInventoryItemsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_inventory-items_update", + Method: "PUT", + PathPattern: "/dcim/inventory-items/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimInventoryItemsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimInventoryItemsUpdateOK), nil + +} + +/* +DcimManufacturersCreate dcim manufacturers create API +*/ +func (a *Client) DcimManufacturersCreate(params *DcimManufacturersCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_create", + Method: "POST", + PathPattern: "/dcim/manufacturers/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersCreateCreated), nil + +} + +/* +DcimManufacturersDelete dcim manufacturers delete API +*/ +func (a *Client) DcimManufacturersDelete(params *DcimManufacturersDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_delete", + Method: "DELETE", + PathPattern: "/dcim/manufacturers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersDeleteNoContent), nil + +} + +/* +DcimManufacturersList dcim manufacturers list API +*/ +func (a *Client) DcimManufacturersList(params *DcimManufacturersListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_list", + Method: "GET", + PathPattern: "/dcim/manufacturers/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersListOK), nil + +} + +/* +DcimManufacturersPartialUpdate dcim manufacturers partial update API +*/ +func (a *Client) DcimManufacturersPartialUpdate(params *DcimManufacturersPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_partial_update", + Method: "PATCH", + PathPattern: "/dcim/manufacturers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersPartialUpdateOK), nil + +} + +/* +DcimManufacturersRead dcim manufacturers read API +*/ +func (a *Client) DcimManufacturersRead(params *DcimManufacturersReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_read", + Method: "GET", + PathPattern: "/dcim/manufacturers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersReadOK), nil + +} + +/* +DcimManufacturersUpdate dcim manufacturers update API +*/ +func (a *Client) DcimManufacturersUpdate(params *DcimManufacturersUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimManufacturersUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimManufacturersUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_manufacturers_update", + Method: "PUT", + PathPattern: "/dcim/manufacturers/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimManufacturersUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimManufacturersUpdateOK), nil + +} + +/* +DcimPlatformsCreate dcim platforms create API +*/ +func (a *Client) DcimPlatformsCreate(params *DcimPlatformsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_create", + Method: "POST", + PathPattern: "/dcim/platforms/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsCreateCreated), nil + +} + +/* +DcimPlatformsDelete dcim platforms delete API +*/ +func (a *Client) DcimPlatformsDelete(params *DcimPlatformsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_delete", + Method: "DELETE", + PathPattern: "/dcim/platforms/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsDeleteNoContent), nil + +} + +/* +DcimPlatformsList dcim platforms list API +*/ +func (a *Client) DcimPlatformsList(params *DcimPlatformsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_list", + Method: "GET", + PathPattern: "/dcim/platforms/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsListOK), nil + +} + +/* +DcimPlatformsPartialUpdate dcim platforms partial update API +*/ +func (a *Client) DcimPlatformsPartialUpdate(params *DcimPlatformsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_partial_update", + Method: "PATCH", + PathPattern: "/dcim/platforms/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsPartialUpdateOK), nil + +} + +/* +DcimPlatformsRead dcim platforms read API +*/ +func (a *Client) DcimPlatformsRead(params *DcimPlatformsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_read", + Method: "GET", + PathPattern: "/dcim/platforms/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsReadOK), nil + +} + +/* +DcimPlatformsUpdate dcim platforms update API +*/ +func (a *Client) DcimPlatformsUpdate(params *DcimPlatformsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPlatformsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPlatformsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_platforms_update", + Method: "PUT", + PathPattern: "/dcim/platforms/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPlatformsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPlatformsUpdateOK), nil + +} + +/* +DcimPowerConnectionsList dcim power connections list API +*/ +func (a *Client) DcimPowerConnectionsList(params *DcimPowerConnectionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerConnectionsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerConnectionsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-connections_list", + Method: "GET", + PathPattern: "/dcim/power-connections/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerConnectionsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerConnectionsListOK), nil + +} + +/* +DcimPowerOutletTemplatesCreate dcim power outlet templates create API +*/ +func (a *Client) DcimPowerOutletTemplatesCreate(params *DcimPowerOutletTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_create", + Method: "POST", + PathPattern: "/dcim/power-outlet-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesCreateCreated), nil + +} + +/* +DcimPowerOutletTemplatesDelete dcim power outlet templates delete API +*/ +func (a *Client) DcimPowerOutletTemplatesDelete(params *DcimPowerOutletTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/power-outlet-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesDeleteNoContent), nil + +} + +/* +DcimPowerOutletTemplatesList dcim power outlet templates list API +*/ +func (a *Client) DcimPowerOutletTemplatesList(params *DcimPowerOutletTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_list", + Method: "GET", + PathPattern: "/dcim/power-outlet-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesListOK), nil + +} + +/* +DcimPowerOutletTemplatesPartialUpdate dcim power outlet templates partial update API +*/ +func (a *Client) DcimPowerOutletTemplatesPartialUpdate(params *DcimPowerOutletTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-outlet-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesPartialUpdateOK), nil + +} + +/* +DcimPowerOutletTemplatesRead dcim power outlet templates read API +*/ +func (a *Client) DcimPowerOutletTemplatesRead(params *DcimPowerOutletTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_read", + Method: "GET", + PathPattern: "/dcim/power-outlet-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesReadOK), nil + +} + +/* +DcimPowerOutletTemplatesUpdate dcim power outlet templates update API +*/ +func (a *Client) DcimPowerOutletTemplatesUpdate(params *DcimPowerOutletTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlet-templates_update", + Method: "PUT", + PathPattern: "/dcim/power-outlet-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletTemplatesUpdateOK), nil + +} + +/* +DcimPowerOutletsCreate dcim power outlets create API +*/ +func (a *Client) DcimPowerOutletsCreate(params *DcimPowerOutletsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_create", + Method: "POST", + PathPattern: "/dcim/power-outlets/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsCreateCreated), nil + +} + +/* +DcimPowerOutletsDelete dcim power outlets delete API +*/ +func (a *Client) DcimPowerOutletsDelete(params *DcimPowerOutletsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_delete", + Method: "DELETE", + PathPattern: "/dcim/power-outlets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsDeleteNoContent), nil + +} + +/* +DcimPowerOutletsList dcim power outlets list API +*/ +func (a *Client) DcimPowerOutletsList(params *DcimPowerOutletsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_list", + Method: "GET", + PathPattern: "/dcim/power-outlets/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsListOK), nil + +} + +/* +DcimPowerOutletsPartialUpdate dcim power outlets partial update API +*/ +func (a *Client) DcimPowerOutletsPartialUpdate(params *DcimPowerOutletsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-outlets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsPartialUpdateOK), nil + +} + +/* +DcimPowerOutletsRead dcim power outlets read API +*/ +func (a *Client) DcimPowerOutletsRead(params *DcimPowerOutletsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_read", + Method: "GET", + PathPattern: "/dcim/power-outlets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsReadOK), nil + +} + +/* +DcimPowerOutletsUpdate dcim power outlets update API +*/ +func (a *Client) DcimPowerOutletsUpdate(params *DcimPowerOutletsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerOutletsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerOutletsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-outlets_update", + Method: "PUT", + PathPattern: "/dcim/power-outlets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerOutletsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerOutletsUpdateOK), nil + +} + +/* +DcimPowerPortTemplatesCreate dcim power port templates create API +*/ +func (a *Client) DcimPowerPortTemplatesCreate(params *DcimPowerPortTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_create", + Method: "POST", + PathPattern: "/dcim/power-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesCreateCreated), nil + +} + +/* +DcimPowerPortTemplatesDelete dcim power port templates delete API +*/ +func (a *Client) DcimPowerPortTemplatesDelete(params *DcimPowerPortTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_delete", + Method: "DELETE", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesDeleteNoContent), nil + +} + +/* +DcimPowerPortTemplatesList dcim power port templates list API +*/ +func (a *Client) DcimPowerPortTemplatesList(params *DcimPowerPortTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_list", + Method: "GET", + PathPattern: "/dcim/power-port-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesListOK), nil + +} + +/* +DcimPowerPortTemplatesPartialUpdate dcim power port templates partial update API +*/ +func (a *Client) DcimPowerPortTemplatesPartialUpdate(params *DcimPowerPortTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesPartialUpdateOK), nil + +} + +/* +DcimPowerPortTemplatesRead dcim power port templates read API +*/ +func (a *Client) DcimPowerPortTemplatesRead(params *DcimPowerPortTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_read", + Method: "GET", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesReadOK), nil + +} + +/* +DcimPowerPortTemplatesUpdate dcim power port templates update API +*/ +func (a *Client) DcimPowerPortTemplatesUpdate(params *DcimPowerPortTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-port-templates_update", + Method: "PUT", + PathPattern: "/dcim/power-port-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortTemplatesUpdateOK), nil + +} + +/* +DcimPowerPortsCreate dcim power ports create API +*/ +func (a *Client) DcimPowerPortsCreate(params *DcimPowerPortsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_create", + Method: "POST", + PathPattern: "/dcim/power-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsCreateCreated), nil + +} + +/* +DcimPowerPortsDelete dcim power ports delete API +*/ +func (a *Client) DcimPowerPortsDelete(params *DcimPowerPortsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_delete", + Method: "DELETE", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsDeleteNoContent), nil + +} + +/* +DcimPowerPortsList dcim power ports list API +*/ +func (a *Client) DcimPowerPortsList(params *DcimPowerPortsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_list", + Method: "GET", + PathPattern: "/dcim/power-ports/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsListOK), nil + +} + +/* +DcimPowerPortsPartialUpdate dcim power ports partial update API +*/ +func (a *Client) DcimPowerPortsPartialUpdate(params *DcimPowerPortsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_partial_update", + Method: "PATCH", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsPartialUpdateOK), nil + +} + +/* +DcimPowerPortsRead dcim power ports read API +*/ +func (a *Client) DcimPowerPortsRead(params *DcimPowerPortsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_read", + Method: "GET", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsReadOK), nil + +} + +/* +DcimPowerPortsUpdate dcim power ports update API +*/ +func (a *Client) DcimPowerPortsUpdate(params *DcimPowerPortsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimPowerPortsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimPowerPortsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_power-ports_update", + Method: "PUT", + PathPattern: "/dcim/power-ports/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimPowerPortsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimPowerPortsUpdateOK), nil + +} + +/* +DcimRackGroupsCreate dcim rack groups create API +*/ +func (a *Client) DcimRackGroupsCreate(params *DcimRackGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_create", + Method: "POST", + PathPattern: "/dcim/rack-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsCreateCreated), nil + +} + +/* +DcimRackGroupsDelete dcim rack groups delete API +*/ +func (a *Client) DcimRackGroupsDelete(params *DcimRackGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_delete", + Method: "DELETE", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsDeleteNoContent), nil + +} + +/* +DcimRackGroupsList dcim rack groups list API +*/ +func (a *Client) DcimRackGroupsList(params *DcimRackGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_list", + Method: "GET", + PathPattern: "/dcim/rack-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsListOK), nil + +} + +/* +DcimRackGroupsPartialUpdate dcim rack groups partial update API +*/ +func (a *Client) DcimRackGroupsPartialUpdate(params *DcimRackGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsPartialUpdateOK), nil + +} + +/* +DcimRackGroupsRead dcim rack groups read API +*/ +func (a *Client) DcimRackGroupsRead(params *DcimRackGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_read", + Method: "GET", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsReadOK), nil + +} + +/* +DcimRackGroupsUpdate dcim rack groups update API +*/ +func (a *Client) DcimRackGroupsUpdate(params *DcimRackGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-groups_update", + Method: "PUT", + PathPattern: "/dcim/rack-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackGroupsUpdateOK), nil + +} + +/* +DcimRackReservationsCreate dcim rack reservations create API +*/ +func (a *Client) DcimRackReservationsCreate(params *DcimRackReservationsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_create", + Method: "POST", + PathPattern: "/dcim/rack-reservations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsCreateCreated), nil + +} + +/* +DcimRackReservationsDelete dcim rack reservations delete API +*/ +func (a *Client) DcimRackReservationsDelete(params *DcimRackReservationsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_delete", + Method: "DELETE", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsDeleteNoContent), nil + +} + +/* +DcimRackReservationsList dcim rack reservations list API +*/ +func (a *Client) DcimRackReservationsList(params *DcimRackReservationsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_list", + Method: "GET", + PathPattern: "/dcim/rack-reservations/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsListOK), nil + +} + +/* +DcimRackReservationsPartialUpdate dcim rack reservations partial update API +*/ +func (a *Client) DcimRackReservationsPartialUpdate(params *DcimRackReservationsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsPartialUpdateOK), nil + +} + +/* +DcimRackReservationsRead dcim rack reservations read API +*/ +func (a *Client) DcimRackReservationsRead(params *DcimRackReservationsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_read", + Method: "GET", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsReadOK), nil + +} + +/* +DcimRackReservationsUpdate dcim rack reservations update API +*/ +func (a *Client) DcimRackReservationsUpdate(params *DcimRackReservationsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackReservationsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackReservationsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-reservations_update", + Method: "PUT", + PathPattern: "/dcim/rack-reservations/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackReservationsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackReservationsUpdateOK), nil + +} + +/* +DcimRackRolesCreate dcim rack roles create API +*/ +func (a *Client) DcimRackRolesCreate(params *DcimRackRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_create", + Method: "POST", + PathPattern: "/dcim/rack-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesCreateCreated), nil + +} + +/* +DcimRackRolesDelete dcim rack roles delete API +*/ +func (a *Client) DcimRackRolesDelete(params *DcimRackRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_delete", + Method: "DELETE", + PathPattern: "/dcim/rack-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesDeleteNoContent), nil + +} + +/* +DcimRackRolesList dcim rack roles list API +*/ +func (a *Client) DcimRackRolesList(params *DcimRackRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_list", + Method: "GET", + PathPattern: "/dcim/rack-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesListOK), nil + +} + +/* +DcimRackRolesPartialUpdate dcim rack roles partial update API +*/ +func (a *Client) DcimRackRolesPartialUpdate(params *DcimRackRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_partial_update", + Method: "PATCH", + PathPattern: "/dcim/rack-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesPartialUpdateOK), nil + +} + +/* +DcimRackRolesRead dcim rack roles read API +*/ +func (a *Client) DcimRackRolesRead(params *DcimRackRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_read", + Method: "GET", + PathPattern: "/dcim/rack-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesReadOK), nil + +} + +/* +DcimRackRolesUpdate dcim rack roles update API +*/ +func (a *Client) DcimRackRolesUpdate(params *DcimRackRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRackRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRackRolesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_rack-roles_update", + Method: "PUT", + PathPattern: "/dcim/rack-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRackRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRackRolesUpdateOK), nil + +} + +/* +DcimRacksCreate dcim racks create API +*/ +func (a *Client) DcimRacksCreate(params *DcimRacksCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_create", + Method: "POST", + PathPattern: "/dcim/racks/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksCreateCreated), nil + +} + +/* +DcimRacksDelete dcim racks delete API +*/ +func (a *Client) DcimRacksDelete(params *DcimRacksDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_delete", + Method: "DELETE", + PathPattern: "/dcim/racks/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksDeleteNoContent), nil + +} + +/* +DcimRacksList dcim racks list API +*/ +func (a *Client) DcimRacksList(params *DcimRacksListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_list", + Method: "GET", + PathPattern: "/dcim/racks/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksListOK), nil + +} + +/* +DcimRacksPartialUpdate dcim racks partial update API +*/ +func (a *Client) DcimRacksPartialUpdate(params *DcimRacksPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_partial_update", + Method: "PATCH", + PathPattern: "/dcim/racks/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksPartialUpdateOK), nil + +} + +/* +DcimRacksRead dcim racks read API +*/ +func (a *Client) DcimRacksRead(params *DcimRacksReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_read", + Method: "GET", + PathPattern: "/dcim/racks/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksReadOK), nil + +} + +/* +DcimRacksUnits List rack units (by rack) +*/ +func (a *Client) DcimRacksUnits(params *DcimRacksUnitsParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksUnitsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksUnitsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_units", + Method: "GET", + PathPattern: "/dcim/racks/{id}/units/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksUnitsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksUnitsOK), nil + +} + +/* +DcimRacksUpdate dcim racks update API +*/ +func (a *Client) DcimRacksUpdate(params *DcimRacksUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRacksUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRacksUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_racks_update", + Method: "PUT", + PathPattern: "/dcim/racks/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRacksUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRacksUpdateOK), nil + +} + +/* +DcimRegionsCreate dcim regions create API +*/ +func (a *Client) DcimRegionsCreate(params *DcimRegionsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_create", + Method: "POST", + PathPattern: "/dcim/regions/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsCreateCreated), nil + +} + +/* +DcimRegionsDelete dcim regions delete API +*/ +func (a *Client) DcimRegionsDelete(params *DcimRegionsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_delete", + Method: "DELETE", + PathPattern: "/dcim/regions/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsDeleteNoContent), nil + +} + +/* +DcimRegionsList dcim regions list API +*/ +func (a *Client) DcimRegionsList(params *DcimRegionsListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_list", + Method: "GET", + PathPattern: "/dcim/regions/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsListOK), nil + +} + +/* +DcimRegionsPartialUpdate dcim regions partial update API +*/ +func (a *Client) DcimRegionsPartialUpdate(params *DcimRegionsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_partial_update", + Method: "PATCH", + PathPattern: "/dcim/regions/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsPartialUpdateOK), nil + +} + +/* +DcimRegionsRead dcim regions read API +*/ +func (a *Client) DcimRegionsRead(params *DcimRegionsReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_read", + Method: "GET", + PathPattern: "/dcim/regions/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsReadOK), nil + +} + +/* +DcimRegionsUpdate dcim regions update API +*/ +func (a *Client) DcimRegionsUpdate(params *DcimRegionsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimRegionsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimRegionsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_regions_update", + Method: "PUT", + PathPattern: "/dcim/regions/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimRegionsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimRegionsUpdateOK), nil + +} + +/* +DcimSitesCreate dcim sites create API +*/ +func (a *Client) DcimSitesCreate(params *DcimSitesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_create", + Method: "POST", + PathPattern: "/dcim/sites/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesCreateCreated), nil + +} + +/* +DcimSitesDelete dcim sites delete API +*/ +func (a *Client) DcimSitesDelete(params *DcimSitesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_delete", + Method: "DELETE", + PathPattern: "/dcim/sites/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesDeleteNoContent), nil + +} + +/* +DcimSitesGraphs A convenience method for rendering graphs for a particular site. +*/ +func (a *Client) DcimSitesGraphs(params *DcimSitesGraphsParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesGraphsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesGraphsParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_graphs", + Method: "GET", + PathPattern: "/dcim/sites/{id}/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesGraphsReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesGraphsOK), nil + +} + +/* +DcimSitesList dcim sites list API +*/ +func (a *Client) DcimSitesList(params *DcimSitesListParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_list", + Method: "GET", + PathPattern: "/dcim/sites/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesListOK), nil + +} + +/* +DcimSitesPartialUpdate dcim sites partial update API +*/ +func (a *Client) DcimSitesPartialUpdate(params *DcimSitesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_partial_update", + Method: "PATCH", + PathPattern: "/dcim/sites/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesPartialUpdateOK), nil + +} + +/* +DcimSitesRead dcim sites read API +*/ +func (a *Client) DcimSitesRead(params *DcimSitesReadParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_read", + Method: "GET", + PathPattern: "/dcim/sites/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesReadOK), nil + +} + +/* +DcimSitesUpdate dcim sites update API +*/ +func (a *Client) DcimSitesUpdate(params *DcimSitesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*DcimSitesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDcimSitesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "dcim_sites_update", + Method: "PUT", + PathPattern: "/dcim/sites/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DcimSitesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*DcimSitesUpdateOK), 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_connected_device_list_parameters.go b/netbox/client/dcim/dcim_connected_device_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0eeaf0a5b28a9ea5a9e44cecac2d02f7b7240dd4 --- /dev/null +++ b/netbox/client/dcim/dcim_connected_device_list_parameters.go @@ -0,0 +1,114 @@ +// 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" +) + +// NewDcimConnectedDeviceListParams creates a new DcimConnectedDeviceListParams object +// with the default values initialized. +func NewDcimConnectedDeviceListParams() *DcimConnectedDeviceListParams { + + return &DcimConnectedDeviceListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConnectedDeviceListParamsWithTimeout creates a new DcimConnectedDeviceListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConnectedDeviceListParamsWithTimeout(timeout time.Duration) *DcimConnectedDeviceListParams { + + return &DcimConnectedDeviceListParams{ + + timeout: timeout, + } +} + +// NewDcimConnectedDeviceListParamsWithContext creates a new DcimConnectedDeviceListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConnectedDeviceListParamsWithContext(ctx context.Context) *DcimConnectedDeviceListParams { + + return &DcimConnectedDeviceListParams{ + + Context: ctx, + } +} + +// NewDcimConnectedDeviceListParamsWithHTTPClient creates a new DcimConnectedDeviceListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConnectedDeviceListParamsWithHTTPClient(client *http.Client) *DcimConnectedDeviceListParams { + + return &DcimConnectedDeviceListParams{ + HTTPClient: client, + } +} + +/*DcimConnectedDeviceListParams contains all the parameters to send to the API endpoint +for the dcim connected device list operation typically these are written to a http.Request +*/ +type DcimConnectedDeviceListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) WithTimeout(timeout time.Duration) *DcimConnectedDeviceListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) WithContext(ctx context.Context) *DcimConnectedDeviceListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) WithHTTPClient(client *http.Client) *DcimConnectedDeviceListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim connected device list params +func (o *DcimConnectedDeviceListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConnectedDeviceListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_connected_device_list_responses.go b/netbox/client/dcim/dcim_connected_device_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d444c3089ec98140dc2435e44190cab2514d15ec --- /dev/null +++ b/netbox/client/dcim/dcim_connected_device_list_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" +) + +// DcimConnectedDeviceListReader is a Reader for the DcimConnectedDeviceList structure. +type DcimConnectedDeviceListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConnectedDeviceListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConnectedDeviceListOK() + 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()) + } +} + +// NewDcimConnectedDeviceListOK creates a DcimConnectedDeviceListOK with default headers values +func NewDcimConnectedDeviceListOK() *DcimConnectedDeviceListOK { + return &DcimConnectedDeviceListOK{} +} + +/*DcimConnectedDeviceListOK handles this case with default header values. + +DcimConnectedDeviceListOK dcim connected device list o k +*/ +type DcimConnectedDeviceListOK struct { +} + +func (o *DcimConnectedDeviceListOK) Error() string { + return fmt.Sprintf("[GET /dcim/connected-device/][%d] dcimConnectedDeviceListOK ", 200) +} + +func (o *DcimConnectedDeviceListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_console_connections_list_parameters.go b/netbox/client/dcim/dcim_console_connections_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..091e8eb360e14b882da1492cc9658759fe943c93 --- /dev/null +++ b/netbox/client/dcim/dcim_console_connections_list_parameters.go @@ -0,0 +1,297 @@ +// 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" +) + +// NewDcimConsoleConnectionsListParams creates a new DcimConsoleConnectionsListParams object +// with the default values initialized. +func NewDcimConsoleConnectionsListParams() *DcimConsoleConnectionsListParams { + var () + return &DcimConsoleConnectionsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleConnectionsListParamsWithTimeout creates a new DcimConsoleConnectionsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleConnectionsListParamsWithTimeout(timeout time.Duration) *DcimConsoleConnectionsListParams { + var () + return &DcimConsoleConnectionsListParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleConnectionsListParamsWithContext creates a new DcimConsoleConnectionsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleConnectionsListParamsWithContext(ctx context.Context) *DcimConsoleConnectionsListParams { + var () + return &DcimConsoleConnectionsListParams{ + + Context: ctx, + } +} + +// NewDcimConsoleConnectionsListParamsWithHTTPClient creates a new DcimConsoleConnectionsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleConnectionsListParamsWithHTTPClient(client *http.Client) *DcimConsoleConnectionsListParams { + var () + return &DcimConsoleConnectionsListParams{ + HTTPClient: client, + } +} + +/*DcimConsoleConnectionsListParams contains all the parameters to send to the API endpoint +for the dcim console connections list operation typically these are written to a http.Request +*/ +type DcimConsoleConnectionsListParams struct { + + /*ConnectionStatus*/ + ConnectionStatus *string + /*Device*/ + Device *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithTimeout(timeout time.Duration) *DcimConsoleConnectionsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithContext(ctx context.Context) *DcimConsoleConnectionsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithHTTPClient(client *http.Client) *DcimConsoleConnectionsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionStatus adds the connectionStatus to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithConnectionStatus(connectionStatus *string) *DcimConsoleConnectionsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDevice adds the device to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithDevice(device *string) *DcimConsoleConnectionsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithLimit adds the limit to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithLimit(limit *int64) *DcimConsoleConnectionsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithName(name *string) *DcimConsoleConnectionsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithOffset(offset *int64) *DcimConsoleConnectionsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) WithSite(site *string) *DcimConsoleConnectionsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim console connections list params +func (o *DcimConsoleConnectionsListParams) SetSite(site *string) { + o.Site = site +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleConnectionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_connections_list_responses.go b/netbox/client/dcim/dcim_console_connections_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..012f0f5a66c620584f1813bdcc35659533b49617 --- /dev/null +++ b/netbox/client/dcim/dcim_console_connections_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" +) + +// DcimConsoleConnectionsListReader is a Reader for the DcimConsoleConnectionsList structure. +type DcimConsoleConnectionsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleConnectionsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleConnectionsListOK() + 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()) + } +} + +// NewDcimConsoleConnectionsListOK creates a DcimConsoleConnectionsListOK with default headers values +func NewDcimConsoleConnectionsListOK() *DcimConsoleConnectionsListOK { + return &DcimConsoleConnectionsListOK{} +} + +/*DcimConsoleConnectionsListOK handles this case with default header values. + +DcimConsoleConnectionsListOK dcim console connections list o k +*/ +type DcimConsoleConnectionsListOK struct { + Payload *models.DcimConsoleConnectionsListOKBody +} + +func (o *DcimConsoleConnectionsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-connections/][%d] dcimConsoleConnectionsListOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsoleConnectionsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_create_parameters.go b/netbox/client/dcim/dcim_console_port_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..80668ec502c022bb261d037843ee50b56af23f7f --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// NewDcimConsolePortTemplatesCreateParams creates a new DcimConsolePortTemplatesCreateParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesCreateParams() *DcimConsolePortTemplatesCreateParams { + var () + return &DcimConsolePortTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesCreateParamsWithTimeout creates a new DcimConsolePortTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesCreateParams { + var () + return &DcimConsolePortTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesCreateParamsWithContext creates a new DcimConsolePortTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesCreateParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesCreateParams { + var () + return &DcimConsolePortTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesCreateParamsWithHTTPClient creates a new DcimConsolePortTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesCreateParams { + var () + return &DcimConsolePortTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim console port templates create operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableConsolePortTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) WithData(data *models.WritableConsolePortTemplate) *DcimConsolePortTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console port templates create params +func (o *DcimConsolePortTemplatesCreateParams) SetData(data *models.WritableConsolePortTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesCreateParams) 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_console_port_templates_create_responses.go b/netbox/client/dcim/dcim_console_port_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..de7b61f60f503dcff3e13a5fbacc6dd78b9f6976 --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// DcimConsolePortTemplatesCreateReader is a Reader for the DcimConsolePortTemplatesCreate structure. +type DcimConsolePortTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimConsolePortTemplatesCreateCreated() + 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()) + } +} + +// NewDcimConsolePortTemplatesCreateCreated creates a DcimConsolePortTemplatesCreateCreated with default headers values +func NewDcimConsolePortTemplatesCreateCreated() *DcimConsolePortTemplatesCreateCreated { + return &DcimConsolePortTemplatesCreateCreated{} +} + +/*DcimConsolePortTemplatesCreateCreated handles this case with default header values. + +DcimConsolePortTemplatesCreateCreated dcim console port templates create created +*/ +type DcimConsolePortTemplatesCreateCreated struct { + Payload *models.WritableConsolePortTemplate +} + +func (o *DcimConsolePortTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/console-port-templates/][%d] dcimConsolePortTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimConsolePortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go b/netbox/client/dcim/dcim_console_port_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f4cbf52a0c5eb71f0c0fc6070c153b84c030947c --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// NewDcimConsolePortTemplatesDeleteParams creates a new DcimConsolePortTemplatesDeleteParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesDeleteParams() *DcimConsolePortTemplatesDeleteParams { + var () + return &DcimConsolePortTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesDeleteParamsWithTimeout creates a new DcimConsolePortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesDeleteParams { + var () + return &DcimConsolePortTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesDeleteParamsWithContext creates a new DcimConsolePortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesDeleteParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesDeleteParams { + var () + return &DcimConsolePortTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesDeleteParamsWithHTTPClient creates a new DcimConsolePortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesDeleteParams { + var () + return &DcimConsolePortTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim console port templates delete operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this console port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) WithID(id int64) *DcimConsolePortTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates delete params +func (o *DcimConsolePortTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_delete_responses.go b/netbox/client/dcim/dcim_console_port_templates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1d32e6484e204516972e34f72b06a1a7788b041f --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// DcimConsolePortTemplatesDeleteReader is a Reader for the DcimConsolePortTemplatesDelete structure. +type DcimConsolePortTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimConsolePortTemplatesDeleteNoContent() + 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()) + } +} + +// NewDcimConsolePortTemplatesDeleteNoContent creates a DcimConsolePortTemplatesDeleteNoContent with default headers values +func NewDcimConsolePortTemplatesDeleteNoContent() *DcimConsolePortTemplatesDeleteNoContent { + return &DcimConsolePortTemplatesDeleteNoContent{} +} + +/*DcimConsolePortTemplatesDeleteNoContent handles this case with default header values. + +DcimConsolePortTemplatesDeleteNoContent dcim console port templates delete no content +*/ +type DcimConsolePortTemplatesDeleteNoContent struct { +} + +func (o *DcimConsolePortTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/console-port-templates/{id}/][%d] dcimConsolePortTemplatesDeleteNoContent ", 204) +} + +func (o *DcimConsolePortTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_list_parameters.go b/netbox/client/dcim/dcim_console_port_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..46b34cf3d6b26e9a8252740edbdd9de7fda10f1b --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_list_parameters.go @@ -0,0 +1,239 @@ +// 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" +) + +// NewDcimConsolePortTemplatesListParams creates a new DcimConsolePortTemplatesListParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesListParams() *DcimConsolePortTemplatesListParams { + var () + return &DcimConsolePortTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesListParamsWithTimeout creates a new DcimConsolePortTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesListParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesListParams { + var () + return &DcimConsolePortTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesListParamsWithContext creates a new DcimConsolePortTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesListParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesListParams { + var () + return &DcimConsolePortTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesListParamsWithHTTPClient creates a new DcimConsolePortTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesListParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesListParams { + var () + return &DcimConsolePortTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim console port templates list operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimConsolePortTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithLimit(limit *int64) *DcimConsolePortTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithName(name *string) *DcimConsolePortTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) WithOffset(offset *int64) *DcimConsolePortTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console port templates list params +func (o *DcimConsolePortTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_list_responses.go b/netbox/client/dcim/dcim_console_port_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..75b2d6275a173e1a6062dbbfc9f105cb57f59e78 --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// DcimConsolePortTemplatesListReader is a Reader for the DcimConsolePortTemplatesList structure. +type DcimConsolePortTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortTemplatesListOK() + 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()) + } +} + +// NewDcimConsolePortTemplatesListOK creates a DcimConsolePortTemplatesListOK with default headers values +func NewDcimConsolePortTemplatesListOK() *DcimConsolePortTemplatesListOK { + return &DcimConsolePortTemplatesListOK{} +} + +/*DcimConsolePortTemplatesListOK handles this case with default header values. + +DcimConsolePortTemplatesListOK dcim console port templates list o k +*/ +type DcimConsolePortTemplatesListOK struct { + Payload *models.DcimConsolePortTemplatesListOKBody +} + +func (o *DcimConsolePortTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-port-templates/][%d] dcimConsolePortTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsolePortTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_console_port_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b8b72aa2a8fe600fabe77a1579c27f915992b0f6 --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// NewDcimConsolePortTemplatesPartialUpdateParams creates a new DcimConsolePortTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesPartialUpdateParams() *DcimConsolePortTemplatesPartialUpdateParams { + var () + return &DcimConsolePortTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesPartialUpdateParamsWithTimeout creates a new DcimConsolePortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesPartialUpdateParams { + var () + return &DcimConsolePortTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesPartialUpdateParamsWithContext creates a new DcimConsolePortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesPartialUpdateParams { + var () + return &DcimConsolePortTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimConsolePortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesPartialUpdateParams { + var () + return &DcimConsolePortTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim console port templates partial update operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConsolePortTemplate + /*ID + A unique integer value identifying this console port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithData(data *models.WritableConsolePortTemplate) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetData(data *models.WritableConsolePortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) WithID(id int64) *DcimConsolePortTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates partial update params +func (o *DcimConsolePortTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesPartialUpdateParams) 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_console_port_templates_partial_update_responses.go b/netbox/client/dcim/dcim_console_port_templates_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..91ba50f6de3af0c750ae2d702d38e6bb02bed463 --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// DcimConsolePortTemplatesPartialUpdateReader is a Reader for the DcimConsolePortTemplatesPartialUpdate structure. +type DcimConsolePortTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortTemplatesPartialUpdateOK() + 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()) + } +} + +// NewDcimConsolePortTemplatesPartialUpdateOK creates a DcimConsolePortTemplatesPartialUpdateOK with default headers values +func NewDcimConsolePortTemplatesPartialUpdateOK() *DcimConsolePortTemplatesPartialUpdateOK { + return &DcimConsolePortTemplatesPartialUpdateOK{} +} + +/*DcimConsolePortTemplatesPartialUpdateOK handles this case with default header values. + +DcimConsolePortTemplatesPartialUpdateOK dcim console port templates partial update o k +*/ +type DcimConsolePortTemplatesPartialUpdateOK struct { + Payload *models.WritableConsolePortTemplate +} + +func (o *DcimConsolePortTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/console-port-templates/{id}/][%d] dcimConsolePortTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_read_parameters.go b/netbox/client/dcim/dcim_console_port_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..68efb402bd7c97161697623308644e74b1474dbd --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// NewDcimConsolePortTemplatesReadParams creates a new DcimConsolePortTemplatesReadParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesReadParams() *DcimConsolePortTemplatesReadParams { + var () + return &DcimConsolePortTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesReadParamsWithTimeout creates a new DcimConsolePortTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesReadParams { + var () + return &DcimConsolePortTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesReadParamsWithContext creates a new DcimConsolePortTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesReadParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesReadParams { + var () + return &DcimConsolePortTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesReadParamsWithHTTPClient creates a new DcimConsolePortTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesReadParams { + var () + return &DcimConsolePortTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim console port templates read operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesReadParams struct { + + /*ID + A unique integer value identifying this console port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) WithID(id int64) *DcimConsolePortTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates read params +func (o *DcimConsolePortTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_read_responses.go b/netbox/client/dcim/dcim_console_port_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b7df02cd1cfed1207bbbaa863fd27c4c0e6b138d --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// DcimConsolePortTemplatesReadReader is a Reader for the DcimConsolePortTemplatesRead structure. +type DcimConsolePortTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortTemplatesReadOK() + 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()) + } +} + +// NewDcimConsolePortTemplatesReadOK creates a DcimConsolePortTemplatesReadOK with default headers values +func NewDcimConsolePortTemplatesReadOK() *DcimConsolePortTemplatesReadOK { + return &DcimConsolePortTemplatesReadOK{} +} + +/*DcimConsolePortTemplatesReadOK handles this case with default header values. + +DcimConsolePortTemplatesReadOK dcim console port templates read o k +*/ +type DcimConsolePortTemplatesReadOK struct { + Payload *models.ConsolePortTemplate +} + +func (o *DcimConsolePortTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-port-templates/{id}/][%d] dcimConsolePortTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsolePortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_port_templates_update_parameters.go b/netbox/client/dcim/dcim_console_port_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b08d2e629da42dddf6a3c6f848b2a23fa0c82d7e --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// NewDcimConsolePortTemplatesUpdateParams creates a new DcimConsolePortTemplatesUpdateParams object +// with the default values initialized. +func NewDcimConsolePortTemplatesUpdateParams() *DcimConsolePortTemplatesUpdateParams { + var () + return &DcimConsolePortTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortTemplatesUpdateParamsWithTimeout creates a new DcimConsolePortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimConsolePortTemplatesUpdateParams { + var () + return &DcimConsolePortTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortTemplatesUpdateParamsWithContext creates a new DcimConsolePortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortTemplatesUpdateParamsWithContext(ctx context.Context) *DcimConsolePortTemplatesUpdateParams { + var () + return &DcimConsolePortTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortTemplatesUpdateParamsWithHTTPClient creates a new DcimConsolePortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimConsolePortTemplatesUpdateParams { + var () + return &DcimConsolePortTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim console port templates update operation typically these are written to a http.Request +*/ +type DcimConsolePortTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableConsolePortTemplate + /*ID + A unique integer value identifying this console port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimConsolePortTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithContext(ctx context.Context) *DcimConsolePortTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimConsolePortTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithData(data *models.WritableConsolePortTemplate) *DcimConsolePortTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetData(data *models.WritableConsolePortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) WithID(id int64) *DcimConsolePortTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console port templates update params +func (o *DcimConsolePortTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortTemplatesUpdateParams) 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_console_port_templates_update_responses.go b/netbox/client/dcim/dcim_console_port_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f0c5bb9482e17e171dd1dc6ef01debbfa231102d --- /dev/null +++ b/netbox/client/dcim/dcim_console_port_templates_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" +) + +// DcimConsolePortTemplatesUpdateReader is a Reader for the DcimConsolePortTemplatesUpdate structure. +type DcimConsolePortTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortTemplatesUpdateOK() + 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()) + } +} + +// NewDcimConsolePortTemplatesUpdateOK creates a DcimConsolePortTemplatesUpdateOK with default headers values +func NewDcimConsolePortTemplatesUpdateOK() *DcimConsolePortTemplatesUpdateOK { + return &DcimConsolePortTemplatesUpdateOK{} +} + +/*DcimConsolePortTemplatesUpdateOK handles this case with default header values. + +DcimConsolePortTemplatesUpdateOK dcim console port templates update o k +*/ +type DcimConsolePortTemplatesUpdateOK struct { + Payload *models.WritableConsolePortTemplate +} + +func (o *DcimConsolePortTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/console-port-templates/{id}/][%d] dcimConsolePortTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_create_parameters.go b/netbox/client/dcim/dcim_console_ports_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d2bac82d9bce19e9989da5449631a84ac3befd06 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// NewDcimConsolePortsCreateParams creates a new DcimConsolePortsCreateParams object +// with the default values initialized. +func NewDcimConsolePortsCreateParams() *DcimConsolePortsCreateParams { + var () + return &DcimConsolePortsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsCreateParamsWithTimeout creates a new DcimConsolePortsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsCreateParamsWithTimeout(timeout time.Duration) *DcimConsolePortsCreateParams { + var () + return &DcimConsolePortsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsCreateParamsWithContext creates a new DcimConsolePortsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsCreateParamsWithContext(ctx context.Context) *DcimConsolePortsCreateParams { + var () + return &DcimConsolePortsCreateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsCreateParamsWithHTTPClient creates a new DcimConsolePortsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsCreateParamsWithHTTPClient(client *http.Client) *DcimConsolePortsCreateParams { + var () + return &DcimConsolePortsCreateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsCreateParams contains all the parameters to send to the API endpoint +for the dcim console ports create operation typically these are written to a http.Request +*/ +type DcimConsolePortsCreateParams struct { + + /*Data*/ + Data *models.WritableConsolePort + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) WithTimeout(timeout time.Duration) *DcimConsolePortsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) WithContext(ctx context.Context) *DcimConsolePortsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) WithHTTPClient(client *http.Client) *DcimConsolePortsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) WithData(data *models.WritableConsolePort) *DcimConsolePortsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console ports create params +func (o *DcimConsolePortsCreateParams) SetData(data *models.WritableConsolePort) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsCreateParams) 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_console_ports_create_responses.go b/netbox/client/dcim/dcim_console_ports_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..07138021f1650a9569c5a0e9e63157ba3e9dc060 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// DcimConsolePortsCreateReader is a Reader for the DcimConsolePortsCreate structure. +type DcimConsolePortsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimConsolePortsCreateCreated() + 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()) + } +} + +// NewDcimConsolePortsCreateCreated creates a DcimConsolePortsCreateCreated with default headers values +func NewDcimConsolePortsCreateCreated() *DcimConsolePortsCreateCreated { + return &DcimConsolePortsCreateCreated{} +} + +/*DcimConsolePortsCreateCreated handles this case with default header values. + +DcimConsolePortsCreateCreated dcim console ports create created +*/ +type DcimConsolePortsCreateCreated struct { + Payload *models.WritableConsolePort +} + +func (o *DcimConsolePortsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/console-ports/][%d] dcimConsolePortsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimConsolePortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_delete_parameters.go b/netbox/client/dcim/dcim_console_ports_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..89d3e1710a1cebe420361faec94448e4fb7faa61 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// NewDcimConsolePortsDeleteParams creates a new DcimConsolePortsDeleteParams object +// with the default values initialized. +func NewDcimConsolePortsDeleteParams() *DcimConsolePortsDeleteParams { + var () + return &DcimConsolePortsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsDeleteParamsWithTimeout creates a new DcimConsolePortsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsDeleteParamsWithTimeout(timeout time.Duration) *DcimConsolePortsDeleteParams { + var () + return &DcimConsolePortsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsDeleteParamsWithContext creates a new DcimConsolePortsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsDeleteParamsWithContext(ctx context.Context) *DcimConsolePortsDeleteParams { + var () + return &DcimConsolePortsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsDeleteParamsWithHTTPClient creates a new DcimConsolePortsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsDeleteParamsWithHTTPClient(client *http.Client) *DcimConsolePortsDeleteParams { + var () + return &DcimConsolePortsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsDeleteParams contains all the parameters to send to the API endpoint +for the dcim console ports delete operation typically these are written to a http.Request +*/ +type DcimConsolePortsDeleteParams struct { + + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) WithTimeout(timeout time.Duration) *DcimConsolePortsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) WithContext(ctx context.Context) *DcimConsolePortsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) WithHTTPClient(client *http.Client) *DcimConsolePortsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) WithID(id int64) *DcimConsolePortsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports delete params +func (o *DcimConsolePortsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_delete_responses.go b/netbox/client/dcim/dcim_console_ports_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..dd91b0261942808bb9470e3aca03446438183a68 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// DcimConsolePortsDeleteReader is a Reader for the DcimConsolePortsDelete structure. +type DcimConsolePortsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimConsolePortsDeleteNoContent() + 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()) + } +} + +// NewDcimConsolePortsDeleteNoContent creates a DcimConsolePortsDeleteNoContent with default headers values +func NewDcimConsolePortsDeleteNoContent() *DcimConsolePortsDeleteNoContent { + return &DcimConsolePortsDeleteNoContent{} +} + +/*DcimConsolePortsDeleteNoContent handles this case with default header values. + +DcimConsolePortsDeleteNoContent dcim console ports delete no content +*/ +type DcimConsolePortsDeleteNoContent struct { +} + +func (o *DcimConsolePortsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/console-ports/{id}/][%d] dcimConsolePortsDeleteNoContent ", 204) +} + +func (o *DcimConsolePortsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_list_parameters.go b/netbox/client/dcim/dcim_console_ports_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5431f5eca1012f111e1a060917250a7c889e0c97 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_list_parameters.go @@ -0,0 +1,268 @@ +// 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" +) + +// NewDcimConsolePortsListParams creates a new DcimConsolePortsListParams object +// with the default values initialized. +func NewDcimConsolePortsListParams() *DcimConsolePortsListParams { + var () + return &DcimConsolePortsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsListParamsWithTimeout creates a new DcimConsolePortsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsListParamsWithTimeout(timeout time.Duration) *DcimConsolePortsListParams { + var () + return &DcimConsolePortsListParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsListParamsWithContext creates a new DcimConsolePortsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsListParamsWithContext(ctx context.Context) *DcimConsolePortsListParams { + var () + return &DcimConsolePortsListParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsListParamsWithHTTPClient creates a new DcimConsolePortsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsListParamsWithHTTPClient(client *http.Client) *DcimConsolePortsListParams { + var () + return &DcimConsolePortsListParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsListParams contains all the parameters to send to the API endpoint +for the dcim console ports list operation typically these are written to a http.Request +*/ +type DcimConsolePortsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithTimeout(timeout time.Duration) *DcimConsolePortsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithContext(ctx context.Context) *DcimConsolePortsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithHTTPClient(client *http.Client) *DcimConsolePortsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithDevice(device *string) *DcimConsolePortsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithDeviceID(deviceID *string) *DcimConsolePortsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithLimit(limit *int64) *DcimConsolePortsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithName(name *string) *DcimConsolePortsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console ports list params +func (o *DcimConsolePortsListParams) WithOffset(offset *int64) *DcimConsolePortsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console ports list params +func (o *DcimConsolePortsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_list_responses.go b/netbox/client/dcim/dcim_console_ports_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..708828b753e7c99949d068a8f4095e7fe62e6507 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// DcimConsolePortsListReader is a Reader for the DcimConsolePortsList structure. +type DcimConsolePortsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsListOK() + 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()) + } +} + +// NewDcimConsolePortsListOK creates a DcimConsolePortsListOK with default headers values +func NewDcimConsolePortsListOK() *DcimConsolePortsListOK { + return &DcimConsolePortsListOK{} +} + +/*DcimConsolePortsListOK handles this case with default header values. + +DcimConsolePortsListOK dcim console ports list o k +*/ +type DcimConsolePortsListOK struct { + Payload *models.DcimConsolePortsListOKBody +} + +func (o *DcimConsolePortsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-ports/][%d] dcimConsolePortsListOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsolePortsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go b/netbox/client/dcim/dcim_console_ports_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a2942cd2fd4bd69296d3e9f6679eb79a581067b1 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// NewDcimConsolePortsPartialUpdateParams creates a new DcimConsolePortsPartialUpdateParams object +// with the default values initialized. +func NewDcimConsolePortsPartialUpdateParams() *DcimConsolePortsPartialUpdateParams { + var () + return &DcimConsolePortsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsPartialUpdateParamsWithTimeout creates a new DcimConsolePortsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimConsolePortsPartialUpdateParams { + var () + return &DcimConsolePortsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsPartialUpdateParamsWithContext creates a new DcimConsolePortsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsPartialUpdateParamsWithContext(ctx context.Context) *DcimConsolePortsPartialUpdateParams { + var () + return &DcimConsolePortsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsPartialUpdateParamsWithHTTPClient creates a new DcimConsolePortsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimConsolePortsPartialUpdateParams { + var () + return &DcimConsolePortsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim console ports partial update operation typically these are written to a http.Request +*/ +type DcimConsolePortsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConsolePort + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimConsolePortsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithContext(ctx context.Context) *DcimConsolePortsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimConsolePortsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithData(data *models.WritableConsolePort) *DcimConsolePortsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetData(data *models.WritableConsolePort) { + o.Data = data +} + +// WithID adds the id to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) WithID(id int64) *DcimConsolePortsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports partial update params +func (o *DcimConsolePortsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsPartialUpdateParams) 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_console_ports_partial_update_responses.go b/netbox/client/dcim/dcim_console_ports_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f09c3af08469eaa316004d753366f1d4281be8de --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// DcimConsolePortsPartialUpdateReader is a Reader for the DcimConsolePortsPartialUpdate structure. +type DcimConsolePortsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsPartialUpdateOK() + 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()) + } +} + +// NewDcimConsolePortsPartialUpdateOK creates a DcimConsolePortsPartialUpdateOK with default headers values +func NewDcimConsolePortsPartialUpdateOK() *DcimConsolePortsPartialUpdateOK { + return &DcimConsolePortsPartialUpdateOK{} +} + +/*DcimConsolePortsPartialUpdateOK handles this case with default header values. + +DcimConsolePortsPartialUpdateOK dcim console ports partial update o k +*/ +type DcimConsolePortsPartialUpdateOK struct { + Payload *models.WritableConsolePort +} + +func (o *DcimConsolePortsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/console-ports/{id}/][%d] dcimConsolePortsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_read_parameters.go b/netbox/client/dcim/dcim_console_ports_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..67fddd5f41b08fc8cbf91afbc14b93e215f0ef95 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// NewDcimConsolePortsReadParams creates a new DcimConsolePortsReadParams object +// with the default values initialized. +func NewDcimConsolePortsReadParams() *DcimConsolePortsReadParams { + var () + return &DcimConsolePortsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsReadParamsWithTimeout creates a new DcimConsolePortsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsReadParamsWithTimeout(timeout time.Duration) *DcimConsolePortsReadParams { + var () + return &DcimConsolePortsReadParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsReadParamsWithContext creates a new DcimConsolePortsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsReadParamsWithContext(ctx context.Context) *DcimConsolePortsReadParams { + var () + return &DcimConsolePortsReadParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsReadParamsWithHTTPClient creates a new DcimConsolePortsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsReadParamsWithHTTPClient(client *http.Client) *DcimConsolePortsReadParams { + var () + return &DcimConsolePortsReadParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsReadParams contains all the parameters to send to the API endpoint +for the dcim console ports read operation typically these are written to a http.Request +*/ +type DcimConsolePortsReadParams struct { + + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports read params +func (o *DcimConsolePortsReadParams) WithTimeout(timeout time.Duration) *DcimConsolePortsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports read params +func (o *DcimConsolePortsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports read params +func (o *DcimConsolePortsReadParams) WithContext(ctx context.Context) *DcimConsolePortsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports read params +func (o *DcimConsolePortsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports read params +func (o *DcimConsolePortsReadParams) WithHTTPClient(client *http.Client) *DcimConsolePortsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports read params +func (o *DcimConsolePortsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console ports read params +func (o *DcimConsolePortsReadParams) WithID(id int64) *DcimConsolePortsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports read params +func (o *DcimConsolePortsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_read_responses.go b/netbox/client/dcim/dcim_console_ports_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4b3ee905bb34770499cee376e86f615a3a297c75 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// DcimConsolePortsReadReader is a Reader for the DcimConsolePortsRead structure. +type DcimConsolePortsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsReadOK() + 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()) + } +} + +// NewDcimConsolePortsReadOK creates a DcimConsolePortsReadOK with default headers values +func NewDcimConsolePortsReadOK() *DcimConsolePortsReadOK { + return &DcimConsolePortsReadOK{} +} + +/*DcimConsolePortsReadOK handles this case with default header values. + +DcimConsolePortsReadOK dcim console ports read o k +*/ +type DcimConsolePortsReadOK struct { + Payload *models.ConsolePort +} + +func (o *DcimConsolePortsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-ports/{id}/][%d] dcimConsolePortsReadOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_ports_update_parameters.go b/netbox/client/dcim/dcim_console_ports_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0abc8e8fdb102b26e51995e61f1b05c122e8d8d2 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// NewDcimConsolePortsUpdateParams creates a new DcimConsolePortsUpdateParams object +// with the default values initialized. +func NewDcimConsolePortsUpdateParams() *DcimConsolePortsUpdateParams { + var () + return &DcimConsolePortsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsolePortsUpdateParamsWithTimeout creates a new DcimConsolePortsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsolePortsUpdateParamsWithTimeout(timeout time.Duration) *DcimConsolePortsUpdateParams { + var () + return &DcimConsolePortsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsolePortsUpdateParamsWithContext creates a new DcimConsolePortsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsolePortsUpdateParamsWithContext(ctx context.Context) *DcimConsolePortsUpdateParams { + var () + return &DcimConsolePortsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsolePortsUpdateParamsWithHTTPClient creates a new DcimConsolePortsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsolePortsUpdateParamsWithHTTPClient(client *http.Client) *DcimConsolePortsUpdateParams { + var () + return &DcimConsolePortsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsolePortsUpdateParams contains all the parameters to send to the API endpoint +for the dcim console ports update operation typically these are written to a http.Request +*/ +type DcimConsolePortsUpdateParams struct { + + /*Data*/ + Data *models.WritableConsolePort + /*ID + A unique integer value identifying this console port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithTimeout(timeout time.Duration) *DcimConsolePortsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithContext(ctx context.Context) *DcimConsolePortsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithHTTPClient(client *http.Client) *DcimConsolePortsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithData(data *models.WritableConsolePort) *DcimConsolePortsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetData(data *models.WritableConsolePort) { + o.Data = data +} + +// WithID adds the id to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) WithID(id int64) *DcimConsolePortsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console ports update params +func (o *DcimConsolePortsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsolePortsUpdateParams) 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_console_ports_update_responses.go b/netbox/client/dcim/dcim_console_ports_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e11f2c3d5a833e790af72619bb1df147b8c25a83 --- /dev/null +++ b/netbox/client/dcim/dcim_console_ports_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" +) + +// DcimConsolePortsUpdateReader is a Reader for the DcimConsolePortsUpdate structure. +type DcimConsolePortsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsolePortsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsolePortsUpdateOK() + 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()) + } +} + +// NewDcimConsolePortsUpdateOK creates a DcimConsolePortsUpdateOK with default headers values +func NewDcimConsolePortsUpdateOK() *DcimConsolePortsUpdateOK { + return &DcimConsolePortsUpdateOK{} +} + +/*DcimConsolePortsUpdateOK handles this case with default header values. + +DcimConsolePortsUpdateOK dcim console ports update o k +*/ +type DcimConsolePortsUpdateOK struct { + Payload *models.WritableConsolePort +} + +func (o *DcimConsolePortsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/console-ports/{id}/][%d] dcimConsolePortsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsolePortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsolePort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0f289c99a63a0a5cf5c4770c83a5d2af148a7473 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// NewDcimConsoleServerPortTemplatesCreateParams creates a new DcimConsoleServerPortTemplatesCreateParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesCreateParams() *DcimConsoleServerPortTemplatesCreateParams { + var () + return &DcimConsoleServerPortTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesCreateParamsWithTimeout creates a new DcimConsoleServerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesCreateParams { + var () + return &DcimConsoleServerPortTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesCreateParamsWithContext creates a new DcimConsoleServerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesCreateParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesCreateParams { + var () + return &DcimConsoleServerPortTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesCreateParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesCreateParams { + var () + return &DcimConsoleServerPortTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim console server port templates create operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPortTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) WithData(data *models.WritableConsoleServerPortTemplate) *DcimConsoleServerPortTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server port templates create params +func (o *DcimConsoleServerPortTemplatesCreateParams) SetData(data *models.WritableConsoleServerPortTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesCreateParams) 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_console_server_port_templates_create_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f1a184cd347c3f8f98fcec009404415addad48c3 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// DcimConsoleServerPortTemplatesCreateReader is a Reader for the DcimConsoleServerPortTemplatesCreate structure. +type DcimConsoleServerPortTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimConsoleServerPortTemplatesCreateCreated() + 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()) + } +} + +// NewDcimConsoleServerPortTemplatesCreateCreated creates a DcimConsoleServerPortTemplatesCreateCreated with default headers values +func NewDcimConsoleServerPortTemplatesCreateCreated() *DcimConsoleServerPortTemplatesCreateCreated { + return &DcimConsoleServerPortTemplatesCreateCreated{} +} + +/*DcimConsoleServerPortTemplatesCreateCreated handles this case with default header values. + +DcimConsoleServerPortTemplatesCreateCreated dcim console server port templates create created +*/ +type DcimConsoleServerPortTemplatesCreateCreated struct { + Payload *models.WritableConsoleServerPortTemplate +} + +func (o *DcimConsoleServerPortTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/console-server-port-templates/][%d] dcimConsoleServerPortTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2b53065878393e7c5e5006177828dc9ffe4b6cbb --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// NewDcimConsoleServerPortTemplatesDeleteParams creates a new DcimConsoleServerPortTemplatesDeleteParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesDeleteParams() *DcimConsoleServerPortTemplatesDeleteParams { + var () + return &DcimConsoleServerPortTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesDeleteParamsWithTimeout creates a new DcimConsoleServerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesDeleteParams { + var () + return &DcimConsoleServerPortTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesDeleteParamsWithContext creates a new DcimConsoleServerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesDeleteParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesDeleteParams { + var () + return &DcimConsoleServerPortTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesDeleteParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesDeleteParams { + var () + return &DcimConsoleServerPortTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim console server port templates delete operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this console server port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) WithID(id int64) *DcimConsoleServerPortTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates delete params +func (o *DcimConsoleServerPortTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_delete_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2d58ab92e23483ae42cef881e03f62e656fe865e --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// DcimConsoleServerPortTemplatesDeleteReader is a Reader for the DcimConsoleServerPortTemplatesDelete structure. +type DcimConsoleServerPortTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimConsoleServerPortTemplatesDeleteNoContent() + 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()) + } +} + +// NewDcimConsoleServerPortTemplatesDeleteNoContent creates a DcimConsoleServerPortTemplatesDeleteNoContent with default headers values +func NewDcimConsoleServerPortTemplatesDeleteNoContent() *DcimConsoleServerPortTemplatesDeleteNoContent { + return &DcimConsoleServerPortTemplatesDeleteNoContent{} +} + +/*DcimConsoleServerPortTemplatesDeleteNoContent handles this case with default header values. + +DcimConsoleServerPortTemplatesDeleteNoContent dcim console server port templates delete no content +*/ +type DcimConsoleServerPortTemplatesDeleteNoContent struct { +} + +func (o *DcimConsoleServerPortTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/console-server-port-templates/{id}/][%d] dcimConsoleServerPortTemplatesDeleteNoContent ", 204) +} + +func (o *DcimConsoleServerPortTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..61d44fdd0e86d6335b7f2491f2a46e2665f6fe3a --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_list_parameters.go @@ -0,0 +1,239 @@ +// 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" +) + +// NewDcimConsoleServerPortTemplatesListParams creates a new DcimConsoleServerPortTemplatesListParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesListParams() *DcimConsoleServerPortTemplatesListParams { + var () + return &DcimConsoleServerPortTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesListParamsWithTimeout creates a new DcimConsoleServerPortTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesListParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesListParams { + var () + return &DcimConsoleServerPortTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesListParamsWithContext creates a new DcimConsoleServerPortTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesListParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesListParams { + var () + return &DcimConsoleServerPortTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesListParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesListParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesListParams { + var () + return &DcimConsoleServerPortTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim console server port templates list operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimConsoleServerPortTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithLimit(limit *int64) *DcimConsoleServerPortTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithName(name *string) *DcimConsoleServerPortTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) WithOffset(offset *int64) *DcimConsoleServerPortTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console server port templates list params +func (o *DcimConsoleServerPortTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..97234531094dbe98e9b2445b2b979318df2fa807 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// DcimConsoleServerPortTemplatesListReader is a Reader for the DcimConsoleServerPortTemplatesList structure. +type DcimConsoleServerPortTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortTemplatesListOK() + 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()) + } +} + +// NewDcimConsoleServerPortTemplatesListOK creates a DcimConsoleServerPortTemplatesListOK with default headers values +func NewDcimConsoleServerPortTemplatesListOK() *DcimConsoleServerPortTemplatesListOK { + return &DcimConsoleServerPortTemplatesListOK{} +} + +/*DcimConsoleServerPortTemplatesListOK handles this case with default header values. + +DcimConsoleServerPortTemplatesListOK dcim console server port templates list o k +*/ +type DcimConsoleServerPortTemplatesListOK struct { + Payload *models.DcimConsoleServerPortTemplatesListOKBody +} + +func (o *DcimConsoleServerPortTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-port-templates/][%d] dcimConsoleServerPortTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsoleServerPortTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4fbe3d2c2128ea6d3a6a279ecfe20895a1455aea --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// NewDcimConsoleServerPortTemplatesPartialUpdateParams creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesPartialUpdateParams() *DcimConsoleServerPortTemplatesPartialUpdateParams { + var () + return &DcimConsoleServerPortTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithTimeout creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesPartialUpdateParams { + var () + return &DcimConsoleServerPortTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithContext creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesPartialUpdateParams { + var () + return &DcimConsoleServerPortTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesPartialUpdateParams { + var () + return &DcimConsoleServerPortTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim console server port templates partial update operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPortTemplate + /*ID + A unique integer value identifying this console server port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithData(data *models.WritableConsoleServerPortTemplate) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetData(data *models.WritableConsoleServerPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) WithID(id int64) *DcimConsoleServerPortTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates partial update params +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesPartialUpdateParams) 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_console_server_port_templates_partial_update_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fb72e805242c2ffd74b74c3f06c719fd08af1087 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// DcimConsoleServerPortTemplatesPartialUpdateReader is a Reader for the DcimConsoleServerPortTemplatesPartialUpdate structure. +type DcimConsoleServerPortTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortTemplatesPartialUpdateOK() + 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()) + } +} + +// NewDcimConsoleServerPortTemplatesPartialUpdateOK creates a DcimConsoleServerPortTemplatesPartialUpdateOK with default headers values +func NewDcimConsoleServerPortTemplatesPartialUpdateOK() *DcimConsoleServerPortTemplatesPartialUpdateOK { + return &DcimConsoleServerPortTemplatesPartialUpdateOK{} +} + +/*DcimConsoleServerPortTemplatesPartialUpdateOK handles this case with default header values. + +DcimConsoleServerPortTemplatesPartialUpdateOK dcim console server port templates partial update o k +*/ +type DcimConsoleServerPortTemplatesPartialUpdateOK struct { + Payload *models.WritableConsoleServerPortTemplate +} + +func (o *DcimConsoleServerPortTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/console-server-port-templates/{id}/][%d] dcimConsoleServerPortTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..85c7719355f84f54802df891374d12b5ce7f7107 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// NewDcimConsoleServerPortTemplatesReadParams creates a new DcimConsoleServerPortTemplatesReadParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesReadParams() *DcimConsoleServerPortTemplatesReadParams { + var () + return &DcimConsoleServerPortTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesReadParamsWithTimeout creates a new DcimConsoleServerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesReadParams { + var () + return &DcimConsoleServerPortTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesReadParamsWithContext creates a new DcimConsoleServerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesReadParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesReadParams { + var () + return &DcimConsoleServerPortTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesReadParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesReadParams { + var () + return &DcimConsoleServerPortTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim console server port templates read operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesReadParams struct { + + /*ID + A unique integer value identifying this console server port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) WithID(id int64) *DcimConsoleServerPortTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates read params +func (o *DcimConsoleServerPortTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..079b3674f9ec2520a25d97639d57722687083066 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// DcimConsoleServerPortTemplatesReadReader is a Reader for the DcimConsoleServerPortTemplatesRead structure. +type DcimConsoleServerPortTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortTemplatesReadOK() + 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()) + } +} + +// NewDcimConsoleServerPortTemplatesReadOK creates a DcimConsoleServerPortTemplatesReadOK with default headers values +func NewDcimConsoleServerPortTemplatesReadOK() *DcimConsoleServerPortTemplatesReadOK { + return &DcimConsoleServerPortTemplatesReadOK{} +} + +/*DcimConsoleServerPortTemplatesReadOK handles this case with default header values. + +DcimConsoleServerPortTemplatesReadOK dcim console server port templates read o k +*/ +type DcimConsoleServerPortTemplatesReadOK struct { + Payload *models.ConsoleServerPortTemplate +} + +func (o *DcimConsoleServerPortTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-port-templates/{id}/][%d] dcimConsoleServerPortTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsoleServerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go b/netbox/client/dcim/dcim_console_server_port_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..18848ff89708126e25195496fa61561df56d4e02 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// NewDcimConsoleServerPortTemplatesUpdateParams creates a new DcimConsoleServerPortTemplatesUpdateParams object +// with the default values initialized. +func NewDcimConsoleServerPortTemplatesUpdateParams() *DcimConsoleServerPortTemplatesUpdateParams { + var () + return &DcimConsoleServerPortTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortTemplatesUpdateParamsWithTimeout creates a new DcimConsoleServerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesUpdateParams { + var () + return &DcimConsoleServerPortTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortTemplatesUpdateParamsWithContext creates a new DcimConsoleServerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortTemplatesUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortTemplatesUpdateParams { + var () + return &DcimConsoleServerPortTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortTemplatesUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesUpdateParams { + var () + return &DcimConsoleServerPortTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim console server port templates update operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPortTemplate + /*ID + A unique integer value identifying this console server port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithData(data *models.WritableConsoleServerPortTemplate) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetData(data *models.WritableConsoleServerPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) WithID(id int64) *DcimConsoleServerPortTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server port templates update params +func (o *DcimConsoleServerPortTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortTemplatesUpdateParams) 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_console_server_port_templates_update_responses.go b/netbox/client/dcim/dcim_console_server_port_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0b4efe25cf9bec3398b47f713b20518d94a27cd1 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_port_templates_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" +) + +// DcimConsoleServerPortTemplatesUpdateReader is a Reader for the DcimConsoleServerPortTemplatesUpdate structure. +type DcimConsoleServerPortTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortTemplatesUpdateOK() + 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()) + } +} + +// NewDcimConsoleServerPortTemplatesUpdateOK creates a DcimConsoleServerPortTemplatesUpdateOK with default headers values +func NewDcimConsoleServerPortTemplatesUpdateOK() *DcimConsoleServerPortTemplatesUpdateOK { + return &DcimConsoleServerPortTemplatesUpdateOK{} +} + +/*DcimConsoleServerPortTemplatesUpdateOK handles this case with default header values. + +DcimConsoleServerPortTemplatesUpdateOK dcim console server port templates update o k +*/ +type DcimConsoleServerPortTemplatesUpdateOK struct { + Payload *models.WritableConsoleServerPortTemplate +} + +func (o *DcimConsoleServerPortTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/console-server-port-templates/{id}/][%d] dcimConsoleServerPortTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_create_parameters.go b/netbox/client/dcim/dcim_console_server_ports_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..48b7ad014488282efdd2dc0d826d9779bdd06c5a --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// NewDcimConsoleServerPortsCreateParams creates a new DcimConsoleServerPortsCreateParams object +// with the default values initialized. +func NewDcimConsoleServerPortsCreateParams() *DcimConsoleServerPortsCreateParams { + var () + return &DcimConsoleServerPortsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsCreateParamsWithTimeout creates a new DcimConsoleServerPortsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsCreateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsCreateParams { + var () + return &DcimConsoleServerPortsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsCreateParamsWithContext creates a new DcimConsoleServerPortsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsCreateParamsWithContext(ctx context.Context) *DcimConsoleServerPortsCreateParams { + var () + return &DcimConsoleServerPortsCreateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsCreateParamsWithHTTPClient creates a new DcimConsoleServerPortsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsCreateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsCreateParams { + var () + return &DcimConsoleServerPortsCreateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsCreateParams contains all the parameters to send to the API endpoint +for the dcim console server ports create operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsCreateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPort + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) WithContext(ctx context.Context) *DcimConsoleServerPortsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) WithData(data *models.WritableConsoleServerPort) *DcimConsoleServerPortsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server ports create params +func (o *DcimConsoleServerPortsCreateParams) SetData(data *models.WritableConsoleServerPort) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsCreateParams) 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_console_server_ports_create_responses.go b/netbox/client/dcim/dcim_console_server_ports_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4c42e83f334c19cd2981ff328387f0154a218152 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// DcimConsoleServerPortsCreateReader is a Reader for the DcimConsoleServerPortsCreate structure. +type DcimConsoleServerPortsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimConsoleServerPortsCreateCreated() + 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()) + } +} + +// NewDcimConsoleServerPortsCreateCreated creates a DcimConsoleServerPortsCreateCreated with default headers values +func NewDcimConsoleServerPortsCreateCreated() *DcimConsoleServerPortsCreateCreated { + return &DcimConsoleServerPortsCreateCreated{} +} + +/*DcimConsoleServerPortsCreateCreated handles this case with default header values. + +DcimConsoleServerPortsCreateCreated dcim console server ports create created +*/ +type DcimConsoleServerPortsCreateCreated struct { + Payload *models.WritableConsoleServerPort +} + +func (o *DcimConsoleServerPortsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/console-server-ports/][%d] dcimConsoleServerPortsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimConsoleServerPortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go b/netbox/client/dcim/dcim_console_server_ports_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5fe9dd37fcd3d75bbe080672d5c03bda763a1b33 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// NewDcimConsoleServerPortsDeleteParams creates a new DcimConsoleServerPortsDeleteParams object +// with the default values initialized. +func NewDcimConsoleServerPortsDeleteParams() *DcimConsoleServerPortsDeleteParams { + var () + return &DcimConsoleServerPortsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsDeleteParamsWithTimeout creates a new DcimConsoleServerPortsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsDeleteParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsDeleteParams { + var () + return &DcimConsoleServerPortsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsDeleteParamsWithContext creates a new DcimConsoleServerPortsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsDeleteParamsWithContext(ctx context.Context) *DcimConsoleServerPortsDeleteParams { + var () + return &DcimConsoleServerPortsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsDeleteParamsWithHTTPClient creates a new DcimConsoleServerPortsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsDeleteParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsDeleteParams { + var () + return &DcimConsoleServerPortsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsDeleteParams contains all the parameters to send to the API endpoint +for the dcim console server ports delete operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsDeleteParams struct { + + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) WithContext(ctx context.Context) *DcimConsoleServerPortsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) WithID(id int64) *DcimConsoleServerPortsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports delete params +func (o *DcimConsoleServerPortsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_delete_responses.go b/netbox/client/dcim/dcim_console_server_ports_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7d82c6768708c6067182da5261beddac3aa73a46 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// DcimConsoleServerPortsDeleteReader is a Reader for the DcimConsoleServerPortsDelete structure. +type DcimConsoleServerPortsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimConsoleServerPortsDeleteNoContent() + 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()) + } +} + +// NewDcimConsoleServerPortsDeleteNoContent creates a DcimConsoleServerPortsDeleteNoContent with default headers values +func NewDcimConsoleServerPortsDeleteNoContent() *DcimConsoleServerPortsDeleteNoContent { + return &DcimConsoleServerPortsDeleteNoContent{} +} + +/*DcimConsoleServerPortsDeleteNoContent handles this case with default header values. + +DcimConsoleServerPortsDeleteNoContent dcim console server ports delete no content +*/ +type DcimConsoleServerPortsDeleteNoContent struct { +} + +func (o *DcimConsoleServerPortsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/console-server-ports/{id}/][%d] dcimConsoleServerPortsDeleteNoContent ", 204) +} + +func (o *DcimConsoleServerPortsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_list_parameters.go b/netbox/client/dcim/dcim_console_server_ports_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..abab52d327be45c40c7344a724bdac28b3a3a3e8 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_list_parameters.go @@ -0,0 +1,268 @@ +// 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" +) + +// NewDcimConsoleServerPortsListParams creates a new DcimConsoleServerPortsListParams object +// with the default values initialized. +func NewDcimConsoleServerPortsListParams() *DcimConsoleServerPortsListParams { + var () + return &DcimConsoleServerPortsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsListParamsWithTimeout creates a new DcimConsoleServerPortsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsListParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsListParams { + var () + return &DcimConsoleServerPortsListParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsListParamsWithContext creates a new DcimConsoleServerPortsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsListParamsWithContext(ctx context.Context) *DcimConsoleServerPortsListParams { + var () + return &DcimConsoleServerPortsListParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsListParamsWithHTTPClient creates a new DcimConsoleServerPortsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsListParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsListParams { + var () + return &DcimConsoleServerPortsListParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsListParams contains all the parameters to send to the API endpoint +for the dcim console server ports list operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithContext(ctx context.Context) *DcimConsoleServerPortsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithDevice(device *string) *DcimConsoleServerPortsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithDeviceID(deviceID *string) *DcimConsoleServerPortsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithLimit(limit *int64) *DcimConsoleServerPortsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithName(name *string) *DcimConsoleServerPortsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) WithOffset(offset *int64) *DcimConsoleServerPortsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim console server ports list params +func (o *DcimConsoleServerPortsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_list_responses.go b/netbox/client/dcim/dcim_console_server_ports_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..52aa111cb712806548184db77745ceb58548d256 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// DcimConsoleServerPortsListReader is a Reader for the DcimConsoleServerPortsList structure. +type DcimConsoleServerPortsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsListOK() + 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()) + } +} + +// NewDcimConsoleServerPortsListOK creates a DcimConsoleServerPortsListOK with default headers values +func NewDcimConsoleServerPortsListOK() *DcimConsoleServerPortsListOK { + return &DcimConsoleServerPortsListOK{} +} + +/*DcimConsoleServerPortsListOK handles this case with default header values. + +DcimConsoleServerPortsListOK dcim console server ports list o k +*/ +type DcimConsoleServerPortsListOK struct { + Payload *models.DcimConsoleServerPortsListOKBody +} + +func (o *DcimConsoleServerPortsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-ports/][%d] dcimConsoleServerPortsListOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimConsoleServerPortsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go b/netbox/client/dcim/dcim_console_server_ports_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..37a319753e63240430f857db4f66e6c997acaad2 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// NewDcimConsoleServerPortsPartialUpdateParams creates a new DcimConsoleServerPortsPartialUpdateParams object +// with the default values initialized. +func NewDcimConsoleServerPortsPartialUpdateParams() *DcimConsoleServerPortsPartialUpdateParams { + var () + return &DcimConsoleServerPortsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsPartialUpdateParamsWithTimeout creates a new DcimConsoleServerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsPartialUpdateParams { + var () + return &DcimConsoleServerPortsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsPartialUpdateParamsWithContext creates a new DcimConsoleServerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsPartialUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortsPartialUpdateParams { + var () + return &DcimConsoleServerPortsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsPartialUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsPartialUpdateParams { + var () + return &DcimConsoleServerPortsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim console server ports partial update operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPort + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithData(data *models.WritableConsoleServerPort) *DcimConsoleServerPortsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetData(data *models.WritableConsoleServerPort) { + o.Data = data +} + +// WithID adds the id to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) WithID(id int64) *DcimConsoleServerPortsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports partial update params +func (o *DcimConsoleServerPortsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsPartialUpdateParams) 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_console_server_ports_partial_update_responses.go b/netbox/client/dcim/dcim_console_server_ports_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1da30ddead7cc22a1da2b8262d608bbd9e28a8bf --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// DcimConsoleServerPortsPartialUpdateReader is a Reader for the DcimConsoleServerPortsPartialUpdate structure. +type DcimConsoleServerPortsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsPartialUpdateOK() + 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()) + } +} + +// NewDcimConsoleServerPortsPartialUpdateOK creates a DcimConsoleServerPortsPartialUpdateOK with default headers values +func NewDcimConsoleServerPortsPartialUpdateOK() *DcimConsoleServerPortsPartialUpdateOK { + return &DcimConsoleServerPortsPartialUpdateOK{} +} + +/*DcimConsoleServerPortsPartialUpdateOK handles this case with default header values. + +DcimConsoleServerPortsPartialUpdateOK dcim console server ports partial update o k +*/ +type DcimConsoleServerPortsPartialUpdateOK struct { + Payload *models.WritableConsoleServerPort +} + +func (o *DcimConsoleServerPortsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/console-server-ports/{id}/][%d] dcimConsoleServerPortsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_read_parameters.go b/netbox/client/dcim/dcim_console_server_ports_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..99ab4b489e2955d409ca17f6f7856a9d4435a285 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// NewDcimConsoleServerPortsReadParams creates a new DcimConsoleServerPortsReadParams object +// with the default values initialized. +func NewDcimConsoleServerPortsReadParams() *DcimConsoleServerPortsReadParams { + var () + return &DcimConsoleServerPortsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsReadParamsWithTimeout creates a new DcimConsoleServerPortsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsReadParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsReadParams { + var () + return &DcimConsoleServerPortsReadParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsReadParamsWithContext creates a new DcimConsoleServerPortsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsReadParamsWithContext(ctx context.Context) *DcimConsoleServerPortsReadParams { + var () + return &DcimConsoleServerPortsReadParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsReadParamsWithHTTPClient creates a new DcimConsoleServerPortsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsReadParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsReadParams { + var () + return &DcimConsoleServerPortsReadParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsReadParams contains all the parameters to send to the API endpoint +for the dcim console server ports read operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsReadParams struct { + + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) WithContext(ctx context.Context) *DcimConsoleServerPortsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) WithID(id int64) *DcimConsoleServerPortsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports read params +func (o *DcimConsoleServerPortsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_read_responses.go b/netbox/client/dcim/dcim_console_server_ports_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..415c2359b430d0725b2d38cd915986bbdcd6c3fe --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// DcimConsoleServerPortsReadReader is a Reader for the DcimConsoleServerPortsRead structure. +type DcimConsoleServerPortsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsReadOK() + 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()) + } +} + +// NewDcimConsoleServerPortsReadOK creates a DcimConsoleServerPortsReadOK with default headers values +func NewDcimConsoleServerPortsReadOK() *DcimConsoleServerPortsReadOK { + return &DcimConsoleServerPortsReadOK{} +} + +/*DcimConsoleServerPortsReadOK handles this case with default header values. + +DcimConsoleServerPortsReadOK dcim console server ports read o k +*/ +type DcimConsoleServerPortsReadOK struct { + Payload *models.ConsoleServerPort +} + +func (o *DcimConsoleServerPortsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/console-server-ports/{id}/][%d] dcimConsoleServerPortsReadOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ConsoleServerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_console_server_ports_update_parameters.go b/netbox/client/dcim/dcim_console_server_ports_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..48d8668f8d05a23cbb221e211f55776ebe1e3c9f --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// NewDcimConsoleServerPortsUpdateParams creates a new DcimConsoleServerPortsUpdateParams object +// with the default values initialized. +func NewDcimConsoleServerPortsUpdateParams() *DcimConsoleServerPortsUpdateParams { + var () + return &DcimConsoleServerPortsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimConsoleServerPortsUpdateParamsWithTimeout creates a new DcimConsoleServerPortsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimConsoleServerPortsUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsUpdateParams { + var () + return &DcimConsoleServerPortsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimConsoleServerPortsUpdateParamsWithContext creates a new DcimConsoleServerPortsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimConsoleServerPortsUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortsUpdateParams { + var () + return &DcimConsoleServerPortsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimConsoleServerPortsUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimConsoleServerPortsUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsUpdateParams { + var () + return &DcimConsoleServerPortsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimConsoleServerPortsUpdateParams contains all the parameters to send to the API endpoint +for the dcim console server ports update operation typically these are written to a http.Request +*/ +type DcimConsoleServerPortsUpdateParams struct { + + /*Data*/ + Data *models.WritableConsoleServerPort + /*ID + A unique integer value identifying this console server port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithData(data *models.WritableConsoleServerPort) *DcimConsoleServerPortsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetData(data *models.WritableConsoleServerPort) { + o.Data = data +} + +// WithID adds the id to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) WithID(id int64) *DcimConsoleServerPortsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim console server ports update params +func (o *DcimConsoleServerPortsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimConsoleServerPortsUpdateParams) 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_console_server_ports_update_responses.go b/netbox/client/dcim/dcim_console_server_ports_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..99b2dbe0b63ef992a96e2836c977d9d5f35be8a4 --- /dev/null +++ b/netbox/client/dcim/dcim_console_server_ports_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" +) + +// DcimConsoleServerPortsUpdateReader is a Reader for the DcimConsoleServerPortsUpdate structure. +type DcimConsoleServerPortsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimConsoleServerPortsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimConsoleServerPortsUpdateOK() + 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()) + } +} + +// NewDcimConsoleServerPortsUpdateOK creates a DcimConsoleServerPortsUpdateOK with default headers values +func NewDcimConsoleServerPortsUpdateOK() *DcimConsoleServerPortsUpdateOK { + return &DcimConsoleServerPortsUpdateOK{} +} + +/*DcimConsoleServerPortsUpdateOK handles this case with default header values. + +DcimConsoleServerPortsUpdateOK dcim console server ports update o k +*/ +type DcimConsoleServerPortsUpdateOK struct { + Payload *models.WritableConsoleServerPort +} + +func (o *DcimConsoleServerPortsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/console-server-ports/{id}/][%d] dcimConsoleServerPortsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimConsoleServerPortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableConsoleServerPort) + + // 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_device_bay_templates_create_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a58b1a05259a3b35259e0bb5f4c3ea5c526f919e --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// NewDcimDeviceBayTemplatesCreateParams creates a new DcimDeviceBayTemplatesCreateParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesCreateParams() *DcimDeviceBayTemplatesCreateParams { + var () + return &DcimDeviceBayTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesCreateParamsWithTimeout creates a new DcimDeviceBayTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesCreateParams { + var () + return &DcimDeviceBayTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesCreateParamsWithContext creates a new DcimDeviceBayTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesCreateParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesCreateParams { + var () + return &DcimDeviceBayTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesCreateParamsWithHTTPClient creates a new DcimDeviceBayTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesCreateParams { + var () + return &DcimDeviceBayTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim device bay templates create operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableDeviceBayTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) WithData(data *models.WritableDeviceBayTemplate) *DcimDeviceBayTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bay templates create params +func (o *DcimDeviceBayTemplatesCreateParams) SetData(data *models.WritableDeviceBayTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesCreateParams) 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_device_bay_templates_create_responses.go b/netbox/client/dcim/dcim_device_bay_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..653eb4ea479e97b8821cc0bb68b9370a6775b9d4 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// DcimDeviceBayTemplatesCreateReader is a Reader for the DcimDeviceBayTemplatesCreate structure. +type DcimDeviceBayTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDeviceBayTemplatesCreateCreated() + 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()) + } +} + +// NewDcimDeviceBayTemplatesCreateCreated creates a DcimDeviceBayTemplatesCreateCreated with default headers values +func NewDcimDeviceBayTemplatesCreateCreated() *DcimDeviceBayTemplatesCreateCreated { + return &DcimDeviceBayTemplatesCreateCreated{} +} + +/*DcimDeviceBayTemplatesCreateCreated handles this case with default header values. + +DcimDeviceBayTemplatesCreateCreated dcim device bay templates create created +*/ +type DcimDeviceBayTemplatesCreateCreated struct { + Payload *models.WritableDeviceBayTemplate +} + +func (o *DcimDeviceBayTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/device-bay-templates/][%d] dcimDeviceBayTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDeviceBayTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBayTemplate) + + // 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_device_bay_templates_delete_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d76d12d9bc13b0722170cc2f3a39cad4e603fc88 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// NewDcimDeviceBayTemplatesDeleteParams creates a new DcimDeviceBayTemplatesDeleteParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesDeleteParams() *DcimDeviceBayTemplatesDeleteParams { + var () + return &DcimDeviceBayTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesDeleteParamsWithTimeout creates a new DcimDeviceBayTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesDeleteParams { + var () + return &DcimDeviceBayTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesDeleteParamsWithContext creates a new DcimDeviceBayTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesDeleteParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesDeleteParams { + var () + return &DcimDeviceBayTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesDeleteParamsWithHTTPClient creates a new DcimDeviceBayTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesDeleteParams { + var () + return &DcimDeviceBayTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim device bay templates delete operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this device bay template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) WithID(id int64) *DcimDeviceBayTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates delete params +func (o *DcimDeviceBayTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesDeleteParams) 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_device_bay_templates_delete_responses.go b/netbox/client/dcim/dcim_device_bay_templates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6cf1a9f92e774483c12b8b267030f85ca17278f1 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// DcimDeviceBayTemplatesDeleteReader is a Reader for the DcimDeviceBayTemplatesDelete structure. +type DcimDeviceBayTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDeviceBayTemplatesDeleteNoContent() + 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()) + } +} + +// NewDcimDeviceBayTemplatesDeleteNoContent creates a DcimDeviceBayTemplatesDeleteNoContent with default headers values +func NewDcimDeviceBayTemplatesDeleteNoContent() *DcimDeviceBayTemplatesDeleteNoContent { + return &DcimDeviceBayTemplatesDeleteNoContent{} +} + +/*DcimDeviceBayTemplatesDeleteNoContent handles this case with default header values. + +DcimDeviceBayTemplatesDeleteNoContent dcim device bay templates delete no content +*/ +type DcimDeviceBayTemplatesDeleteNoContent struct { +} + +func (o *DcimDeviceBayTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/device-bay-templates/{id}/][%d] dcimDeviceBayTemplatesDeleteNoContent ", 204) +} + +func (o *DcimDeviceBayTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..178b91729868648fb75f1bf6f394a296131355c7 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_list_parameters.go @@ -0,0 +1,239 @@ +// 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" +) + +// NewDcimDeviceBayTemplatesListParams creates a new DcimDeviceBayTemplatesListParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesListParams() *DcimDeviceBayTemplatesListParams { + var () + return &DcimDeviceBayTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesListParamsWithTimeout creates a new DcimDeviceBayTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesListParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesListParams { + var () + return &DcimDeviceBayTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesListParamsWithContext creates a new DcimDeviceBayTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesListParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesListParams { + var () + return &DcimDeviceBayTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesListParamsWithHTTPClient creates a new DcimDeviceBayTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesListParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesListParams { + var () + return &DcimDeviceBayTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim device bay templates list operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimDeviceBayTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithLimit(limit *int64) *DcimDeviceBayTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithName(name *string) *DcimDeviceBayTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) WithOffset(offset *int64) *DcimDeviceBayTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim device bay templates list params +func (o *DcimDeviceBayTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_device_bay_templates_list_responses.go b/netbox/client/dcim/dcim_device_bay_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c739fd4d966e443100e693588ddf11287cbec319 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// DcimDeviceBayTemplatesListReader is a Reader for the DcimDeviceBayTemplatesList structure. +type DcimDeviceBayTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBayTemplatesListOK() + 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()) + } +} + +// NewDcimDeviceBayTemplatesListOK creates a DcimDeviceBayTemplatesListOK with default headers values +func NewDcimDeviceBayTemplatesListOK() *DcimDeviceBayTemplatesListOK { + return &DcimDeviceBayTemplatesListOK{} +} + +/*DcimDeviceBayTemplatesListOK handles this case with default header values. + +DcimDeviceBayTemplatesListOK dcim device bay templates list o k +*/ +type DcimDeviceBayTemplatesListOK struct { + Payload *models.DcimDeviceBayTemplatesListOKBody +} + +func (o *DcimDeviceBayTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-bay-templates/][%d] dcimDeviceBayTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBayTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDeviceBayTemplatesListOKBody) + + // 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_device_bay_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a9e7272eb98b65c1f98af396be3b18a730a10909 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// NewDcimDeviceBayTemplatesPartialUpdateParams creates a new DcimDeviceBayTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesPartialUpdateParams() *DcimDeviceBayTemplatesPartialUpdateParams { + var () + return &DcimDeviceBayTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesPartialUpdateParamsWithTimeout creates a new DcimDeviceBayTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesPartialUpdateParams { + var () + return &DcimDeviceBayTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesPartialUpdateParamsWithContext creates a new DcimDeviceBayTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesPartialUpdateParams { + var () + return &DcimDeviceBayTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimDeviceBayTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesPartialUpdateParams { + var () + return &DcimDeviceBayTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim device bay templates partial update operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceBayTemplate + /*ID + A unique integer value identifying this device bay template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithData(data *models.WritableDeviceBayTemplate) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetData(data *models.WritableDeviceBayTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) WithID(id int64) *DcimDeviceBayTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates partial update params +func (o *DcimDeviceBayTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesPartialUpdateParams) 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_device_bay_templates_partial_update_responses.go b/netbox/client/dcim/dcim_device_bay_templates_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..845b4c06e3e128886a74f429be7e6c7205439000 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// DcimDeviceBayTemplatesPartialUpdateReader is a Reader for the DcimDeviceBayTemplatesPartialUpdate structure. +type DcimDeviceBayTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBayTemplatesPartialUpdateOK() + 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()) + } +} + +// NewDcimDeviceBayTemplatesPartialUpdateOK creates a DcimDeviceBayTemplatesPartialUpdateOK with default headers values +func NewDcimDeviceBayTemplatesPartialUpdateOK() *DcimDeviceBayTemplatesPartialUpdateOK { + return &DcimDeviceBayTemplatesPartialUpdateOK{} +} + +/*DcimDeviceBayTemplatesPartialUpdateOK handles this case with default header values. + +DcimDeviceBayTemplatesPartialUpdateOK dcim device bay templates partial update o k +*/ +type DcimDeviceBayTemplatesPartialUpdateOK struct { + Payload *models.WritableDeviceBayTemplate +} + +func (o *DcimDeviceBayTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/device-bay-templates/{id}/][%d] dcimDeviceBayTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBayTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBayTemplate) + + // 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_device_bay_templates_read_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3814f5332e9f0aad679a151b1b4ff21e2ac9043b --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// NewDcimDeviceBayTemplatesReadParams creates a new DcimDeviceBayTemplatesReadParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesReadParams() *DcimDeviceBayTemplatesReadParams { + var () + return &DcimDeviceBayTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesReadParamsWithTimeout creates a new DcimDeviceBayTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesReadParams { + var () + return &DcimDeviceBayTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesReadParamsWithContext creates a new DcimDeviceBayTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesReadParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesReadParams { + var () + return &DcimDeviceBayTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesReadParamsWithHTTPClient creates a new DcimDeviceBayTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesReadParams { + var () + return &DcimDeviceBayTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim device bay templates read operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesReadParams struct { + + /*ID + A unique integer value identifying this device bay template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) WithID(id int64) *DcimDeviceBayTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates read params +func (o *DcimDeviceBayTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesReadParams) 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_device_bay_templates_read_responses.go b/netbox/client/dcim/dcim_device_bay_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2dd13afba90fe57456f88e03bd4f9650c51de4e5 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// DcimDeviceBayTemplatesReadReader is a Reader for the DcimDeviceBayTemplatesRead structure. +type DcimDeviceBayTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBayTemplatesReadOK() + 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()) + } +} + +// NewDcimDeviceBayTemplatesReadOK creates a DcimDeviceBayTemplatesReadOK with default headers values +func NewDcimDeviceBayTemplatesReadOK() *DcimDeviceBayTemplatesReadOK { + return &DcimDeviceBayTemplatesReadOK{} +} + +/*DcimDeviceBayTemplatesReadOK handles this case with default header values. + +DcimDeviceBayTemplatesReadOK dcim device bay templates read o k +*/ +type DcimDeviceBayTemplatesReadOK struct { + Payload *models.DeviceBayTemplate +} + +func (o *DcimDeviceBayTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-bay-templates/{id}/][%d] dcimDeviceBayTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBayTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceBayTemplate) + + // 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_device_bay_templates_update_parameters.go b/netbox/client/dcim/dcim_device_bay_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e27953eaf229dfd9f5915213c0344ef7f254456f --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// NewDcimDeviceBayTemplatesUpdateParams creates a new DcimDeviceBayTemplatesUpdateParams object +// with the default values initialized. +func NewDcimDeviceBayTemplatesUpdateParams() *DcimDeviceBayTemplatesUpdateParams { + var () + return &DcimDeviceBayTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBayTemplatesUpdateParamsWithTimeout creates a new DcimDeviceBayTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBayTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesUpdateParams { + var () + return &DcimDeviceBayTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBayTemplatesUpdateParamsWithContext creates a new DcimDeviceBayTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBayTemplatesUpdateParamsWithContext(ctx context.Context) *DcimDeviceBayTemplatesUpdateParams { + var () + return &DcimDeviceBayTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBayTemplatesUpdateParamsWithHTTPClient creates a new DcimDeviceBayTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBayTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesUpdateParams { + var () + return &DcimDeviceBayTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBayTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim device bay templates update operation typically these are written to a http.Request +*/ +type DcimDeviceBayTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceBayTemplate + /*ID + A unique integer value identifying this device bay template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceBayTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithContext(ctx context.Context) *DcimDeviceBayTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceBayTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithData(data *models.WritableDeviceBayTemplate) *DcimDeviceBayTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetData(data *models.WritableDeviceBayTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) WithID(id int64) *DcimDeviceBayTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bay templates update params +func (o *DcimDeviceBayTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBayTemplatesUpdateParams) 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_device_bay_templates_update_responses.go b/netbox/client/dcim/dcim_device_bay_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0b7e0a31c18df9561a1bc8a9b74fafd5f5a99358 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bay_templates_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" +) + +// DcimDeviceBayTemplatesUpdateReader is a Reader for the DcimDeviceBayTemplatesUpdate structure. +type DcimDeviceBayTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBayTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBayTemplatesUpdateOK() + 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()) + } +} + +// NewDcimDeviceBayTemplatesUpdateOK creates a DcimDeviceBayTemplatesUpdateOK with default headers values +func NewDcimDeviceBayTemplatesUpdateOK() *DcimDeviceBayTemplatesUpdateOK { + return &DcimDeviceBayTemplatesUpdateOK{} +} + +/*DcimDeviceBayTemplatesUpdateOK handles this case with default header values. + +DcimDeviceBayTemplatesUpdateOK dcim device bay templates update o k +*/ +type DcimDeviceBayTemplatesUpdateOK struct { + Payload *models.WritableDeviceBayTemplate +} + +func (o *DcimDeviceBayTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/device-bay-templates/{id}/][%d] dcimDeviceBayTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBayTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBayTemplate) + + // 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_device_bays_create_parameters.go b/netbox/client/dcim/dcim_device_bays_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..eb1b575c3a8700f10efbd8c012000c6ba174488a --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// NewDcimDeviceBaysCreateParams creates a new DcimDeviceBaysCreateParams object +// with the default values initialized. +func NewDcimDeviceBaysCreateParams() *DcimDeviceBaysCreateParams { + var () + return &DcimDeviceBaysCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysCreateParamsWithTimeout creates a new DcimDeviceBaysCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysCreateParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysCreateParams { + var () + return &DcimDeviceBaysCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysCreateParamsWithContext creates a new DcimDeviceBaysCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysCreateParamsWithContext(ctx context.Context) *DcimDeviceBaysCreateParams { + var () + return &DcimDeviceBaysCreateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysCreateParamsWithHTTPClient creates a new DcimDeviceBaysCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysCreateParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysCreateParams { + var () + return &DcimDeviceBaysCreateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysCreateParams contains all the parameters to send to the API endpoint +for the dcim device bays create operation typically these are written to a http.Request +*/ +type DcimDeviceBaysCreateParams struct { + + /*Data*/ + Data *models.WritableDeviceBay + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) WithContext(ctx context.Context) *DcimDeviceBaysCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) WithData(data *models.WritableDeviceBay) *DcimDeviceBaysCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bays create params +func (o *DcimDeviceBaysCreateParams) SetData(data *models.WritableDeviceBay) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysCreateParams) 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_device_bays_create_responses.go b/netbox/client/dcim/dcim_device_bays_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b11e3e4457947a5ab57388fd85472b88fe71b13e --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// DcimDeviceBaysCreateReader is a Reader for the DcimDeviceBaysCreate structure. +type DcimDeviceBaysCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDeviceBaysCreateCreated() + 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()) + } +} + +// NewDcimDeviceBaysCreateCreated creates a DcimDeviceBaysCreateCreated with default headers values +func NewDcimDeviceBaysCreateCreated() *DcimDeviceBaysCreateCreated { + return &DcimDeviceBaysCreateCreated{} +} + +/*DcimDeviceBaysCreateCreated handles this case with default header values. + +DcimDeviceBaysCreateCreated dcim device bays create created +*/ +type DcimDeviceBaysCreateCreated struct { + Payload *models.WritableDeviceBay +} + +func (o *DcimDeviceBaysCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/device-bays/][%d] dcimDeviceBaysCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDeviceBaysCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBay) + + // 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_device_bays_delete_parameters.go b/netbox/client/dcim/dcim_device_bays_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e5c4320f0ef61875b6f6a28efa7048c32aa75da6 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// NewDcimDeviceBaysDeleteParams creates a new DcimDeviceBaysDeleteParams object +// with the default values initialized. +func NewDcimDeviceBaysDeleteParams() *DcimDeviceBaysDeleteParams { + var () + return &DcimDeviceBaysDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysDeleteParamsWithTimeout creates a new DcimDeviceBaysDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysDeleteParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysDeleteParams { + var () + return &DcimDeviceBaysDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysDeleteParamsWithContext creates a new DcimDeviceBaysDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysDeleteParamsWithContext(ctx context.Context) *DcimDeviceBaysDeleteParams { + var () + return &DcimDeviceBaysDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysDeleteParamsWithHTTPClient creates a new DcimDeviceBaysDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysDeleteParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysDeleteParams { + var () + return &DcimDeviceBaysDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysDeleteParams contains all the parameters to send to the API endpoint +for the dcim device bays delete operation typically these are written to a http.Request +*/ +type DcimDeviceBaysDeleteParams struct { + + /*ID + A unique integer value identifying this device bay. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) WithContext(ctx context.Context) *DcimDeviceBaysDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) WithID(id int64) *DcimDeviceBaysDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays delete params +func (o *DcimDeviceBaysDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysDeleteParams) 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_device_bays_delete_responses.go b/netbox/client/dcim/dcim_device_bays_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1f5e0ca9b40e21097172ba5ef4f6b769957a59aa --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// DcimDeviceBaysDeleteReader is a Reader for the DcimDeviceBaysDelete structure. +type DcimDeviceBaysDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDeviceBaysDeleteNoContent() + 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()) + } +} + +// NewDcimDeviceBaysDeleteNoContent creates a DcimDeviceBaysDeleteNoContent with default headers values +func NewDcimDeviceBaysDeleteNoContent() *DcimDeviceBaysDeleteNoContent { + return &DcimDeviceBaysDeleteNoContent{} +} + +/*DcimDeviceBaysDeleteNoContent handles this case with default header values. + +DcimDeviceBaysDeleteNoContent dcim device bays delete no content +*/ +type DcimDeviceBaysDeleteNoContent struct { +} + +func (o *DcimDeviceBaysDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/device-bays/{id}/][%d] dcimDeviceBaysDeleteNoContent ", 204) +} + +func (o *DcimDeviceBaysDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_device_bays_list_parameters.go b/netbox/client/dcim/dcim_device_bays_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..572e76c61393b3daa96118f714918283f546b1ad --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_list_parameters.go @@ -0,0 +1,268 @@ +// 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" +) + +// NewDcimDeviceBaysListParams creates a new DcimDeviceBaysListParams object +// with the default values initialized. +func NewDcimDeviceBaysListParams() *DcimDeviceBaysListParams { + var () + return &DcimDeviceBaysListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysListParamsWithTimeout creates a new DcimDeviceBaysListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysListParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysListParams { + var () + return &DcimDeviceBaysListParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysListParamsWithContext creates a new DcimDeviceBaysListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysListParamsWithContext(ctx context.Context) *DcimDeviceBaysListParams { + var () + return &DcimDeviceBaysListParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysListParamsWithHTTPClient creates a new DcimDeviceBaysListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysListParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysListParams { + var () + return &DcimDeviceBaysListParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysListParams contains all the parameters to send to the API endpoint +for the dcim device bays list operation typically these are written to a http.Request +*/ +type DcimDeviceBaysListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithContext(ctx context.Context) *DcimDeviceBaysListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithDevice(device *string) *DcimDeviceBaysListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithDeviceID(deviceID *string) *DcimDeviceBaysListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithLimit(limit *int64) *DcimDeviceBaysListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithName(name *string) *DcimDeviceBaysListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim device bays list params +func (o *DcimDeviceBaysListParams) WithOffset(offset *int64) *DcimDeviceBaysListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim device bays list params +func (o *DcimDeviceBaysListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_device_bays_list_responses.go b/netbox/client/dcim/dcim_device_bays_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6affeaf0b462eb8e2c17d1e95cfb78fb48f8f9c1 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// DcimDeviceBaysListReader is a Reader for the DcimDeviceBaysList structure. +type DcimDeviceBaysListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBaysListOK() + 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()) + } +} + +// NewDcimDeviceBaysListOK creates a DcimDeviceBaysListOK with default headers values +func NewDcimDeviceBaysListOK() *DcimDeviceBaysListOK { + return &DcimDeviceBaysListOK{} +} + +/*DcimDeviceBaysListOK handles this case with default header values. + +DcimDeviceBaysListOK dcim device bays list o k +*/ +type DcimDeviceBaysListOK struct { + Payload *models.DcimDeviceBaysListOKBody +} + +func (o *DcimDeviceBaysListOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-bays/][%d] dcimDeviceBaysListOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBaysListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDeviceBaysListOKBody) + + // 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_device_bays_partial_update_parameters.go b/netbox/client/dcim/dcim_device_bays_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c4c414556a0d9eb95b4bb8fbd94c9574c6956451 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// NewDcimDeviceBaysPartialUpdateParams creates a new DcimDeviceBaysPartialUpdateParams object +// with the default values initialized. +func NewDcimDeviceBaysPartialUpdateParams() *DcimDeviceBaysPartialUpdateParams { + var () + return &DcimDeviceBaysPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysPartialUpdateParamsWithTimeout creates a new DcimDeviceBaysPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysPartialUpdateParams { + var () + return &DcimDeviceBaysPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysPartialUpdateParamsWithContext creates a new DcimDeviceBaysPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysPartialUpdateParamsWithContext(ctx context.Context) *DcimDeviceBaysPartialUpdateParams { + var () + return &DcimDeviceBaysPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysPartialUpdateParamsWithHTTPClient creates a new DcimDeviceBaysPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysPartialUpdateParams { + var () + return &DcimDeviceBaysPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim device bays partial update operation typically these are written to a http.Request +*/ +type DcimDeviceBaysPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceBay + /*ID + A unique integer value identifying this device bay. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithContext(ctx context.Context) *DcimDeviceBaysPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithData(data *models.WritableDeviceBay) *DcimDeviceBaysPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetData(data *models.WritableDeviceBay) { + o.Data = data +} + +// WithID adds the id to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) WithID(id int64) *DcimDeviceBaysPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays partial update params +func (o *DcimDeviceBaysPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysPartialUpdateParams) 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_device_bays_partial_update_responses.go b/netbox/client/dcim/dcim_device_bays_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d35bdbdfdefc080464d85696d92a6fe93d04a883 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// DcimDeviceBaysPartialUpdateReader is a Reader for the DcimDeviceBaysPartialUpdate structure. +type DcimDeviceBaysPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBaysPartialUpdateOK() + 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()) + } +} + +// NewDcimDeviceBaysPartialUpdateOK creates a DcimDeviceBaysPartialUpdateOK with default headers values +func NewDcimDeviceBaysPartialUpdateOK() *DcimDeviceBaysPartialUpdateOK { + return &DcimDeviceBaysPartialUpdateOK{} +} + +/*DcimDeviceBaysPartialUpdateOK handles this case with default header values. + +DcimDeviceBaysPartialUpdateOK dcim device bays partial update o k +*/ +type DcimDeviceBaysPartialUpdateOK struct { + Payload *models.WritableDeviceBay +} + +func (o *DcimDeviceBaysPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/device-bays/{id}/][%d] dcimDeviceBaysPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBaysPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBay) + + // 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_device_bays_read_parameters.go b/netbox/client/dcim/dcim_device_bays_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8c0edce42fcbdec6ce90cd565c075b011291ae32 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// NewDcimDeviceBaysReadParams creates a new DcimDeviceBaysReadParams object +// with the default values initialized. +func NewDcimDeviceBaysReadParams() *DcimDeviceBaysReadParams { + var () + return &DcimDeviceBaysReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysReadParamsWithTimeout creates a new DcimDeviceBaysReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysReadParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysReadParams { + var () + return &DcimDeviceBaysReadParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysReadParamsWithContext creates a new DcimDeviceBaysReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysReadParamsWithContext(ctx context.Context) *DcimDeviceBaysReadParams { + var () + return &DcimDeviceBaysReadParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysReadParamsWithHTTPClient creates a new DcimDeviceBaysReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysReadParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysReadParams { + var () + return &DcimDeviceBaysReadParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysReadParams contains all the parameters to send to the API endpoint +for the dcim device bays read operation typically these are written to a http.Request +*/ +type DcimDeviceBaysReadParams struct { + + /*ID + A unique integer value identifying this device bay. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) WithContext(ctx context.Context) *DcimDeviceBaysReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) WithID(id int64) *DcimDeviceBaysReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays read params +func (o *DcimDeviceBaysReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysReadParams) 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_device_bays_read_responses.go b/netbox/client/dcim/dcim_device_bays_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..26895eef0940a56c6c8d25f921323bf8594456bd --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// DcimDeviceBaysReadReader is a Reader for the DcimDeviceBaysRead structure. +type DcimDeviceBaysReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBaysReadOK() + 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()) + } +} + +// NewDcimDeviceBaysReadOK creates a DcimDeviceBaysReadOK with default headers values +func NewDcimDeviceBaysReadOK() *DcimDeviceBaysReadOK { + return &DcimDeviceBaysReadOK{} +} + +/*DcimDeviceBaysReadOK handles this case with default header values. + +DcimDeviceBaysReadOK dcim device bays read o k +*/ +type DcimDeviceBaysReadOK struct { + Payload *models.DeviceBay +} + +func (o *DcimDeviceBaysReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-bays/{id}/][%d] dcimDeviceBaysReadOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBaysReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceBay) + + // 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_device_bays_update_parameters.go b/netbox/client/dcim/dcim_device_bays_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2d011a719685b438c29f844e591c840bdffdfbd3 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// NewDcimDeviceBaysUpdateParams creates a new DcimDeviceBaysUpdateParams object +// with the default values initialized. +func NewDcimDeviceBaysUpdateParams() *DcimDeviceBaysUpdateParams { + var () + return &DcimDeviceBaysUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceBaysUpdateParamsWithTimeout creates a new DcimDeviceBaysUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceBaysUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceBaysUpdateParams { + var () + return &DcimDeviceBaysUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceBaysUpdateParamsWithContext creates a new DcimDeviceBaysUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceBaysUpdateParamsWithContext(ctx context.Context) *DcimDeviceBaysUpdateParams { + var () + return &DcimDeviceBaysUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceBaysUpdateParamsWithHTTPClient creates a new DcimDeviceBaysUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceBaysUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceBaysUpdateParams { + var () + return &DcimDeviceBaysUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceBaysUpdateParams contains all the parameters to send to the API endpoint +for the dcim device bays update operation typically these are written to a http.Request +*/ +type DcimDeviceBaysUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceBay + /*ID + A unique integer value identifying this device bay. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceBaysUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithContext(ctx context.Context) *DcimDeviceBaysUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceBaysUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithData(data *models.WritableDeviceBay) *DcimDeviceBaysUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetData(data *models.WritableDeviceBay) { + o.Data = data +} + +// WithID adds the id to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) WithID(id int64) *DcimDeviceBaysUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device bays update params +func (o *DcimDeviceBaysUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceBaysUpdateParams) 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_device_bays_update_responses.go b/netbox/client/dcim/dcim_device_bays_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..edcbdddbe34208aedbd3747477eb3030b8be0a77 --- /dev/null +++ b/netbox/client/dcim/dcim_device_bays_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" +) + +// DcimDeviceBaysUpdateReader is a Reader for the DcimDeviceBaysUpdate structure. +type DcimDeviceBaysUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceBaysUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceBaysUpdateOK() + 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()) + } +} + +// NewDcimDeviceBaysUpdateOK creates a DcimDeviceBaysUpdateOK with default headers values +func NewDcimDeviceBaysUpdateOK() *DcimDeviceBaysUpdateOK { + return &DcimDeviceBaysUpdateOK{} +} + +/*DcimDeviceBaysUpdateOK handles this case with default header values. + +DcimDeviceBaysUpdateOK dcim device bays update o k +*/ +type DcimDeviceBaysUpdateOK struct { + Payload *models.WritableDeviceBay +} + +func (o *DcimDeviceBaysUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/device-bays/{id}/][%d] dcimDeviceBaysUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceBaysUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceBay) + + // 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_device_roles_create_parameters.go b/netbox/client/dcim/dcim_device_roles_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..87605639b79829a67d8eb09dd5e15d67d568bd1b --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// NewDcimDeviceRolesCreateParams creates a new DcimDeviceRolesCreateParams object +// with the default values initialized. +func NewDcimDeviceRolesCreateParams() *DcimDeviceRolesCreateParams { + var () + return &DcimDeviceRolesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesCreateParamsWithTimeout creates a new DcimDeviceRolesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesCreateParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesCreateParams { + var () + return &DcimDeviceRolesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesCreateParamsWithContext creates a new DcimDeviceRolesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesCreateParamsWithContext(ctx context.Context) *DcimDeviceRolesCreateParams { + var () + return &DcimDeviceRolesCreateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesCreateParamsWithHTTPClient creates a new DcimDeviceRolesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesCreateParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesCreateParams { + var () + return &DcimDeviceRolesCreateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesCreateParams contains all the parameters to send to the API endpoint +for the dcim device roles create operation typically these are written to a http.Request +*/ +type DcimDeviceRolesCreateParams struct { + + /*Data*/ + Data *models.DeviceRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) WithContext(ctx context.Context) *DcimDeviceRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) WithData(data *models.DeviceRole) *DcimDeviceRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device roles create params +func (o *DcimDeviceRolesCreateParams) SetData(data *models.DeviceRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesCreateParams) 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_device_roles_create_responses.go b/netbox/client/dcim/dcim_device_roles_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..51b4080e33bd94eba199e0d3e9b7083fe176d13d --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// DcimDeviceRolesCreateReader is a Reader for the DcimDeviceRolesCreate structure. +type DcimDeviceRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDeviceRolesCreateCreated() + 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()) + } +} + +// NewDcimDeviceRolesCreateCreated creates a DcimDeviceRolesCreateCreated with default headers values +func NewDcimDeviceRolesCreateCreated() *DcimDeviceRolesCreateCreated { + return &DcimDeviceRolesCreateCreated{} +} + +/*DcimDeviceRolesCreateCreated handles this case with default header values. + +DcimDeviceRolesCreateCreated dcim device roles create created +*/ +type DcimDeviceRolesCreateCreated struct { + Payload *models.DeviceRole +} + +func (o *DcimDeviceRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/device-roles/][%d] dcimDeviceRolesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDeviceRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceRole) + + // 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_device_roles_delete_parameters.go b/netbox/client/dcim/dcim_device_roles_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1f2a73f8c3e0105176442d1d3ac7ad10f4f23037 --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// NewDcimDeviceRolesDeleteParams creates a new DcimDeviceRolesDeleteParams object +// with the default values initialized. +func NewDcimDeviceRolesDeleteParams() *DcimDeviceRolesDeleteParams { + var () + return &DcimDeviceRolesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesDeleteParamsWithTimeout creates a new DcimDeviceRolesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesDeleteParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesDeleteParams { + var () + return &DcimDeviceRolesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesDeleteParamsWithContext creates a new DcimDeviceRolesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesDeleteParamsWithContext(ctx context.Context) *DcimDeviceRolesDeleteParams { + var () + return &DcimDeviceRolesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesDeleteParamsWithHTTPClient creates a new DcimDeviceRolesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesDeleteParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesDeleteParams { + var () + return &DcimDeviceRolesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesDeleteParams contains all the parameters to send to the API endpoint +for the dcim device roles delete operation typically these are written to a http.Request +*/ +type DcimDeviceRolesDeleteParams struct { + + /*ID + A unique integer value identifying this device role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) WithContext(ctx context.Context) *DcimDeviceRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) WithID(id int64) *DcimDeviceRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles delete params +func (o *DcimDeviceRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesDeleteParams) 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_device_roles_delete_responses.go b/netbox/client/dcim/dcim_device_roles_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6d44eb5578ffd742db9d3248b99f2833a2f23957 --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// DcimDeviceRolesDeleteReader is a Reader for the DcimDeviceRolesDelete structure. +type DcimDeviceRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDeviceRolesDeleteNoContent() + 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()) + } +} + +// NewDcimDeviceRolesDeleteNoContent creates a DcimDeviceRolesDeleteNoContent with default headers values +func NewDcimDeviceRolesDeleteNoContent() *DcimDeviceRolesDeleteNoContent { + return &DcimDeviceRolesDeleteNoContent{} +} + +/*DcimDeviceRolesDeleteNoContent handles this case with default header values. + +DcimDeviceRolesDeleteNoContent dcim device roles delete no content +*/ +type DcimDeviceRolesDeleteNoContent struct { +} + +func (o *DcimDeviceRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/device-roles/{id}/][%d] dcimDeviceRolesDeleteNoContent ", 204) +} + +func (o *DcimDeviceRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_device_roles_list_parameters.go b/netbox/client/dcim/dcim_device_roles_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..313e21ce27747e79ea845001d6167b92f9f3e792 --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_list_parameters.go @@ -0,0 +1,297 @@ +// 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" +) + +// NewDcimDeviceRolesListParams creates a new DcimDeviceRolesListParams object +// with the default values initialized. +func NewDcimDeviceRolesListParams() *DcimDeviceRolesListParams { + var () + return &DcimDeviceRolesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesListParamsWithTimeout creates a new DcimDeviceRolesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesListParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesListParams { + var () + return &DcimDeviceRolesListParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesListParamsWithContext creates a new DcimDeviceRolesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesListParamsWithContext(ctx context.Context) *DcimDeviceRolesListParams { + var () + return &DcimDeviceRolesListParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesListParamsWithHTTPClient creates a new DcimDeviceRolesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesListParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesListParams { + var () + return &DcimDeviceRolesListParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesListParams contains all the parameters to send to the API endpoint +for the dcim device roles list operation typically these are written to a http.Request +*/ +type DcimDeviceRolesListParams struct { + + /*Color*/ + Color *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + /*VMRole*/ + VMRole *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithContext(ctx context.Context) *DcimDeviceRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColor adds the color to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithColor(color *string) *DcimDeviceRolesListParams { + o.SetColor(color) + return o +} + +// SetColor adds the color to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetColor(color *string) { + o.Color = color +} + +// WithLimit adds the limit to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithLimit(limit *int64) *DcimDeviceRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithName(name *string) *DcimDeviceRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithOffset(offset *int64) *DcimDeviceRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithSlug(slug *string) *DcimDeviceRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithVMRole adds the vMRole to the dcim device roles list params +func (o *DcimDeviceRolesListParams) WithVMRole(vMRole *string) *DcimDeviceRolesListParams { + o.SetVMRole(vMRole) + return o +} + +// SetVMRole adds the vmRole to the dcim device roles list params +func (o *DcimDeviceRolesListParams) SetVMRole(vMRole *string) { + o.VMRole = vMRole +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Color != nil { + + // query param color + var qrColor string + if o.Color != nil { + qrColor = *o.Color + } + qColor := qrColor + if qColor != "" { + if err := r.SetQueryParam("color", qColor); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if o.VMRole != nil { + + // query param vm_role + var qrVMRole string + if o.VMRole != nil { + qrVMRole = *o.VMRole + } + qVMRole := qrVMRole + if qVMRole != "" { + if err := r.SetQueryParam("vm_role", qVMRole); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_device_roles_list_responses.go b/netbox/client/dcim/dcim_device_roles_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2ac68a9aa9114cb073dee0f8bccd3819baca3ace --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// DcimDeviceRolesListReader is a Reader for the DcimDeviceRolesList structure. +type DcimDeviceRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceRolesListOK() + 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()) + } +} + +// NewDcimDeviceRolesListOK creates a DcimDeviceRolesListOK with default headers values +func NewDcimDeviceRolesListOK() *DcimDeviceRolesListOK { + return &DcimDeviceRolesListOK{} +} + +/*DcimDeviceRolesListOK handles this case with default header values. + +DcimDeviceRolesListOK dcim device roles list o k +*/ +type DcimDeviceRolesListOK struct { + Payload *models.DcimDeviceRolesListOKBody +} + +func (o *DcimDeviceRolesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-roles/][%d] dcimDeviceRolesListOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDeviceRolesListOKBody) + + // 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_device_roles_partial_update_parameters.go b/netbox/client/dcim/dcim_device_roles_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..01aa05ca9024f41bc1530cf5f16f0f0a46a5cc76 --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// NewDcimDeviceRolesPartialUpdateParams creates a new DcimDeviceRolesPartialUpdateParams object +// with the default values initialized. +func NewDcimDeviceRolesPartialUpdateParams() *DcimDeviceRolesPartialUpdateParams { + var () + return &DcimDeviceRolesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesPartialUpdateParamsWithTimeout creates a new DcimDeviceRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesPartialUpdateParams { + var () + return &DcimDeviceRolesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesPartialUpdateParamsWithContext creates a new DcimDeviceRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesPartialUpdateParamsWithContext(ctx context.Context) *DcimDeviceRolesPartialUpdateParams { + var () + return &DcimDeviceRolesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesPartialUpdateParamsWithHTTPClient creates a new DcimDeviceRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesPartialUpdateParams { + var () + return &DcimDeviceRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim device roles partial update operation typically these are written to a http.Request +*/ +type DcimDeviceRolesPartialUpdateParams struct { + + /*Data*/ + Data *models.DeviceRole + /*ID + A unique integer value identifying this device role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithContext(ctx context.Context) *DcimDeviceRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithData(data *models.DeviceRole) *DcimDeviceRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetData(data *models.DeviceRole) { + o.Data = data +} + +// WithID adds the id to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) WithID(id int64) *DcimDeviceRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles partial update params +func (o *DcimDeviceRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesPartialUpdateParams) 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_device_roles_partial_update_responses.go b/netbox/client/dcim/dcim_device_roles_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..783e9c3711b690995abfeee82dad6cb6a4b70c83 --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// DcimDeviceRolesPartialUpdateReader is a Reader for the DcimDeviceRolesPartialUpdate structure. +type DcimDeviceRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceRolesPartialUpdateOK() + 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()) + } +} + +// NewDcimDeviceRolesPartialUpdateOK creates a DcimDeviceRolesPartialUpdateOK with default headers values +func NewDcimDeviceRolesPartialUpdateOK() *DcimDeviceRolesPartialUpdateOK { + return &DcimDeviceRolesPartialUpdateOK{} +} + +/*DcimDeviceRolesPartialUpdateOK handles this case with default header values. + +DcimDeviceRolesPartialUpdateOK dcim device roles partial update o k +*/ +type DcimDeviceRolesPartialUpdateOK struct { + Payload *models.DeviceRole +} + +func (o *DcimDeviceRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/device-roles/{id}/][%d] dcimDeviceRolesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceRole) + + // 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_device_roles_read_parameters.go b/netbox/client/dcim/dcim_device_roles_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..fcfe0dff0eaf920e3b1fabf058d7e8291877588c --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// NewDcimDeviceRolesReadParams creates a new DcimDeviceRolesReadParams object +// with the default values initialized. +func NewDcimDeviceRolesReadParams() *DcimDeviceRolesReadParams { + var () + return &DcimDeviceRolesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesReadParamsWithTimeout creates a new DcimDeviceRolesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesReadParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesReadParams { + var () + return &DcimDeviceRolesReadParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesReadParamsWithContext creates a new DcimDeviceRolesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesReadParamsWithContext(ctx context.Context) *DcimDeviceRolesReadParams { + var () + return &DcimDeviceRolesReadParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesReadParamsWithHTTPClient creates a new DcimDeviceRolesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesReadParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesReadParams { + var () + return &DcimDeviceRolesReadParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesReadParams contains all the parameters to send to the API endpoint +for the dcim device roles read operation typically these are written to a http.Request +*/ +type DcimDeviceRolesReadParams struct { + + /*ID + A unique integer value identifying this device role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) WithContext(ctx context.Context) *DcimDeviceRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) WithID(id int64) *DcimDeviceRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles read params +func (o *DcimDeviceRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesReadParams) 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_device_roles_read_responses.go b/netbox/client/dcim/dcim_device_roles_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ab41ceb7b00fa7dab2c7fdea8c738f5fa430da67 --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// DcimDeviceRolesReadReader is a Reader for the DcimDeviceRolesRead structure. +type DcimDeviceRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceRolesReadOK() + 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()) + } +} + +// NewDcimDeviceRolesReadOK creates a DcimDeviceRolesReadOK with default headers values +func NewDcimDeviceRolesReadOK() *DcimDeviceRolesReadOK { + return &DcimDeviceRolesReadOK{} +} + +/*DcimDeviceRolesReadOK handles this case with default header values. + +DcimDeviceRolesReadOK dcim device roles read o k +*/ +type DcimDeviceRolesReadOK struct { + Payload *models.DeviceRole +} + +func (o *DcimDeviceRolesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-roles/{id}/][%d] dcimDeviceRolesReadOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceRole) + + // 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_device_roles_update_parameters.go b/netbox/client/dcim/dcim_device_roles_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5bcb2356ef397dc4638d62bd928f4b8289b2dfd5 --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// NewDcimDeviceRolesUpdateParams creates a new DcimDeviceRolesUpdateParams object +// with the default values initialized. +func NewDcimDeviceRolesUpdateParams() *DcimDeviceRolesUpdateParams { + var () + return &DcimDeviceRolesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceRolesUpdateParamsWithTimeout creates a new DcimDeviceRolesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceRolesUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceRolesUpdateParams { + var () + return &DcimDeviceRolesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceRolesUpdateParamsWithContext creates a new DcimDeviceRolesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceRolesUpdateParamsWithContext(ctx context.Context) *DcimDeviceRolesUpdateParams { + var () + return &DcimDeviceRolesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceRolesUpdateParamsWithHTTPClient creates a new DcimDeviceRolesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceRolesUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceRolesUpdateParams { + var () + return &DcimDeviceRolesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceRolesUpdateParams contains all the parameters to send to the API endpoint +for the dcim device roles update operation typically these are written to a http.Request +*/ +type DcimDeviceRolesUpdateParams struct { + + /*Data*/ + Data *models.DeviceRole + /*ID + A unique integer value identifying this device role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithContext(ctx context.Context) *DcimDeviceRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithData(data *models.DeviceRole) *DcimDeviceRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetData(data *models.DeviceRole) { + o.Data = data +} + +// WithID adds the id to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) WithID(id int64) *DcimDeviceRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device roles update params +func (o *DcimDeviceRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceRolesUpdateParams) 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_device_roles_update_responses.go b/netbox/client/dcim/dcim_device_roles_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9cf2d390838323d76bcb86ebd88a5f0461691b74 --- /dev/null +++ b/netbox/client/dcim/dcim_device_roles_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" +) + +// DcimDeviceRolesUpdateReader is a Reader for the DcimDeviceRolesUpdate structure. +type DcimDeviceRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceRolesUpdateOK() + 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()) + } +} + +// NewDcimDeviceRolesUpdateOK creates a DcimDeviceRolesUpdateOK with default headers values +func NewDcimDeviceRolesUpdateOK() *DcimDeviceRolesUpdateOK { + return &DcimDeviceRolesUpdateOK{} +} + +/*DcimDeviceRolesUpdateOK handles this case with default header values. + +DcimDeviceRolesUpdateOK dcim device roles update o k +*/ +type DcimDeviceRolesUpdateOK struct { + Payload *models.DeviceRole +} + +func (o *DcimDeviceRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/device-roles/{id}/][%d] dcimDeviceRolesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceRole) + + // 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_device_types_create_parameters.go b/netbox/client/dcim/dcim_device_types_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a2f9c85bd0d76363621e1e54dd9687ccc5ec19ac --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// NewDcimDeviceTypesCreateParams creates a new DcimDeviceTypesCreateParams object +// with the default values initialized. +func NewDcimDeviceTypesCreateParams() *DcimDeviceTypesCreateParams { + var () + return &DcimDeviceTypesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesCreateParamsWithTimeout creates a new DcimDeviceTypesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesCreateParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesCreateParams { + var () + return &DcimDeviceTypesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesCreateParamsWithContext creates a new DcimDeviceTypesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesCreateParamsWithContext(ctx context.Context) *DcimDeviceTypesCreateParams { + var () + return &DcimDeviceTypesCreateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesCreateParamsWithHTTPClient creates a new DcimDeviceTypesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesCreateParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesCreateParams { + var () + return &DcimDeviceTypesCreateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesCreateParams contains all the parameters to send to the API endpoint +for the dcim device types create operation typically these are written to a http.Request +*/ +type DcimDeviceTypesCreateParams struct { + + /*Data*/ + Data *models.WritableDeviceType + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) WithContext(ctx context.Context) *DcimDeviceTypesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) WithData(data *models.WritableDeviceType) *DcimDeviceTypesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device types create params +func (o *DcimDeviceTypesCreateParams) SetData(data *models.WritableDeviceType) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesCreateParams) 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_device_types_create_responses.go b/netbox/client/dcim/dcim_device_types_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d9c9a546aa3a97fa48e9a5d481f1f01707c627c7 --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// DcimDeviceTypesCreateReader is a Reader for the DcimDeviceTypesCreate structure. +type DcimDeviceTypesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDeviceTypesCreateCreated() + 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()) + } +} + +// NewDcimDeviceTypesCreateCreated creates a DcimDeviceTypesCreateCreated with default headers values +func NewDcimDeviceTypesCreateCreated() *DcimDeviceTypesCreateCreated { + return &DcimDeviceTypesCreateCreated{} +} + +/*DcimDeviceTypesCreateCreated handles this case with default header values. + +DcimDeviceTypesCreateCreated dcim device types create created +*/ +type DcimDeviceTypesCreateCreated struct { + Payload *models.WritableDeviceType +} + +func (o *DcimDeviceTypesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/device-types/][%d] dcimDeviceTypesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDeviceTypesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceType) + + // 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_device_types_delete_parameters.go b/netbox/client/dcim/dcim_device_types_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..73b96db39d64c1a803b268048479b4a00f2af84a --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// NewDcimDeviceTypesDeleteParams creates a new DcimDeviceTypesDeleteParams object +// with the default values initialized. +func NewDcimDeviceTypesDeleteParams() *DcimDeviceTypesDeleteParams { + var () + return &DcimDeviceTypesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesDeleteParamsWithTimeout creates a new DcimDeviceTypesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesDeleteParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesDeleteParams { + var () + return &DcimDeviceTypesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesDeleteParamsWithContext creates a new DcimDeviceTypesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesDeleteParamsWithContext(ctx context.Context) *DcimDeviceTypesDeleteParams { + var () + return &DcimDeviceTypesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesDeleteParamsWithHTTPClient creates a new DcimDeviceTypesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesDeleteParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesDeleteParams { + var () + return &DcimDeviceTypesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesDeleteParams contains all the parameters to send to the API endpoint +for the dcim device types delete operation typically these are written to a http.Request +*/ +type DcimDeviceTypesDeleteParams struct { + + /*ID + A unique integer value identifying this device type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) WithContext(ctx context.Context) *DcimDeviceTypesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) WithID(id int64) *DcimDeviceTypesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device types delete params +func (o *DcimDeviceTypesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesDeleteParams) 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_device_types_delete_responses.go b/netbox/client/dcim/dcim_device_types_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9ac4bdbb7f7cd592228a18123b1acf73e7055b9e --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// DcimDeviceTypesDeleteReader is a Reader for the DcimDeviceTypesDelete structure. +type DcimDeviceTypesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDeviceTypesDeleteNoContent() + 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()) + } +} + +// NewDcimDeviceTypesDeleteNoContent creates a DcimDeviceTypesDeleteNoContent with default headers values +func NewDcimDeviceTypesDeleteNoContent() *DcimDeviceTypesDeleteNoContent { + return &DcimDeviceTypesDeleteNoContent{} +} + +/*DcimDeviceTypesDeleteNoContent handles this case with default header values. + +DcimDeviceTypesDeleteNoContent dcim device types delete no content +*/ +type DcimDeviceTypesDeleteNoContent struct { +} + +func (o *DcimDeviceTypesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/device-types/{id}/][%d] dcimDeviceTypesDeleteNoContent ", 204) +} + +func (o *DcimDeviceTypesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_device_types_list_parameters.go b/netbox/client/dcim/dcim_device_types_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ea5e47a942abd6042b8795cafcafb3a1fefe97f3 --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_list_parameters.go @@ -0,0 +1,561 @@ +// 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" +) + +// NewDcimDeviceTypesListParams creates a new DcimDeviceTypesListParams object +// with the default values initialized. +func NewDcimDeviceTypesListParams() *DcimDeviceTypesListParams { + var () + return &DcimDeviceTypesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesListParamsWithTimeout creates a new DcimDeviceTypesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesListParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesListParams { + var () + return &DcimDeviceTypesListParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesListParamsWithContext creates a new DcimDeviceTypesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesListParamsWithContext(ctx context.Context) *DcimDeviceTypesListParams { + var () + return &DcimDeviceTypesListParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesListParamsWithHTTPClient creates a new DcimDeviceTypesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesListParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesListParams { + var () + return &DcimDeviceTypesListParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesListParams contains all the parameters to send to the API endpoint +for the dcim device types list operation typically these are written to a http.Request +*/ +type DcimDeviceTypesListParams struct { + + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*IsConsoleServer*/ + IsConsoleServer *string + /*IsFullDepth*/ + IsFullDepth *string + /*IsNetworkDevice*/ + IsNetworkDevice *string + /*IsPdu*/ + IsPdu *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Manufacturer*/ + Manufacturer *string + /*ManufacturerID*/ + ManufacturerID *string + /*Model*/ + Model *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*PartNumber*/ + PartNumber *string + /*Q*/ + Q *string + /*Slug*/ + Slug *string + /*SubdeviceRole*/ + SubdeviceRole *string + /*UHeight*/ + UHeight *float64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithContext(ctx context.Context) *DcimDeviceTypesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIDIn adds the iDIn to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIDIn(iDIn *float64) *DcimDeviceTypesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithIsConsoleServer adds the isConsoleServer to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIsConsoleServer(isConsoleServer *string) *DcimDeviceTypesListParams { + o.SetIsConsoleServer(isConsoleServer) + return o +} + +// SetIsConsoleServer adds the isConsoleServer to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIsConsoleServer(isConsoleServer *string) { + o.IsConsoleServer = isConsoleServer +} + +// WithIsFullDepth adds the isFullDepth to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIsFullDepth(isFullDepth *string) *DcimDeviceTypesListParams { + o.SetIsFullDepth(isFullDepth) + return o +} + +// SetIsFullDepth adds the isFullDepth to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIsFullDepth(isFullDepth *string) { + o.IsFullDepth = isFullDepth +} + +// WithIsNetworkDevice adds the isNetworkDevice to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIsNetworkDevice(isNetworkDevice *string) *DcimDeviceTypesListParams { + o.SetIsNetworkDevice(isNetworkDevice) + return o +} + +// SetIsNetworkDevice adds the isNetworkDevice to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIsNetworkDevice(isNetworkDevice *string) { + o.IsNetworkDevice = isNetworkDevice +} + +// WithIsPdu adds the isPdu to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithIsPdu(isPdu *string) *DcimDeviceTypesListParams { + o.SetIsPdu(isPdu) + return o +} + +// SetIsPdu adds the isPdu to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetIsPdu(isPdu *string) { + o.IsPdu = isPdu +} + +// WithLimit adds the limit to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithLimit(limit *int64) *DcimDeviceTypesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithManufacturer adds the manufacturer to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithManufacturer(manufacturer *string) *DcimDeviceTypesListParams { + o.SetManufacturer(manufacturer) + return o +} + +// SetManufacturer adds the manufacturer to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetManufacturer(manufacturer *string) { + o.Manufacturer = manufacturer +} + +// WithManufacturerID adds the manufacturerID to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithManufacturerID(manufacturerID *string) *DcimDeviceTypesListParams { + o.SetManufacturerID(manufacturerID) + return o +} + +// SetManufacturerID adds the manufacturerId to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetManufacturerID(manufacturerID *string) { + o.ManufacturerID = manufacturerID +} + +// WithModel adds the model to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithModel(model *string) *DcimDeviceTypesListParams { + o.SetModel(model) + return o +} + +// SetModel adds the model to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetModel(model *string) { + o.Model = model +} + +// WithOffset adds the offset to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithOffset(offset *int64) *DcimDeviceTypesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPartNumber adds the partNumber to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithPartNumber(partNumber *string) *DcimDeviceTypesListParams { + o.SetPartNumber(partNumber) + return o +} + +// SetPartNumber adds the partNumber to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetPartNumber(partNumber *string) { + o.PartNumber = partNumber +} + +// WithQ adds the q to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithQ(q *string) *DcimDeviceTypesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetQ(q *string) { + o.Q = q +} + +// WithSlug adds the slug to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithSlug(slug *string) *DcimDeviceTypesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithSubdeviceRole adds the subdeviceRole to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithSubdeviceRole(subdeviceRole *string) *DcimDeviceTypesListParams { + o.SetSubdeviceRole(subdeviceRole) + return o +} + +// SetSubdeviceRole adds the subdeviceRole to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetSubdeviceRole(subdeviceRole *string) { + o.SubdeviceRole = subdeviceRole +} + +// WithUHeight adds the uHeight to the dcim device types list params +func (o *DcimDeviceTypesListParams) WithUHeight(uHeight *float64) *DcimDeviceTypesListParams { + o.SetUHeight(uHeight) + return o +} + +// SetUHeight adds the uHeight to the dcim device types list params +func (o *DcimDeviceTypesListParams) SetUHeight(uHeight *float64) { + o.UHeight = uHeight +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.IsConsoleServer != nil { + + // query param is_console_server + var qrIsConsoleServer string + if o.IsConsoleServer != nil { + qrIsConsoleServer = *o.IsConsoleServer + } + qIsConsoleServer := qrIsConsoleServer + if qIsConsoleServer != "" { + if err := r.SetQueryParam("is_console_server", qIsConsoleServer); err != nil { + return err + } + } + + } + + if o.IsFullDepth != nil { + + // query param is_full_depth + var qrIsFullDepth string + if o.IsFullDepth != nil { + qrIsFullDepth = *o.IsFullDepth + } + qIsFullDepth := qrIsFullDepth + if qIsFullDepth != "" { + if err := r.SetQueryParam("is_full_depth", qIsFullDepth); err != nil { + return err + } + } + + } + + if o.IsNetworkDevice != nil { + + // query param is_network_device + var qrIsNetworkDevice string + if o.IsNetworkDevice != nil { + qrIsNetworkDevice = *o.IsNetworkDevice + } + qIsNetworkDevice := qrIsNetworkDevice + if qIsNetworkDevice != "" { + if err := r.SetQueryParam("is_network_device", qIsNetworkDevice); err != nil { + return err + } + } + + } + + if o.IsPdu != nil { + + // query param is_pdu + var qrIsPdu string + if o.IsPdu != nil { + qrIsPdu = *o.IsPdu + } + qIsPdu := qrIsPdu + if qIsPdu != "" { + if err := r.SetQueryParam("is_pdu", qIsPdu); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + 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.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.Model != nil { + + // query param model + var qrModel string + if o.Model != nil { + qrModel = *o.Model + } + qModel := qrModel + if qModel != "" { + if err := r.SetQueryParam("model", qModel); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.PartNumber != nil { + + // query param part_number + var qrPartNumber string + if o.PartNumber != nil { + qrPartNumber = *o.PartNumber + } + qPartNumber := qrPartNumber + if qPartNumber != "" { + if err := r.SetQueryParam("part_number", qPartNumber); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if o.SubdeviceRole != nil { + + // query param subdevice_role + var qrSubdeviceRole string + if o.SubdeviceRole != nil { + qrSubdeviceRole = *o.SubdeviceRole + } + qSubdeviceRole := qrSubdeviceRole + if qSubdeviceRole != "" { + if err := r.SetQueryParam("subdevice_role", qSubdeviceRole); err != nil { + return err + } + } + + } + + if o.UHeight != nil { + + // query param u_height + var qrUHeight float64 + if o.UHeight != nil { + qrUHeight = *o.UHeight + } + qUHeight := swag.FormatFloat64(qrUHeight) + if qUHeight != "" { + if err := r.SetQueryParam("u_height", qUHeight); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_device_types_list_responses.go b/netbox/client/dcim/dcim_device_types_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3517b8c7a85b4b1cc2747dd7eccd7641ee33e67f --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// DcimDeviceTypesListReader is a Reader for the DcimDeviceTypesList structure. +type DcimDeviceTypesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceTypesListOK() + 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()) + } +} + +// NewDcimDeviceTypesListOK creates a DcimDeviceTypesListOK with default headers values +func NewDcimDeviceTypesListOK() *DcimDeviceTypesListOK { + return &DcimDeviceTypesListOK{} +} + +/*DcimDeviceTypesListOK handles this case with default header values. + +DcimDeviceTypesListOK dcim device types list o k +*/ +type DcimDeviceTypesListOK struct { + Payload *models.DcimDeviceTypesListOKBody +} + +func (o *DcimDeviceTypesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-types/][%d] dcimDeviceTypesListOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDeviceTypesListOKBody) + + // 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_device_types_partial_update_parameters.go b/netbox/client/dcim/dcim_device_types_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ce745de6106a6ca129338d7e36291f706e22b470 --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// NewDcimDeviceTypesPartialUpdateParams creates a new DcimDeviceTypesPartialUpdateParams object +// with the default values initialized. +func NewDcimDeviceTypesPartialUpdateParams() *DcimDeviceTypesPartialUpdateParams { + var () + return &DcimDeviceTypesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesPartialUpdateParamsWithTimeout creates a new DcimDeviceTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesPartialUpdateParams { + var () + return &DcimDeviceTypesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesPartialUpdateParamsWithContext creates a new DcimDeviceTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesPartialUpdateParamsWithContext(ctx context.Context) *DcimDeviceTypesPartialUpdateParams { + var () + return &DcimDeviceTypesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesPartialUpdateParamsWithHTTPClient creates a new DcimDeviceTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesPartialUpdateParams { + var () + return &DcimDeviceTypesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim device types partial update operation typically these are written to a http.Request +*/ +type DcimDeviceTypesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceType + /*ID + A unique integer value identifying this device type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithContext(ctx context.Context) *DcimDeviceTypesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithData(data *models.WritableDeviceType) *DcimDeviceTypesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetData(data *models.WritableDeviceType) { + o.Data = data +} + +// WithID adds the id to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) WithID(id int64) *DcimDeviceTypesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device types partial update params +func (o *DcimDeviceTypesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesPartialUpdateParams) 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_device_types_partial_update_responses.go b/netbox/client/dcim/dcim_device_types_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3919152f0ea86e5f182e1af1a32a61a8c2894d37 --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// DcimDeviceTypesPartialUpdateReader is a Reader for the DcimDeviceTypesPartialUpdate structure. +type DcimDeviceTypesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceTypesPartialUpdateOK() + 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()) + } +} + +// NewDcimDeviceTypesPartialUpdateOK creates a DcimDeviceTypesPartialUpdateOK with default headers values +func NewDcimDeviceTypesPartialUpdateOK() *DcimDeviceTypesPartialUpdateOK { + return &DcimDeviceTypesPartialUpdateOK{} +} + +/*DcimDeviceTypesPartialUpdateOK handles this case with default header values. + +DcimDeviceTypesPartialUpdateOK dcim device types partial update o k +*/ +type DcimDeviceTypesPartialUpdateOK struct { + Payload *models.WritableDeviceType +} + +func (o *DcimDeviceTypesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/device-types/{id}/][%d] dcimDeviceTypesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceTypesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceType) + + // 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_device_types_read_parameters.go b/netbox/client/dcim/dcim_device_types_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..76ecdd171039f499518a4de02608d512d0b5d37d --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// NewDcimDeviceTypesReadParams creates a new DcimDeviceTypesReadParams object +// with the default values initialized. +func NewDcimDeviceTypesReadParams() *DcimDeviceTypesReadParams { + var () + return &DcimDeviceTypesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesReadParamsWithTimeout creates a new DcimDeviceTypesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesReadParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesReadParams { + var () + return &DcimDeviceTypesReadParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesReadParamsWithContext creates a new DcimDeviceTypesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesReadParamsWithContext(ctx context.Context) *DcimDeviceTypesReadParams { + var () + return &DcimDeviceTypesReadParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesReadParamsWithHTTPClient creates a new DcimDeviceTypesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesReadParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesReadParams { + var () + return &DcimDeviceTypesReadParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesReadParams contains all the parameters to send to the API endpoint +for the dcim device types read operation typically these are written to a http.Request +*/ +type DcimDeviceTypesReadParams struct { + + /*ID + A unique integer value identifying this device type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types read params +func (o *DcimDeviceTypesReadParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types read params +func (o *DcimDeviceTypesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types read params +func (o *DcimDeviceTypesReadParams) WithContext(ctx context.Context) *DcimDeviceTypesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types read params +func (o *DcimDeviceTypesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types read params +func (o *DcimDeviceTypesReadParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types read params +func (o *DcimDeviceTypesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim device types read params +func (o *DcimDeviceTypesReadParams) WithID(id int64) *DcimDeviceTypesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device types read params +func (o *DcimDeviceTypesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesReadParams) 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_device_types_read_responses.go b/netbox/client/dcim/dcim_device_types_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7bbd843a941da4a46f4a40c77af28bbc8928c60e --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// DcimDeviceTypesReadReader is a Reader for the DcimDeviceTypesRead structure. +type DcimDeviceTypesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceTypesReadOK() + 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()) + } +} + +// NewDcimDeviceTypesReadOK creates a DcimDeviceTypesReadOK with default headers values +func NewDcimDeviceTypesReadOK() *DcimDeviceTypesReadOK { + return &DcimDeviceTypesReadOK{} +} + +/*DcimDeviceTypesReadOK handles this case with default header values. + +DcimDeviceTypesReadOK dcim device types read o k +*/ +type DcimDeviceTypesReadOK struct { + Payload *models.DeviceType +} + +func (o *DcimDeviceTypesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/device-types/{id}/][%d] dcimDeviceTypesReadOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceTypesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DeviceType) + + // 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_device_types_update_parameters.go b/netbox/client/dcim/dcim_device_types_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..bef64d6bc78621de047277e5c43e6bd887a20869 --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// NewDcimDeviceTypesUpdateParams creates a new DcimDeviceTypesUpdateParams object +// with the default values initialized. +func NewDcimDeviceTypesUpdateParams() *DcimDeviceTypesUpdateParams { + var () + return &DcimDeviceTypesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDeviceTypesUpdateParamsWithTimeout creates a new DcimDeviceTypesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDeviceTypesUpdateParamsWithTimeout(timeout time.Duration) *DcimDeviceTypesUpdateParams { + var () + return &DcimDeviceTypesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDeviceTypesUpdateParamsWithContext creates a new DcimDeviceTypesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDeviceTypesUpdateParamsWithContext(ctx context.Context) *DcimDeviceTypesUpdateParams { + var () + return &DcimDeviceTypesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDeviceTypesUpdateParamsWithHTTPClient creates a new DcimDeviceTypesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDeviceTypesUpdateParamsWithHTTPClient(client *http.Client) *DcimDeviceTypesUpdateParams { + var () + return &DcimDeviceTypesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDeviceTypesUpdateParams contains all the parameters to send to the API endpoint +for the dcim device types update operation typically these are written to a http.Request +*/ +type DcimDeviceTypesUpdateParams struct { + + /*Data*/ + Data *models.WritableDeviceType + /*ID + A unique integer value identifying this device type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithTimeout(timeout time.Duration) *DcimDeviceTypesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithContext(ctx context.Context) *DcimDeviceTypesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithHTTPClient(client *http.Client) *DcimDeviceTypesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithData(data *models.WritableDeviceType) *DcimDeviceTypesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetData(data *models.WritableDeviceType) { + o.Data = data +} + +// WithID adds the id to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) WithID(id int64) *DcimDeviceTypesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim device types update params +func (o *DcimDeviceTypesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDeviceTypesUpdateParams) 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_device_types_update_responses.go b/netbox/client/dcim/dcim_device_types_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a2551fbcd22ac10226fef00d77a74fb8af45dfe0 --- /dev/null +++ b/netbox/client/dcim/dcim_device_types_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" +) + +// DcimDeviceTypesUpdateReader is a Reader for the DcimDeviceTypesUpdate structure. +type DcimDeviceTypesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDeviceTypesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDeviceTypesUpdateOK() + 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()) + } +} + +// NewDcimDeviceTypesUpdateOK creates a DcimDeviceTypesUpdateOK with default headers values +func NewDcimDeviceTypesUpdateOK() *DcimDeviceTypesUpdateOK { + return &DcimDeviceTypesUpdateOK{} +} + +/*DcimDeviceTypesUpdateOK handles this case with default header values. + +DcimDeviceTypesUpdateOK dcim device types update o k +*/ +type DcimDeviceTypesUpdateOK struct { + Payload *models.WritableDeviceType +} + +func (o *DcimDeviceTypesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/device-types/{id}/][%d] dcimDeviceTypesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDeviceTypesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDeviceType) + + // 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_devices_create_parameters.go b/netbox/client/dcim/dcim_devices_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..38730d72ea9e0c24b0153211fb61ce25d4fd3cdf --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// NewDcimDevicesCreateParams creates a new DcimDevicesCreateParams object +// with the default values initialized. +func NewDcimDevicesCreateParams() *DcimDevicesCreateParams { + var () + return &DcimDevicesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesCreateParamsWithTimeout creates a new DcimDevicesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesCreateParamsWithTimeout(timeout time.Duration) *DcimDevicesCreateParams { + var () + return &DcimDevicesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesCreateParamsWithContext creates a new DcimDevicesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesCreateParamsWithContext(ctx context.Context) *DcimDevicesCreateParams { + var () + return &DcimDevicesCreateParams{ + + Context: ctx, + } +} + +// NewDcimDevicesCreateParamsWithHTTPClient creates a new DcimDevicesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesCreateParamsWithHTTPClient(client *http.Client) *DcimDevicesCreateParams { + var () + return &DcimDevicesCreateParams{ + HTTPClient: client, + } +} + +/*DcimDevicesCreateParams contains all the parameters to send to the API endpoint +for the dcim devices create operation typically these are written to a http.Request +*/ +type DcimDevicesCreateParams struct { + + /*Data*/ + Data *models.WritableDevice + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices create params +func (o *DcimDevicesCreateParams) WithTimeout(timeout time.Duration) *DcimDevicesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices create params +func (o *DcimDevicesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices create params +func (o *DcimDevicesCreateParams) WithContext(ctx context.Context) *DcimDevicesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices create params +func (o *DcimDevicesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices create params +func (o *DcimDevicesCreateParams) WithHTTPClient(client *http.Client) *DcimDevicesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices create params +func (o *DcimDevicesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim devices create params +func (o *DcimDevicesCreateParams) WithData(data *models.WritableDevice) *DcimDevicesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim devices create params +func (o *DcimDevicesCreateParams) SetData(data *models.WritableDevice) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesCreateParams) 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_devices_create_responses.go b/netbox/client/dcim/dcim_devices_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cf3c8244d493c5c665bb3963005a5bdc3db1e526 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// DcimDevicesCreateReader is a Reader for the DcimDevicesCreate structure. +type DcimDevicesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimDevicesCreateCreated() + 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()) + } +} + +// NewDcimDevicesCreateCreated creates a DcimDevicesCreateCreated with default headers values +func NewDcimDevicesCreateCreated() *DcimDevicesCreateCreated { + return &DcimDevicesCreateCreated{} +} + +/*DcimDevicesCreateCreated handles this case with default header values. + +DcimDevicesCreateCreated dcim devices create created +*/ +type DcimDevicesCreateCreated struct { + Payload *models.WritableDevice +} + +func (o *DcimDevicesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/devices/][%d] dcimDevicesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimDevicesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDevice) + + // 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_devices_delete_parameters.go b/netbox/client/dcim/dcim_devices_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7e2a5a102626eacc811ef79701abd56ac2a88f35 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// NewDcimDevicesDeleteParams creates a new DcimDevicesDeleteParams object +// with the default values initialized. +func NewDcimDevicesDeleteParams() *DcimDevicesDeleteParams { + var () + return &DcimDevicesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesDeleteParamsWithTimeout creates a new DcimDevicesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesDeleteParamsWithTimeout(timeout time.Duration) *DcimDevicesDeleteParams { + var () + return &DcimDevicesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesDeleteParamsWithContext creates a new DcimDevicesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesDeleteParamsWithContext(ctx context.Context) *DcimDevicesDeleteParams { + var () + return &DcimDevicesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimDevicesDeleteParamsWithHTTPClient creates a new DcimDevicesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesDeleteParamsWithHTTPClient(client *http.Client) *DcimDevicesDeleteParams { + var () + return &DcimDevicesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimDevicesDeleteParams contains all the parameters to send to the API endpoint +for the dcim devices delete operation typically these are written to a http.Request +*/ +type DcimDevicesDeleteParams struct { + + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices delete params +func (o *DcimDevicesDeleteParams) WithTimeout(timeout time.Duration) *DcimDevicesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices delete params +func (o *DcimDevicesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices delete params +func (o *DcimDevicesDeleteParams) WithContext(ctx context.Context) *DcimDevicesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices delete params +func (o *DcimDevicesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices delete params +func (o *DcimDevicesDeleteParams) WithHTTPClient(client *http.Client) *DcimDevicesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices delete params +func (o *DcimDevicesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim devices delete params +func (o *DcimDevicesDeleteParams) WithID(id int64) *DcimDevicesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices delete params +func (o *DcimDevicesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesDeleteParams) 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_devices_delete_responses.go b/netbox/client/dcim/dcim_devices_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ad800e46fa03b258dae0ecb99ffa1ca1348c86e6 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// DcimDevicesDeleteReader is a Reader for the DcimDevicesDelete structure. +type DcimDevicesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimDevicesDeleteNoContent() + 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()) + } +} + +// NewDcimDevicesDeleteNoContent creates a DcimDevicesDeleteNoContent with default headers values +func NewDcimDevicesDeleteNoContent() *DcimDevicesDeleteNoContent { + return &DcimDevicesDeleteNoContent{} +} + +/*DcimDevicesDeleteNoContent handles this case with default header values. + +DcimDevicesDeleteNoContent dcim devices delete no content +*/ +type DcimDevicesDeleteNoContent struct { +} + +func (o *DcimDevicesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/devices/{id}/][%d] dcimDevicesDeleteNoContent ", 204) +} + +func (o *DcimDevicesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_devices_list_parameters.go b/netbox/client/dcim/dcim_devices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6008c89aebbb2e338d3630015229c8f592979693 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_list_parameters.go @@ -0,0 +1,996 @@ +// 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" +) + +// NewDcimDevicesListParams creates a new DcimDevicesListParams object +// with the default values initialized. +func NewDcimDevicesListParams() *DcimDevicesListParams { + var () + return &DcimDevicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesListParamsWithTimeout creates a new DcimDevicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesListParamsWithTimeout(timeout time.Duration) *DcimDevicesListParams { + var () + return &DcimDevicesListParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesListParamsWithContext creates a new DcimDevicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesListParamsWithContext(ctx context.Context) *DcimDevicesListParams { + var () + return &DcimDevicesListParams{ + + Context: ctx, + } +} + +// NewDcimDevicesListParamsWithHTTPClient creates a new DcimDevicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesListParamsWithHTTPClient(client *http.Client) *DcimDevicesListParams { + var () + return &DcimDevicesListParams{ + HTTPClient: client, + } +} + +/*DcimDevicesListParams contains all the parameters to send to the API endpoint +for the dcim devices list operation typically these are written to a http.Request +*/ +type DcimDevicesListParams struct { + + /*AssetTag*/ + AssetTag *string + /*ClusterID*/ + ClusterID *string + /*DeviceTypeID*/ + DeviceTypeID *string + /*HasPrimaryIP*/ + HasPrimaryIP *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*IsConsoleServer*/ + IsConsoleServer *string + /*IsFullDepth*/ + IsFullDepth *string + /*IsNetworkDevice*/ + IsNetworkDevice *string + /*IsPdu*/ + IsPdu *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MacAddress*/ + MacAddress *string + /*Manufacturer*/ + Manufacturer *string + /*ManufacturerID*/ + ManufacturerID *string + /*Model*/ + Model *string + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Platform*/ + Platform *string + /*PlatformID*/ + PlatformID *string + /*Position*/ + Position *float64 + /*Q*/ + Q *string + /*RackGroupID*/ + RackGroupID *string + /*RackID*/ + RackID *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Serial*/ + Serial *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices list params +func (o *DcimDevicesListParams) WithTimeout(timeout time.Duration) *DcimDevicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices list params +func (o *DcimDevicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices list params +func (o *DcimDevicesListParams) WithContext(ctx context.Context) *DcimDevicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices list params +func (o *DcimDevicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices list params +func (o *DcimDevicesListParams) WithHTTPClient(client *http.Client) *DcimDevicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices list params +func (o *DcimDevicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAssetTag adds the assetTag to the dcim devices list params +func (o *DcimDevicesListParams) WithAssetTag(assetTag *string) *DcimDevicesListParams { + o.SetAssetTag(assetTag) + return o +} + +// SetAssetTag adds the assetTag to the dcim devices list params +func (o *DcimDevicesListParams) SetAssetTag(assetTag *string) { + o.AssetTag = assetTag +} + +// WithClusterID adds the clusterID to the dcim devices list params +func (o *DcimDevicesListParams) WithClusterID(clusterID *string) *DcimDevicesListParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the dcim devices list params +func (o *DcimDevicesListParams) SetClusterID(clusterID *string) { + o.ClusterID = clusterID +} + +// WithDeviceTypeID adds the deviceTypeID to the dcim devices list params +func (o *DcimDevicesListParams) WithDeviceTypeID(deviceTypeID *string) *DcimDevicesListParams { + o.SetDeviceTypeID(deviceTypeID) + return o +} + +// SetDeviceTypeID adds the deviceTypeId to the dcim devices list params +func (o *DcimDevicesListParams) SetDeviceTypeID(deviceTypeID *string) { + o.DeviceTypeID = deviceTypeID +} + +// WithHasPrimaryIP adds the hasPrimaryIP to the dcim devices list params +func (o *DcimDevicesListParams) WithHasPrimaryIP(hasPrimaryIP *string) *DcimDevicesListParams { + o.SetHasPrimaryIP(hasPrimaryIP) + return o +} + +// SetHasPrimaryIP adds the hasPrimaryIp to the dcim devices list params +func (o *DcimDevicesListParams) SetHasPrimaryIP(hasPrimaryIP *string) { + o.HasPrimaryIP = hasPrimaryIP +} + +// WithIDIn adds the iDIn to the dcim devices list params +func (o *DcimDevicesListParams) WithIDIn(iDIn *float64) *DcimDevicesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim devices list params +func (o *DcimDevicesListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithIsConsoleServer adds the isConsoleServer to the dcim devices list params +func (o *DcimDevicesListParams) WithIsConsoleServer(isConsoleServer *string) *DcimDevicesListParams { + o.SetIsConsoleServer(isConsoleServer) + return o +} + +// SetIsConsoleServer adds the isConsoleServer to the dcim devices list params +func (o *DcimDevicesListParams) SetIsConsoleServer(isConsoleServer *string) { + o.IsConsoleServer = isConsoleServer +} + +// WithIsFullDepth adds the isFullDepth to the dcim devices list params +func (o *DcimDevicesListParams) WithIsFullDepth(isFullDepth *string) *DcimDevicesListParams { + o.SetIsFullDepth(isFullDepth) + return o +} + +// SetIsFullDepth adds the isFullDepth to the dcim devices list params +func (o *DcimDevicesListParams) SetIsFullDepth(isFullDepth *string) { + o.IsFullDepth = isFullDepth +} + +// WithIsNetworkDevice adds the isNetworkDevice to the dcim devices list params +func (o *DcimDevicesListParams) WithIsNetworkDevice(isNetworkDevice *string) *DcimDevicesListParams { + o.SetIsNetworkDevice(isNetworkDevice) + return o +} + +// SetIsNetworkDevice adds the isNetworkDevice to the dcim devices list params +func (o *DcimDevicesListParams) SetIsNetworkDevice(isNetworkDevice *string) { + o.IsNetworkDevice = isNetworkDevice +} + +// WithIsPdu adds the isPdu to the dcim devices list params +func (o *DcimDevicesListParams) WithIsPdu(isPdu *string) *DcimDevicesListParams { + o.SetIsPdu(isPdu) + return o +} + +// SetIsPdu adds the isPdu to the dcim devices list params +func (o *DcimDevicesListParams) SetIsPdu(isPdu *string) { + o.IsPdu = isPdu +} + +// WithLimit adds the limit to the dcim devices list params +func (o *DcimDevicesListParams) WithLimit(limit *int64) *DcimDevicesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim devices list params +func (o *DcimDevicesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMacAddress adds the macAddress to the dcim devices list params +func (o *DcimDevicesListParams) WithMacAddress(macAddress *string) *DcimDevicesListParams { + o.SetMacAddress(macAddress) + return o +} + +// SetMacAddress adds the macAddress to the dcim devices list params +func (o *DcimDevicesListParams) SetMacAddress(macAddress *string) { + o.MacAddress = macAddress +} + +// WithManufacturer adds the manufacturer to the dcim devices list params +func (o *DcimDevicesListParams) WithManufacturer(manufacturer *string) *DcimDevicesListParams { + o.SetManufacturer(manufacturer) + return o +} + +// SetManufacturer adds the manufacturer to the dcim devices list params +func (o *DcimDevicesListParams) SetManufacturer(manufacturer *string) { + o.Manufacturer = manufacturer +} + +// WithManufacturerID adds the manufacturerID to the dcim devices list params +func (o *DcimDevicesListParams) WithManufacturerID(manufacturerID *string) *DcimDevicesListParams { + o.SetManufacturerID(manufacturerID) + return o +} + +// SetManufacturerID adds the manufacturerId to the dcim devices list params +func (o *DcimDevicesListParams) SetManufacturerID(manufacturerID *string) { + o.ManufacturerID = manufacturerID +} + +// WithModel adds the model to the dcim devices list params +func (o *DcimDevicesListParams) WithModel(model *string) *DcimDevicesListParams { + o.SetModel(model) + return o +} + +// SetModel adds the model to the dcim devices list params +func (o *DcimDevicesListParams) SetModel(model *string) { + o.Model = model +} + +// WithName adds the name to the dcim devices list params +func (o *DcimDevicesListParams) WithName(name *string) *DcimDevicesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim devices list params +func (o *DcimDevicesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim devices list params +func (o *DcimDevicesListParams) WithOffset(offset *int64) *DcimDevicesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim devices list params +func (o *DcimDevicesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlatform adds the platform to the dcim devices list params +func (o *DcimDevicesListParams) WithPlatform(platform *string) *DcimDevicesListParams { + o.SetPlatform(platform) + return o +} + +// SetPlatform adds the platform to the dcim devices list params +func (o *DcimDevicesListParams) SetPlatform(platform *string) { + o.Platform = platform +} + +// WithPlatformID adds the platformID to the dcim devices list params +func (o *DcimDevicesListParams) WithPlatformID(platformID *string) *DcimDevicesListParams { + o.SetPlatformID(platformID) + return o +} + +// SetPlatformID adds the platformId to the dcim devices list params +func (o *DcimDevicesListParams) SetPlatformID(platformID *string) { + o.PlatformID = platformID +} + +// WithPosition adds the position to the dcim devices list params +func (o *DcimDevicesListParams) WithPosition(position *float64) *DcimDevicesListParams { + o.SetPosition(position) + return o +} + +// SetPosition adds the position to the dcim devices list params +func (o *DcimDevicesListParams) SetPosition(position *float64) { + o.Position = position +} + +// WithQ adds the q to the dcim devices list params +func (o *DcimDevicesListParams) WithQ(q *string) *DcimDevicesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim devices list params +func (o *DcimDevicesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRackGroupID adds the rackGroupID to the dcim devices list params +func (o *DcimDevicesListParams) WithRackGroupID(rackGroupID *string) *DcimDevicesListParams { + o.SetRackGroupID(rackGroupID) + return o +} + +// SetRackGroupID adds the rackGroupId to the dcim devices list params +func (o *DcimDevicesListParams) SetRackGroupID(rackGroupID *string) { + o.RackGroupID = rackGroupID +} + +// WithRackID adds the rackID to the dcim devices list params +func (o *DcimDevicesListParams) WithRackID(rackID *string) *DcimDevicesListParams { + o.SetRackID(rackID) + return o +} + +// SetRackID adds the rackId to the dcim devices list params +func (o *DcimDevicesListParams) SetRackID(rackID *string) { + o.RackID = rackID +} + +// WithRole adds the role to the dcim devices list params +func (o *DcimDevicesListParams) WithRole(role *string) *DcimDevicesListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the dcim devices list params +func (o *DcimDevicesListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the dcim devices list params +func (o *DcimDevicesListParams) WithRoleID(roleID *string) *DcimDevicesListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the dcim devices list params +func (o *DcimDevicesListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSerial adds the serial to the dcim devices list params +func (o *DcimDevicesListParams) WithSerial(serial *string) *DcimDevicesListParams { + o.SetSerial(serial) + return o +} + +// SetSerial adds the serial to the dcim devices list params +func (o *DcimDevicesListParams) SetSerial(serial *string) { + o.Serial = serial +} + +// WithSite adds the site to the dcim devices list params +func (o *DcimDevicesListParams) WithSite(site *string) *DcimDevicesListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim devices list params +func (o *DcimDevicesListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim devices list params +func (o *DcimDevicesListParams) WithSiteID(siteID *string) *DcimDevicesListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim devices list params +func (o *DcimDevicesListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the dcim devices list params +func (o *DcimDevicesListParams) WithStatus(status *string) *DcimDevicesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the dcim devices list params +func (o *DcimDevicesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the dcim devices list params +func (o *DcimDevicesListParams) WithTenant(tenant *string) *DcimDevicesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim devices list params +func (o *DcimDevicesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the dcim devices list params +func (o *DcimDevicesListParams) WithTenantID(tenantID *string) *DcimDevicesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim devices list params +func (o *DcimDevicesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AssetTag != nil { + + // query param asset_tag + var qrAssetTag string + if o.AssetTag != nil { + qrAssetTag = *o.AssetTag + } + qAssetTag := qrAssetTag + if qAssetTag != "" { + if err := r.SetQueryParam("asset_tag", qAssetTag); err != nil { + return err + } + } + + } + + if o.ClusterID != nil { + + // query param cluster_id + var qrClusterID string + if o.ClusterID != nil { + qrClusterID = *o.ClusterID + } + qClusterID := qrClusterID + if qClusterID != "" { + if err := r.SetQueryParam("cluster_id", qClusterID); err != nil { + return err + } + } + + } + + if o.DeviceTypeID != nil { + + // query param device_type_id + var qrDeviceTypeID string + if o.DeviceTypeID != nil { + qrDeviceTypeID = *o.DeviceTypeID + } + qDeviceTypeID := qrDeviceTypeID + if qDeviceTypeID != "" { + if err := r.SetQueryParam("device_type_id", qDeviceTypeID); err != nil { + return err + } + } + + } + + if o.HasPrimaryIP != nil { + + // query param has_primary_ip + var qrHasPrimaryIP string + if o.HasPrimaryIP != nil { + qrHasPrimaryIP = *o.HasPrimaryIP + } + qHasPrimaryIP := qrHasPrimaryIP + if qHasPrimaryIP != "" { + if err := r.SetQueryParam("has_primary_ip", qHasPrimaryIP); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.IsConsoleServer != nil { + + // query param is_console_server + var qrIsConsoleServer string + if o.IsConsoleServer != nil { + qrIsConsoleServer = *o.IsConsoleServer + } + qIsConsoleServer := qrIsConsoleServer + if qIsConsoleServer != "" { + if err := r.SetQueryParam("is_console_server", qIsConsoleServer); err != nil { + return err + } + } + + } + + if o.IsFullDepth != nil { + + // query param is_full_depth + var qrIsFullDepth string + if o.IsFullDepth != nil { + qrIsFullDepth = *o.IsFullDepth + } + qIsFullDepth := qrIsFullDepth + if qIsFullDepth != "" { + if err := r.SetQueryParam("is_full_depth", qIsFullDepth); err != nil { + return err + } + } + + } + + if o.IsNetworkDevice != nil { + + // query param is_network_device + var qrIsNetworkDevice string + if o.IsNetworkDevice != nil { + qrIsNetworkDevice = *o.IsNetworkDevice + } + qIsNetworkDevice := qrIsNetworkDevice + if qIsNetworkDevice != "" { + if err := r.SetQueryParam("is_network_device", qIsNetworkDevice); err != nil { + return err + } + } + + } + + if o.IsPdu != nil { + + // query param is_pdu + var qrIsPdu string + if o.IsPdu != nil { + qrIsPdu = *o.IsPdu + } + qIsPdu := qrIsPdu + if qIsPdu != "" { + if err := r.SetQueryParam("is_pdu", qIsPdu); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + 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.MacAddress != nil { + + // query param mac_address + var qrMacAddress string + if o.MacAddress != nil { + qrMacAddress = *o.MacAddress + } + qMacAddress := qrMacAddress + if qMacAddress != "" { + if err := r.SetQueryParam("mac_address", qMacAddress); err != nil { + return err + } + } + + } + + 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.Model != nil { + + // query param model + var qrModel string + if o.Model != nil { + qrModel = *o.Model + } + qModel := qrModel + if qModel != "" { + if err := r.SetQueryParam("model", qModel); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Platform != nil { + + // query param platform + var qrPlatform string + if o.Platform != nil { + qrPlatform = *o.Platform + } + qPlatform := qrPlatform + if qPlatform != "" { + if err := r.SetQueryParam("platform", qPlatform); err != nil { + return err + } + } + + } + + if o.PlatformID != nil { + + // query param platform_id + var qrPlatformID string + if o.PlatformID != nil { + qrPlatformID = *o.PlatformID + } + qPlatformID := qrPlatformID + if qPlatformID != "" { + if err := r.SetQueryParam("platform_id", qPlatformID); err != nil { + return err + } + } + + } + + if o.Position != nil { + + // query param position + var qrPosition float64 + if o.Position != nil { + qrPosition = *o.Position + } + qPosition := swag.FormatFloat64(qrPosition) + if qPosition != "" { + if err := r.SetQueryParam("position", qPosition); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.RackGroupID != nil { + + // query param rack_group_id + var qrRackGroupID string + if o.RackGroupID != nil { + qrRackGroupID = *o.RackGroupID + } + qRackGroupID := qrRackGroupID + if qRackGroupID != "" { + if err := r.SetQueryParam("rack_group_id", qRackGroupID); err != nil { + return err + } + } + + } + + if o.RackID != nil { + + // query param rack_id + var qrRackID string + if o.RackID != nil { + qrRackID = *o.RackID + } + qRackID := qrRackID + if qRackID != "" { + if err := r.SetQueryParam("rack_id", qRackID); err != nil { + return err + } + } + + } + + if o.Role != nil { + + // query param role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + + } + + if o.RoleID != nil { + + // query param role_id + var qrRoleID string + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + if err := r.SetQueryParam("role_id", qRoleID); err != nil { + return err + } + } + + } + + if o.Serial != nil { + + // query param serial + var qrSerial string + if o.Serial != nil { + qrSerial = *o.Serial + } + qSerial := qrSerial + if qSerial != "" { + if err := r.SetQueryParam("serial", qSerial); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Status != nil { + + // query param status + var qrStatus string + if o.Status != nil { + qrStatus = *o.Status + } + qStatus := qrStatus + if qStatus != "" { + if err := r.SetQueryParam("status", qStatus); err != nil { + return err + } + } + + } + + if o.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_devices_list_responses.go b/netbox/client/dcim/dcim_devices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f29d2bc70348e933dad8ad7179cdde4390ff77ab --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// DcimDevicesListReader is a Reader for the DcimDevicesList structure. +type DcimDevicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesListOK() + 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()) + } +} + +// NewDcimDevicesListOK creates a DcimDevicesListOK with default headers values +func NewDcimDevicesListOK() *DcimDevicesListOK { + return &DcimDevicesListOK{} +} + +/*DcimDevicesListOK handles this case with default header values. + +DcimDevicesListOK dcim devices list o k +*/ +type DcimDevicesListOK struct { + Payload *models.DcimDevicesListOKBody +} + +func (o *DcimDevicesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/devices/][%d] dcimDevicesListOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimDevicesListOKBody) + + // 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_devices_napalm_parameters.go b/netbox/client/dcim/dcim_devices_napalm_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..df489cadd5715819f9969264fdec7520d394259c --- /dev/null +++ b/netbox/client/dcim/dcim_devices_napalm_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" +) + +// NewDcimDevicesNapalmParams creates a new DcimDevicesNapalmParams object +// with the default values initialized. +func NewDcimDevicesNapalmParams() *DcimDevicesNapalmParams { + var () + return &DcimDevicesNapalmParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesNapalmParamsWithTimeout creates a new DcimDevicesNapalmParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesNapalmParamsWithTimeout(timeout time.Duration) *DcimDevicesNapalmParams { + var () + return &DcimDevicesNapalmParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesNapalmParamsWithContext creates a new DcimDevicesNapalmParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesNapalmParamsWithContext(ctx context.Context) *DcimDevicesNapalmParams { + var () + return &DcimDevicesNapalmParams{ + + Context: ctx, + } +} + +// NewDcimDevicesNapalmParamsWithHTTPClient creates a new DcimDevicesNapalmParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesNapalmParamsWithHTTPClient(client *http.Client) *DcimDevicesNapalmParams { + var () + return &DcimDevicesNapalmParams{ + HTTPClient: client, + } +} + +/*DcimDevicesNapalmParams contains all the parameters to send to the API endpoint +for the dcim devices napalm operation typically these are written to a http.Request +*/ +type DcimDevicesNapalmParams struct { + + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) WithTimeout(timeout time.Duration) *DcimDevicesNapalmParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) WithContext(ctx context.Context) *DcimDevicesNapalmParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) WithHTTPClient(client *http.Client) *DcimDevicesNapalmParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) WithID(id int64) *DcimDevicesNapalmParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices napalm params +func (o *DcimDevicesNapalmParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesNapalmParams) 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_devices_napalm_responses.go b/netbox/client/dcim/dcim_devices_napalm_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..89c96be49d4ed8694f46795abd54bed10b08776a --- /dev/null +++ b/netbox/client/dcim/dcim_devices_napalm_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" +) + +// DcimDevicesNapalmReader is a Reader for the DcimDevicesNapalm structure. +type DcimDevicesNapalmReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesNapalmReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesNapalmOK() + 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()) + } +} + +// NewDcimDevicesNapalmOK creates a DcimDevicesNapalmOK with default headers values +func NewDcimDevicesNapalmOK() *DcimDevicesNapalmOK { + return &DcimDevicesNapalmOK{} +} + +/*DcimDevicesNapalmOK handles this case with default header values. + +DcimDevicesNapalmOK dcim devices napalm o k +*/ +type DcimDevicesNapalmOK struct { + Payload *models.Device +} + +func (o *DcimDevicesNapalmOK) Error() string { + return fmt.Sprintf("[GET /dcim/devices/{id}/napalm/][%d] dcimDevicesNapalmOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesNapalmOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Device) + + // 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_devices_partial_update_parameters.go b/netbox/client/dcim/dcim_devices_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ef61e099cdc09c9533806c6db68c62c47207de47 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// NewDcimDevicesPartialUpdateParams creates a new DcimDevicesPartialUpdateParams object +// with the default values initialized. +func NewDcimDevicesPartialUpdateParams() *DcimDevicesPartialUpdateParams { + var () + return &DcimDevicesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesPartialUpdateParamsWithTimeout creates a new DcimDevicesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimDevicesPartialUpdateParams { + var () + return &DcimDevicesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesPartialUpdateParamsWithContext creates a new DcimDevicesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesPartialUpdateParamsWithContext(ctx context.Context) *DcimDevicesPartialUpdateParams { + var () + return &DcimDevicesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDevicesPartialUpdateParamsWithHTTPClient creates a new DcimDevicesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimDevicesPartialUpdateParams { + var () + return &DcimDevicesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDevicesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim devices partial update operation typically these are written to a http.Request +*/ +type DcimDevicesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableDevice + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimDevicesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithContext(ctx context.Context) *DcimDevicesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimDevicesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithData(data *models.WritableDevice) *DcimDevicesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetData(data *models.WritableDevice) { + o.Data = data +} + +// WithID adds the id to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) WithID(id int64) *DcimDevicesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices partial update params +func (o *DcimDevicesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesPartialUpdateParams) 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_devices_partial_update_responses.go b/netbox/client/dcim/dcim_devices_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6de509c82c80191eed89ceb0b78425433ea17b34 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// DcimDevicesPartialUpdateReader is a Reader for the DcimDevicesPartialUpdate structure. +type DcimDevicesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesPartialUpdateOK() + 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()) + } +} + +// NewDcimDevicesPartialUpdateOK creates a DcimDevicesPartialUpdateOK with default headers values +func NewDcimDevicesPartialUpdateOK() *DcimDevicesPartialUpdateOK { + return &DcimDevicesPartialUpdateOK{} +} + +/*DcimDevicesPartialUpdateOK handles this case with default header values. + +DcimDevicesPartialUpdateOK dcim devices partial update o k +*/ +type DcimDevicesPartialUpdateOK struct { + Payload *models.WritableDevice +} + +func (o *DcimDevicesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/devices/{id}/][%d] dcimDevicesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDevice) + + // 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_devices_read_parameters.go b/netbox/client/dcim/dcim_devices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..12079ed03050ca016b6e803af92c0a4d36924815 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// NewDcimDevicesReadParams creates a new DcimDevicesReadParams object +// with the default values initialized. +func NewDcimDevicesReadParams() *DcimDevicesReadParams { + var () + return &DcimDevicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesReadParamsWithTimeout creates a new DcimDevicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesReadParamsWithTimeout(timeout time.Duration) *DcimDevicesReadParams { + var () + return &DcimDevicesReadParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesReadParamsWithContext creates a new DcimDevicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesReadParamsWithContext(ctx context.Context) *DcimDevicesReadParams { + var () + return &DcimDevicesReadParams{ + + Context: ctx, + } +} + +// NewDcimDevicesReadParamsWithHTTPClient creates a new DcimDevicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesReadParamsWithHTTPClient(client *http.Client) *DcimDevicesReadParams { + var () + return &DcimDevicesReadParams{ + HTTPClient: client, + } +} + +/*DcimDevicesReadParams contains all the parameters to send to the API endpoint +for the dcim devices read operation typically these are written to a http.Request +*/ +type DcimDevicesReadParams struct { + + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices read params +func (o *DcimDevicesReadParams) WithTimeout(timeout time.Duration) *DcimDevicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices read params +func (o *DcimDevicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices read params +func (o *DcimDevicesReadParams) WithContext(ctx context.Context) *DcimDevicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices read params +func (o *DcimDevicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices read params +func (o *DcimDevicesReadParams) WithHTTPClient(client *http.Client) *DcimDevicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices read params +func (o *DcimDevicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim devices read params +func (o *DcimDevicesReadParams) WithID(id int64) *DcimDevicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices read params +func (o *DcimDevicesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesReadParams) 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_devices_read_responses.go b/netbox/client/dcim/dcim_devices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3434fd1f4a21f934ab77a4d792b719dd0c2a7198 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// DcimDevicesReadReader is a Reader for the DcimDevicesRead structure. +type DcimDevicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesReadOK() + 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()) + } +} + +// NewDcimDevicesReadOK creates a DcimDevicesReadOK with default headers values +func NewDcimDevicesReadOK() *DcimDevicesReadOK { + return &DcimDevicesReadOK{} +} + +/*DcimDevicesReadOK handles this case with default header values. + +DcimDevicesReadOK dcim devices read o k +*/ +type DcimDevicesReadOK struct { + Payload *models.Device +} + +func (o *DcimDevicesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/devices/{id}/][%d] dcimDevicesReadOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Device) + + // 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_devices_update_parameters.go b/netbox/client/dcim/dcim_devices_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d5cbf0b0e05bced0c2c3d0e234d242275509af55 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// NewDcimDevicesUpdateParams creates a new DcimDevicesUpdateParams object +// with the default values initialized. +func NewDcimDevicesUpdateParams() *DcimDevicesUpdateParams { + var () + return &DcimDevicesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimDevicesUpdateParamsWithTimeout creates a new DcimDevicesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimDevicesUpdateParamsWithTimeout(timeout time.Duration) *DcimDevicesUpdateParams { + var () + return &DcimDevicesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimDevicesUpdateParamsWithContext creates a new DcimDevicesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimDevicesUpdateParamsWithContext(ctx context.Context) *DcimDevicesUpdateParams { + var () + return &DcimDevicesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimDevicesUpdateParamsWithHTTPClient creates a new DcimDevicesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimDevicesUpdateParamsWithHTTPClient(client *http.Client) *DcimDevicesUpdateParams { + var () + return &DcimDevicesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimDevicesUpdateParams contains all the parameters to send to the API endpoint +for the dcim devices update operation typically these are written to a http.Request +*/ +type DcimDevicesUpdateParams struct { + + /*Data*/ + Data *models.WritableDevice + /*ID + A unique integer value identifying this device. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithTimeout(timeout time.Duration) *DcimDevicesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithContext(ctx context.Context) *DcimDevicesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithHTTPClient(client *http.Client) *DcimDevicesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithData(data *models.WritableDevice) *DcimDevicesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetData(data *models.WritableDevice) { + o.Data = data +} + +// WithID adds the id to the dcim devices update params +func (o *DcimDevicesUpdateParams) WithID(id int64) *DcimDevicesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim devices update params +func (o *DcimDevicesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimDevicesUpdateParams) 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_devices_update_responses.go b/netbox/client/dcim/dcim_devices_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ddda7fc2ef1e470a9c30ca963c436486871b3863 --- /dev/null +++ b/netbox/client/dcim/dcim_devices_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" +) + +// DcimDevicesUpdateReader is a Reader for the DcimDevicesUpdate structure. +type DcimDevicesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimDevicesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimDevicesUpdateOK() + 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()) + } +} + +// NewDcimDevicesUpdateOK creates a DcimDevicesUpdateOK with default headers values +func NewDcimDevicesUpdateOK() *DcimDevicesUpdateOK { + return &DcimDevicesUpdateOK{} +} + +/*DcimDevicesUpdateOK handles this case with default header values. + +DcimDevicesUpdateOK dcim devices update o k +*/ +type DcimDevicesUpdateOK struct { + Payload *models.WritableDevice +} + +func (o *DcimDevicesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/devices/{id}/][%d] dcimDevicesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimDevicesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableDevice) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_create_parameters.go b/netbox/client/dcim/dcim_interface_connections_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..de7a001dfe7dcec69fe3587d0a65807e58057d4a --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// NewDcimInterfaceConnectionsCreateParams creates a new DcimInterfaceConnectionsCreateParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsCreateParams() *DcimInterfaceConnectionsCreateParams { + var () + return &DcimInterfaceConnectionsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsCreateParamsWithTimeout creates a new DcimInterfaceConnectionsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsCreateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsCreateParams { + var () + return &DcimInterfaceConnectionsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsCreateParamsWithContext creates a new DcimInterfaceConnectionsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsCreateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsCreateParams { + var () + return &DcimInterfaceConnectionsCreateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsCreateParamsWithHTTPClient creates a new DcimInterfaceConnectionsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsCreateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsCreateParams { + var () + return &DcimInterfaceConnectionsCreateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsCreateParams contains all the parameters to send to the API endpoint +for the dcim interface connections create operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsCreateParams struct { + + /*Data*/ + Data *models.WritableInterfaceConnection + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface connections create params +func (o *DcimInterfaceConnectionsCreateParams) SetData(data *models.WritableInterfaceConnection) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_create_responses.go b/netbox/client/dcim/dcim_interface_connections_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0ec768a3c4a2260e233cd38cf5e609b2b7f5bb83 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// DcimInterfaceConnectionsCreateReader is a Reader for the DcimInterfaceConnectionsCreate structure. +type DcimInterfaceConnectionsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimInterfaceConnectionsCreateCreated() + 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()) + } +} + +// NewDcimInterfaceConnectionsCreateCreated creates a DcimInterfaceConnectionsCreateCreated with default headers values +func NewDcimInterfaceConnectionsCreateCreated() *DcimInterfaceConnectionsCreateCreated { + return &DcimInterfaceConnectionsCreateCreated{} +} + +/*DcimInterfaceConnectionsCreateCreated handles this case with default header values. + +DcimInterfaceConnectionsCreateCreated dcim interface connections create created +*/ +type DcimInterfaceConnectionsCreateCreated struct { + Payload *models.WritableInterfaceConnection +} + +func (o *DcimInterfaceConnectionsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/interface-connections/][%d] dcimInterfaceConnectionsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimInterfaceConnectionsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceConnection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_delete_parameters.go b/netbox/client/dcim/dcim_interface_connections_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..74cbd5feb1879cab4d37a341071dac23c8a88679 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// NewDcimInterfaceConnectionsDeleteParams creates a new DcimInterfaceConnectionsDeleteParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsDeleteParams() *DcimInterfaceConnectionsDeleteParams { + var () + return &DcimInterfaceConnectionsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsDeleteParamsWithTimeout creates a new DcimInterfaceConnectionsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsDeleteParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsDeleteParams { + var () + return &DcimInterfaceConnectionsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsDeleteParamsWithContext creates a new DcimInterfaceConnectionsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsDeleteParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsDeleteParams { + var () + return &DcimInterfaceConnectionsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsDeleteParamsWithHTTPClient creates a new DcimInterfaceConnectionsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsDeleteParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsDeleteParams { + var () + return &DcimInterfaceConnectionsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsDeleteParams contains all the parameters to send to the API endpoint +for the dcim interface connections delete operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsDeleteParams struct { + + /*ID + A unique integer value identifying this interface connection. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) WithID(id int64) *DcimInterfaceConnectionsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface connections delete params +func (o *DcimInterfaceConnectionsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_delete_responses.go b/netbox/client/dcim/dcim_interface_connections_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7b73fad19daf83176c5b432fbb1b566459dcf70e --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// DcimInterfaceConnectionsDeleteReader is a Reader for the DcimInterfaceConnectionsDelete structure. +type DcimInterfaceConnectionsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimInterfaceConnectionsDeleteNoContent() + 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()) + } +} + +// NewDcimInterfaceConnectionsDeleteNoContent creates a DcimInterfaceConnectionsDeleteNoContent with default headers values +func NewDcimInterfaceConnectionsDeleteNoContent() *DcimInterfaceConnectionsDeleteNoContent { + return &DcimInterfaceConnectionsDeleteNoContent{} +} + +/*DcimInterfaceConnectionsDeleteNoContent handles this case with default header values. + +DcimInterfaceConnectionsDeleteNoContent dcim interface connections delete no content +*/ +type DcimInterfaceConnectionsDeleteNoContent struct { +} + +func (o *DcimInterfaceConnectionsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsDeleteNoContent ", 204) +} + +func (o *DcimInterfaceConnectionsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_list_parameters.go b/netbox/client/dcim/dcim_interface_connections_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8668131d549a61ec38cf5263dc8b033d50d11c95 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_list_parameters.go @@ -0,0 +1,268 @@ +// 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" +) + +// NewDcimInterfaceConnectionsListParams creates a new DcimInterfaceConnectionsListParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsListParams() *DcimInterfaceConnectionsListParams { + var () + return &DcimInterfaceConnectionsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsListParamsWithTimeout creates a new DcimInterfaceConnectionsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsListParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsListParams { + var () + return &DcimInterfaceConnectionsListParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsListParamsWithContext creates a new DcimInterfaceConnectionsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsListParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsListParams { + var () + return &DcimInterfaceConnectionsListParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsListParamsWithHTTPClient creates a new DcimInterfaceConnectionsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsListParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsListParams { + var () + return &DcimInterfaceConnectionsListParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsListParams contains all the parameters to send to the API endpoint +for the dcim interface connections list operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsListParams struct { + + /*ConnectionStatus*/ + ConnectionStatus *string + /*Device*/ + Device *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionStatus adds the connectionStatus to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithConnectionStatus(connectionStatus *string) *DcimInterfaceConnectionsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDevice adds the device to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithDevice(device *string) *DcimInterfaceConnectionsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithLimit adds the limit to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithLimit(limit *int64) *DcimInterfaceConnectionsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithOffset(offset *int64) *DcimInterfaceConnectionsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) WithSite(site *string) *DcimInterfaceConnectionsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim interface connections list params +func (o *DcimInterfaceConnectionsListParams) SetSite(site *string) { + o.Site = site +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_list_responses.go b/netbox/client/dcim/dcim_interface_connections_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..21511f0a5f67e93ecc6af1ea9507d9c1e612c13a --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// DcimInterfaceConnectionsListReader is a Reader for the DcimInterfaceConnectionsList structure. +type DcimInterfaceConnectionsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceConnectionsListOK() + 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()) + } +} + +// NewDcimInterfaceConnectionsListOK creates a DcimInterfaceConnectionsListOK with default headers values +func NewDcimInterfaceConnectionsListOK() *DcimInterfaceConnectionsListOK { + return &DcimInterfaceConnectionsListOK{} +} + +/*DcimInterfaceConnectionsListOK handles this case with default header values. + +DcimInterfaceConnectionsListOK dcim interface connections list o k +*/ +type DcimInterfaceConnectionsListOK struct { + Payload *models.DcimInterfaceConnectionsListOKBody +} + +func (o *DcimInterfaceConnectionsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/interface-connections/][%d] dcimInterfaceConnectionsListOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimInterfaceConnectionsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go b/netbox/client/dcim/dcim_interface_connections_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..588daa245cf1d6030637ffa06915b2c26f3be73b --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// NewDcimInterfaceConnectionsPartialUpdateParams creates a new DcimInterfaceConnectionsPartialUpdateParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsPartialUpdateParams() *DcimInterfaceConnectionsPartialUpdateParams { + var () + return &DcimInterfaceConnectionsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsPartialUpdateParamsWithTimeout creates a new DcimInterfaceConnectionsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsPartialUpdateParams { + var () + return &DcimInterfaceConnectionsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsPartialUpdateParamsWithContext creates a new DcimInterfaceConnectionsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsPartialUpdateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsPartialUpdateParams { + var () + return &DcimInterfaceConnectionsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsPartialUpdateParamsWithHTTPClient creates a new DcimInterfaceConnectionsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsPartialUpdateParams { + var () + return &DcimInterfaceConnectionsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim interface connections partial update operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInterfaceConnection + /*ID + A unique integer value identifying this interface connection. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetData(data *models.WritableInterfaceConnection) { + o.Data = data +} + +// WithID adds the id to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) WithID(id int64) *DcimInterfaceConnectionsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface connections partial update params +func (o *DcimInterfaceConnectionsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go b/netbox/client/dcim/dcim_interface_connections_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1845a17fba86faff11c0c7fbcbbc5cc1c7b3e9e6 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// DcimInterfaceConnectionsPartialUpdateReader is a Reader for the DcimInterfaceConnectionsPartialUpdate structure. +type DcimInterfaceConnectionsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceConnectionsPartialUpdateOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewDcimInterfaceConnectionsPartialUpdateOK creates a DcimInterfaceConnectionsPartialUpdateOK with default headers values +func NewDcimInterfaceConnectionsPartialUpdateOK() *DcimInterfaceConnectionsPartialUpdateOK { + return &DcimInterfaceConnectionsPartialUpdateOK{} +} + +/*DcimInterfaceConnectionsPartialUpdateOK handles this case with default header values. + +DcimInterfaceConnectionsPartialUpdateOK dcim interface connections partial update o k +*/ +type DcimInterfaceConnectionsPartialUpdateOK struct { + Payload *models.WritableInterfaceConnection +} + +func (o *DcimInterfaceConnectionsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceConnectionsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceConnection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_read_parameters.go b/netbox/client/dcim/dcim_interface_connections_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9f594d69f6d0358cc127dd8c3e1dcf7e4d37bddb --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// NewDcimInterfaceConnectionsReadParams creates a new DcimInterfaceConnectionsReadParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsReadParams() *DcimInterfaceConnectionsReadParams { + var () + return &DcimInterfaceConnectionsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsReadParamsWithTimeout creates a new DcimInterfaceConnectionsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsReadParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsReadParams { + var () + return &DcimInterfaceConnectionsReadParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsReadParamsWithContext creates a new DcimInterfaceConnectionsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsReadParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsReadParams { + var () + return &DcimInterfaceConnectionsReadParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsReadParamsWithHTTPClient creates a new DcimInterfaceConnectionsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsReadParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsReadParams { + var () + return &DcimInterfaceConnectionsReadParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsReadParams contains all the parameters to send to the API endpoint +for the dcim interface connections read operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsReadParams struct { + + /*ID + A unique integer value identifying this interface connection. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) WithID(id int64) *DcimInterfaceConnectionsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface connections read params +func (o *DcimInterfaceConnectionsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_read_responses.go b/netbox/client/dcim/dcim_interface_connections_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c89f559eadbd960b84057c400e2cf5b899697df4 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// DcimInterfaceConnectionsReadReader is a Reader for the DcimInterfaceConnectionsRead structure. +type DcimInterfaceConnectionsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceConnectionsReadOK() + 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()) + } +} + +// NewDcimInterfaceConnectionsReadOK creates a DcimInterfaceConnectionsReadOK with default headers values +func NewDcimInterfaceConnectionsReadOK() *DcimInterfaceConnectionsReadOK { + return &DcimInterfaceConnectionsReadOK{} +} + +/*DcimInterfaceConnectionsReadOK handles this case with default header values. + +DcimInterfaceConnectionsReadOK dcim interface connections read o k +*/ +type DcimInterfaceConnectionsReadOK struct { + Payload *models.InterfaceConnection +} + +func (o *DcimInterfaceConnectionsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsReadOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceConnectionsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InterfaceConnection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_update_parameters.go b/netbox/client/dcim/dcim_interface_connections_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a72334b53e55350456f80e795222c51db32316c6 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// NewDcimInterfaceConnectionsUpdateParams creates a new DcimInterfaceConnectionsUpdateParams object +// with the default values initialized. +func NewDcimInterfaceConnectionsUpdateParams() *DcimInterfaceConnectionsUpdateParams { + var () + return &DcimInterfaceConnectionsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceConnectionsUpdateParamsWithTimeout creates a new DcimInterfaceConnectionsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceConnectionsUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceConnectionsUpdateParams { + var () + return &DcimInterfaceConnectionsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceConnectionsUpdateParamsWithContext creates a new DcimInterfaceConnectionsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceConnectionsUpdateParamsWithContext(ctx context.Context) *DcimInterfaceConnectionsUpdateParams { + var () + return &DcimInterfaceConnectionsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceConnectionsUpdateParamsWithHTTPClient creates a new DcimInterfaceConnectionsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceConnectionsUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceConnectionsUpdateParams { + var () + return &DcimInterfaceConnectionsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceConnectionsUpdateParams contains all the parameters to send to the API endpoint +for the dcim interface connections update operation typically these are written to a http.Request +*/ +type DcimInterfaceConnectionsUpdateParams struct { + + /*Data*/ + Data *models.WritableInterfaceConnection + /*ID + A unique integer value identifying this interface connection. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceConnectionsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithContext(ctx context.Context) *DcimInterfaceConnectionsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceConnectionsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithData(data *models.WritableInterfaceConnection) *DcimInterfaceConnectionsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetData(data *models.WritableInterfaceConnection) { + o.Data = data +} + +// WithID adds the id to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) WithID(id int64) *DcimInterfaceConnectionsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface connections update params +func (o *DcimInterfaceConnectionsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceConnectionsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_connections_update_responses.go b/netbox/client/dcim/dcim_interface_connections_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f48025cba47e33ffe6fcb0ac995b1c03f80b4e05 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_connections_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" +) + +// DcimInterfaceConnectionsUpdateReader is a Reader for the DcimInterfaceConnectionsUpdate structure. +type DcimInterfaceConnectionsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceConnectionsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceConnectionsUpdateOK() + 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()) + } +} + +// NewDcimInterfaceConnectionsUpdateOK creates a DcimInterfaceConnectionsUpdateOK with default headers values +func NewDcimInterfaceConnectionsUpdateOK() *DcimInterfaceConnectionsUpdateOK { + return &DcimInterfaceConnectionsUpdateOK{} +} + +/*DcimInterfaceConnectionsUpdateOK handles this case with default header values. + +DcimInterfaceConnectionsUpdateOK dcim interface connections update o k +*/ +type DcimInterfaceConnectionsUpdateOK struct { + Payload *models.WritableInterfaceConnection +} + +func (o *DcimInterfaceConnectionsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/interface-connections/{id}/][%d] dcimInterfaceConnectionsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceConnectionsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceConnection) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_create_parameters.go b/netbox/client/dcim/dcim_interface_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..826cf986f298379a1aeb2b9201b89a977360e45d --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// NewDcimInterfaceTemplatesCreateParams creates a new DcimInterfaceTemplatesCreateParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesCreateParams() *DcimInterfaceTemplatesCreateParams { + var () + return &DcimInterfaceTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesCreateParamsWithTimeout creates a new DcimInterfaceTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesCreateParams { + var () + return &DcimInterfaceTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesCreateParamsWithContext creates a new DcimInterfaceTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesCreateParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesCreateParams { + var () + return &DcimInterfaceTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesCreateParamsWithHTTPClient creates a new DcimInterfaceTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesCreateParams { + var () + return &DcimInterfaceTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim interface templates create operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritableInterfaceTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) WithData(data *models.WritableInterfaceTemplate) *DcimInterfaceTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface templates create params +func (o *DcimInterfaceTemplatesCreateParams) SetData(data *models.WritableInterfaceTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_create_responses.go b/netbox/client/dcim/dcim_interface_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..63690ddaec0b6d0fe1e95bb2bc991c6fb4d15998 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// DcimInterfaceTemplatesCreateReader is a Reader for the DcimInterfaceTemplatesCreate structure. +type DcimInterfaceTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimInterfaceTemplatesCreateCreated() + 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()) + } +} + +// NewDcimInterfaceTemplatesCreateCreated creates a DcimInterfaceTemplatesCreateCreated with default headers values +func NewDcimInterfaceTemplatesCreateCreated() *DcimInterfaceTemplatesCreateCreated { + return &DcimInterfaceTemplatesCreateCreated{} +} + +/*DcimInterfaceTemplatesCreateCreated handles this case with default header values. + +DcimInterfaceTemplatesCreateCreated dcim interface templates create created +*/ +type DcimInterfaceTemplatesCreateCreated struct { + Payload *models.WritableInterfaceTemplate +} + +func (o *DcimInterfaceTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/interface-templates/][%d] dcimInterfaceTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimInterfaceTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_delete_parameters.go b/netbox/client/dcim/dcim_interface_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e039118b1d7f28a53a2d7faa31a7411e531052bf --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// NewDcimInterfaceTemplatesDeleteParams creates a new DcimInterfaceTemplatesDeleteParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesDeleteParams() *DcimInterfaceTemplatesDeleteParams { + var () + return &DcimInterfaceTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesDeleteParamsWithTimeout creates a new DcimInterfaceTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesDeleteParams { + var () + return &DcimInterfaceTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesDeleteParamsWithContext creates a new DcimInterfaceTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesDeleteParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesDeleteParams { + var () + return &DcimInterfaceTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesDeleteParamsWithHTTPClient creates a new DcimInterfaceTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesDeleteParams { + var () + return &DcimInterfaceTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim interface templates delete operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this interface template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) WithID(id int64) *DcimInterfaceTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface templates delete params +func (o *DcimInterfaceTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_delete_responses.go b/netbox/client/dcim/dcim_interface_templates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2c5fe331aec24a6dec4a77d40f53415292e3152c --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// DcimInterfaceTemplatesDeleteReader is a Reader for the DcimInterfaceTemplatesDelete structure. +type DcimInterfaceTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimInterfaceTemplatesDeleteNoContent() + 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()) + } +} + +// NewDcimInterfaceTemplatesDeleteNoContent creates a DcimInterfaceTemplatesDeleteNoContent with default headers values +func NewDcimInterfaceTemplatesDeleteNoContent() *DcimInterfaceTemplatesDeleteNoContent { + return &DcimInterfaceTemplatesDeleteNoContent{} +} + +/*DcimInterfaceTemplatesDeleteNoContent handles this case with default header values. + +DcimInterfaceTemplatesDeleteNoContent dcim interface templates delete no content +*/ +type DcimInterfaceTemplatesDeleteNoContent struct { +} + +func (o *DcimInterfaceTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/interface-templates/{id}/][%d] dcimInterfaceTemplatesDeleteNoContent ", 204) +} + +func (o *DcimInterfaceTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_list_parameters.go b/netbox/client/dcim/dcim_interface_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dda290141252085e0292f3f6c9e187e9af7a554d --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_list_parameters.go @@ -0,0 +1,297 @@ +// 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" +) + +// NewDcimInterfaceTemplatesListParams creates a new DcimInterfaceTemplatesListParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesListParams() *DcimInterfaceTemplatesListParams { + var () + return &DcimInterfaceTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesListParamsWithTimeout creates a new DcimInterfaceTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesListParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesListParams { + var () + return &DcimInterfaceTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesListParamsWithContext creates a new DcimInterfaceTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesListParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesListParams { + var () + return &DcimInterfaceTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesListParamsWithHTTPClient creates a new DcimInterfaceTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesListParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesListParams { + var () + return &DcimInterfaceTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim interface templates list operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*FormFactor*/ + FormFactor *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MgmtOnly*/ + MgmtOnly *string + /*Name*/ + Name *string + /*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 interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimInterfaceTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithFormFactor adds the formFactor to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithFormFactor(formFactor *string) *DcimInterfaceTemplatesListParams { + o.SetFormFactor(formFactor) + return o +} + +// SetFormFactor adds the formFactor to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetFormFactor(formFactor *string) { + o.FormFactor = formFactor +} + +// WithLimit adds the limit to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithLimit(limit *int64) *DcimInterfaceTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMgmtOnly adds the mgmtOnly to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithMgmtOnly(mgmtOnly *string) *DcimInterfaceTemplatesListParams { + o.SetMgmtOnly(mgmtOnly) + return o +} + +// SetMgmtOnly adds the mgmtOnly to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetMgmtOnly(mgmtOnly *string) { + o.MgmtOnly = mgmtOnly +} + +// WithName adds the name to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithName(name *string) *DcimInterfaceTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) WithOffset(offset *int64) *DcimInterfaceTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim interface templates list params +func (o *DcimInterfaceTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.FormFactor != nil { + + // query param form_factor + var qrFormFactor string + if o.FormFactor != nil { + qrFormFactor = *o.FormFactor + } + qFormFactor := qrFormFactor + if qFormFactor != "" { + if err := r.SetQueryParam("form_factor", qFormFactor); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.MgmtOnly != nil { + + // query param mgmt_only + var qrMgmtOnly string + if o.MgmtOnly != nil { + qrMgmtOnly = *o.MgmtOnly + } + qMgmtOnly := qrMgmtOnly + if qMgmtOnly != "" { + if err := r.SetQueryParam("mgmt_only", qMgmtOnly); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_list_responses.go b/netbox/client/dcim/dcim_interface_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1b01eab43f443e0dfdf838c1dcbaf903aa02315f --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// DcimInterfaceTemplatesListReader is a Reader for the DcimInterfaceTemplatesList structure. +type DcimInterfaceTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceTemplatesListOK() + 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()) + } +} + +// NewDcimInterfaceTemplatesListOK creates a DcimInterfaceTemplatesListOK with default headers values +func NewDcimInterfaceTemplatesListOK() *DcimInterfaceTemplatesListOK { + return &DcimInterfaceTemplatesListOK{} +} + +/*DcimInterfaceTemplatesListOK handles this case with default header values. + +DcimInterfaceTemplatesListOK dcim interface templates list o k +*/ +type DcimInterfaceTemplatesListOK struct { + Payload *models.DcimInterfaceTemplatesListOKBody +} + +func (o *DcimInterfaceTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/interface-templates/][%d] dcimInterfaceTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimInterfaceTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_interface_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b523fe0208bd3a2ef940d9f2f7ba0527ef0512a6 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// NewDcimInterfaceTemplatesPartialUpdateParams creates a new DcimInterfaceTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesPartialUpdateParams() *DcimInterfaceTemplatesPartialUpdateParams { + var () + return &DcimInterfaceTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesPartialUpdateParamsWithTimeout creates a new DcimInterfaceTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesPartialUpdateParams { + var () + return &DcimInterfaceTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesPartialUpdateParamsWithContext creates a new DcimInterfaceTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesPartialUpdateParams { + var () + return &DcimInterfaceTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimInterfaceTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesPartialUpdateParams { + var () + return &DcimInterfaceTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim interface templates partial update operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInterfaceTemplate + /*ID + A unique integer value identifying this interface template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithData(data *models.WritableInterfaceTemplate) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetData(data *models.WritableInterfaceTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) WithID(id int64) *DcimInterfaceTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface templates partial update params +func (o *DcimInterfaceTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go b/netbox/client/dcim/dcim_interface_templates_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c143fb19ad0b434dff4d299c65b236c249814b73 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// DcimInterfaceTemplatesPartialUpdateReader is a Reader for the DcimInterfaceTemplatesPartialUpdate structure. +type DcimInterfaceTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceTemplatesPartialUpdateOK() + 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()) + } +} + +// NewDcimInterfaceTemplatesPartialUpdateOK creates a DcimInterfaceTemplatesPartialUpdateOK with default headers values +func NewDcimInterfaceTemplatesPartialUpdateOK() *DcimInterfaceTemplatesPartialUpdateOK { + return &DcimInterfaceTemplatesPartialUpdateOK{} +} + +/*DcimInterfaceTemplatesPartialUpdateOK handles this case with default header values. + +DcimInterfaceTemplatesPartialUpdateOK dcim interface templates partial update o k +*/ +type DcimInterfaceTemplatesPartialUpdateOK struct { + Payload *models.WritableInterfaceTemplate +} + +func (o *DcimInterfaceTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/interface-templates/{id}/][%d] dcimInterfaceTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_read_parameters.go b/netbox/client/dcim/dcim_interface_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7b717d21af04e36bf3c8ce499a54c35fa9d8c78e --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// NewDcimInterfaceTemplatesReadParams creates a new DcimInterfaceTemplatesReadParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesReadParams() *DcimInterfaceTemplatesReadParams { + var () + return &DcimInterfaceTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesReadParamsWithTimeout creates a new DcimInterfaceTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesReadParams { + var () + return &DcimInterfaceTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesReadParamsWithContext creates a new DcimInterfaceTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesReadParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesReadParams { + var () + return &DcimInterfaceTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesReadParamsWithHTTPClient creates a new DcimInterfaceTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesReadParams { + var () + return &DcimInterfaceTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim interface templates read operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesReadParams struct { + + /*ID + A unique integer value identifying this interface template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) WithID(id int64) *DcimInterfaceTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface templates read params +func (o *DcimInterfaceTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_read_responses.go b/netbox/client/dcim/dcim_interface_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a83825e069138dad713877100033cdc7da1a48a9 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// DcimInterfaceTemplatesReadReader is a Reader for the DcimInterfaceTemplatesRead structure. +type DcimInterfaceTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceTemplatesReadOK() + 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()) + } +} + +// NewDcimInterfaceTemplatesReadOK creates a DcimInterfaceTemplatesReadOK with default headers values +func NewDcimInterfaceTemplatesReadOK() *DcimInterfaceTemplatesReadOK { + return &DcimInterfaceTemplatesReadOK{} +} + +/*DcimInterfaceTemplatesReadOK handles this case with default header values. + +DcimInterfaceTemplatesReadOK dcim interface templates read o k +*/ +type DcimInterfaceTemplatesReadOK struct { + Payload *models.InterfaceTemplate +} + +func (o *DcimInterfaceTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/interface-templates/{id}/][%d] dcimInterfaceTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InterfaceTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_update_parameters.go b/netbox/client/dcim/dcim_interface_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ff256388959369ce04b23fe8ecf45717fef98330 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// NewDcimInterfaceTemplatesUpdateParams creates a new DcimInterfaceTemplatesUpdateParams object +// with the default values initialized. +func NewDcimInterfaceTemplatesUpdateParams() *DcimInterfaceTemplatesUpdateParams { + var () + return &DcimInterfaceTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfaceTemplatesUpdateParamsWithTimeout creates a new DcimInterfaceTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfaceTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfaceTemplatesUpdateParams { + var () + return &DcimInterfaceTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfaceTemplatesUpdateParamsWithContext creates a new DcimInterfaceTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfaceTemplatesUpdateParamsWithContext(ctx context.Context) *DcimInterfaceTemplatesUpdateParams { + var () + return &DcimInterfaceTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfaceTemplatesUpdateParamsWithHTTPClient creates a new DcimInterfaceTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfaceTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfaceTemplatesUpdateParams { + var () + return &DcimInterfaceTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfaceTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim interface templates update operation typically these are written to a http.Request +*/ +type DcimInterfaceTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritableInterfaceTemplate + /*ID + A unique integer value identifying this interface template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfaceTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithContext(ctx context.Context) *DcimInterfaceTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfaceTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithData(data *models.WritableInterfaceTemplate) *DcimInterfaceTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetData(data *models.WritableInterfaceTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) WithID(id int64) *DcimInterfaceTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interface templates update params +func (o *DcimInterfaceTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfaceTemplatesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interface_templates_update_responses.go b/netbox/client/dcim/dcim_interface_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f4f90ee01761d04ecb49c2107a60716b641d22c9 --- /dev/null +++ b/netbox/client/dcim/dcim_interface_templates_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" +) + +// DcimInterfaceTemplatesUpdateReader is a Reader for the DcimInterfaceTemplatesUpdate structure. +type DcimInterfaceTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfaceTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfaceTemplatesUpdateOK() + 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()) + } +} + +// NewDcimInterfaceTemplatesUpdateOK creates a DcimInterfaceTemplatesUpdateOK with default headers values +func NewDcimInterfaceTemplatesUpdateOK() *DcimInterfaceTemplatesUpdateOK { + return &DcimInterfaceTemplatesUpdateOK{} +} + +/*DcimInterfaceTemplatesUpdateOK handles this case with default header values. + +DcimInterfaceTemplatesUpdateOK dcim interface templates update o k +*/ +type DcimInterfaceTemplatesUpdateOK struct { + Payload *models.WritableInterfaceTemplate +} + +func (o *DcimInterfaceTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/interface-templates/{id}/][%d] dcimInterfaceTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfaceTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterfaceTemplate) + + // 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_interfaces_create_parameters.go b/netbox/client/dcim/dcim_interfaces_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..fe0e83cf71ff1ae73ef39e8e93390527a7cd296c --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// NewDcimInterfacesCreateParams creates a new DcimInterfacesCreateParams object +// with the default values initialized. +func NewDcimInterfacesCreateParams() *DcimInterfacesCreateParams { + var () + return &DcimInterfacesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesCreateParamsWithTimeout creates a new DcimInterfacesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesCreateParamsWithTimeout(timeout time.Duration) *DcimInterfacesCreateParams { + var () + return &DcimInterfacesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesCreateParamsWithContext creates a new DcimInterfacesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesCreateParamsWithContext(ctx context.Context) *DcimInterfacesCreateParams { + var () + return &DcimInterfacesCreateParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesCreateParamsWithHTTPClient creates a new DcimInterfacesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesCreateParamsWithHTTPClient(client *http.Client) *DcimInterfacesCreateParams { + var () + return &DcimInterfacesCreateParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesCreateParams contains all the parameters to send to the API endpoint +for the dcim interfaces create operation typically these are written to a http.Request +*/ +type DcimInterfacesCreateParams struct { + + /*Data*/ + Data *models.WritableInterface + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) WithTimeout(timeout time.Duration) *DcimInterfacesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) WithContext(ctx context.Context) *DcimInterfacesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) WithHTTPClient(client *http.Client) *DcimInterfacesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) WithData(data *models.WritableInterface) *DcimInterfacesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interfaces create params +func (o *DcimInterfacesCreateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesCreateParams) 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_interfaces_create_responses.go b/netbox/client/dcim/dcim_interfaces_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..87c7ad459eccdbdb47eabad3783f2498c05fca31 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// DcimInterfacesCreateReader is a Reader for the DcimInterfacesCreate structure. +type DcimInterfacesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimInterfacesCreateCreated() + 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()) + } +} + +// NewDcimInterfacesCreateCreated creates a DcimInterfacesCreateCreated with default headers values +func NewDcimInterfacesCreateCreated() *DcimInterfacesCreateCreated { + return &DcimInterfacesCreateCreated{} +} + +/*DcimInterfacesCreateCreated handles this case with default header values. + +DcimInterfacesCreateCreated dcim interfaces create created +*/ +type DcimInterfacesCreateCreated struct { + Payload *models.WritableInterface +} + +func (o *DcimInterfacesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/interfaces/][%d] dcimInterfacesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimInterfacesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // 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_interfaces_delete_parameters.go b/netbox/client/dcim/dcim_interfaces_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..870b9308ef9ab19528850ec0fdbfef0f8ee400b6 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// NewDcimInterfacesDeleteParams creates a new DcimInterfacesDeleteParams object +// with the default values initialized. +func NewDcimInterfacesDeleteParams() *DcimInterfacesDeleteParams { + var () + return &DcimInterfacesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesDeleteParamsWithTimeout creates a new DcimInterfacesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesDeleteParamsWithTimeout(timeout time.Duration) *DcimInterfacesDeleteParams { + var () + return &DcimInterfacesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesDeleteParamsWithContext creates a new DcimInterfacesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesDeleteParamsWithContext(ctx context.Context) *DcimInterfacesDeleteParams { + var () + return &DcimInterfacesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesDeleteParamsWithHTTPClient creates a new DcimInterfacesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesDeleteParamsWithHTTPClient(client *http.Client) *DcimInterfacesDeleteParams { + var () + return &DcimInterfacesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesDeleteParams contains all the parameters to send to the API endpoint +for the dcim interfaces delete operation typically these are written to a http.Request +*/ +type DcimInterfacesDeleteParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) WithTimeout(timeout time.Duration) *DcimInterfacesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) WithContext(ctx context.Context) *DcimInterfacesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) WithHTTPClient(client *http.Client) *DcimInterfacesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) WithID(id int64) *DcimInterfacesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces delete params +func (o *DcimInterfacesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesDeleteParams) 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_interfaces_delete_responses.go b/netbox/client/dcim/dcim_interfaces_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..241e1c76a9df50cf4faea2a96b5dc57d71f6be22 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// DcimInterfacesDeleteReader is a Reader for the DcimInterfacesDelete structure. +type DcimInterfacesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimInterfacesDeleteNoContent() + 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()) + } +} + +// NewDcimInterfacesDeleteNoContent creates a DcimInterfacesDeleteNoContent with default headers values +func NewDcimInterfacesDeleteNoContent() *DcimInterfacesDeleteNoContent { + return &DcimInterfacesDeleteNoContent{} +} + +/*DcimInterfacesDeleteNoContent handles this case with default header values. + +DcimInterfacesDeleteNoContent dcim interfaces delete no content +*/ +type DcimInterfacesDeleteNoContent struct { +} + +func (o *DcimInterfacesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/interfaces/{id}/][%d] dcimInterfacesDeleteNoContent ", 204) +} + +func (o *DcimInterfacesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_interfaces_graphs_parameters.go b/netbox/client/dcim/dcim_interfaces_graphs_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..fe12f3bbdb4163769512dc3d1be141e7bd6edd29 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_graphs_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" +) + +// NewDcimInterfacesGraphsParams creates a new DcimInterfacesGraphsParams object +// with the default values initialized. +func NewDcimInterfacesGraphsParams() *DcimInterfacesGraphsParams { + var () + return &DcimInterfacesGraphsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesGraphsParamsWithTimeout creates a new DcimInterfacesGraphsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesGraphsParamsWithTimeout(timeout time.Duration) *DcimInterfacesGraphsParams { + var () + return &DcimInterfacesGraphsParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesGraphsParamsWithContext creates a new DcimInterfacesGraphsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesGraphsParamsWithContext(ctx context.Context) *DcimInterfacesGraphsParams { + var () + return &DcimInterfacesGraphsParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesGraphsParamsWithHTTPClient creates a new DcimInterfacesGraphsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesGraphsParamsWithHTTPClient(client *http.Client) *DcimInterfacesGraphsParams { + var () + return &DcimInterfacesGraphsParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesGraphsParams contains all the parameters to send to the API endpoint +for the dcim interfaces graphs operation typically these are written to a http.Request +*/ +type DcimInterfacesGraphsParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) WithTimeout(timeout time.Duration) *DcimInterfacesGraphsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) WithContext(ctx context.Context) *DcimInterfacesGraphsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) WithHTTPClient(client *http.Client) *DcimInterfacesGraphsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) WithID(id int64) *DcimInterfacesGraphsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces graphs params +func (o *DcimInterfacesGraphsParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesGraphsParams) 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_interfaces_graphs_responses.go b/netbox/client/dcim/dcim_interfaces_graphs_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d9b0befab24c0ab1cfe6b5de5c1b7035123bed98 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_graphs_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" +) + +// DcimInterfacesGraphsReader is a Reader for the DcimInterfacesGraphs structure. +type DcimInterfacesGraphsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesGraphsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesGraphsOK() + 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()) + } +} + +// NewDcimInterfacesGraphsOK creates a DcimInterfacesGraphsOK with default headers values +func NewDcimInterfacesGraphsOK() *DcimInterfacesGraphsOK { + return &DcimInterfacesGraphsOK{} +} + +/*DcimInterfacesGraphsOK handles this case with default header values. + +DcimInterfacesGraphsOK dcim interfaces graphs o k +*/ +type DcimInterfacesGraphsOK struct { + Payload *models.Interface +} + +func (o *DcimInterfacesGraphsOK) Error() string { + return fmt.Sprintf("[GET /dcim/interfaces/{id}/graphs/][%d] dcimInterfacesGraphsOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesGraphsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Interface) + + // 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_interfaces_list_parameters.go b/netbox/client/dcim/dcim_interfaces_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..fdbc0f413632cfda750e5c47dc38c6086d000d4c --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_list_parameters.go @@ -0,0 +1,471 @@ +// 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" +) + +// NewDcimInterfacesListParams creates a new DcimInterfacesListParams object +// with the default values initialized. +func NewDcimInterfacesListParams() *DcimInterfacesListParams { + var () + return &DcimInterfacesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesListParamsWithTimeout creates a new DcimInterfacesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesListParamsWithTimeout(timeout time.Duration) *DcimInterfacesListParams { + var () + return &DcimInterfacesListParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesListParamsWithContext creates a new DcimInterfacesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesListParamsWithContext(ctx context.Context) *DcimInterfacesListParams { + var () + return &DcimInterfacesListParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesListParamsWithHTTPClient creates a new DcimInterfacesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesListParamsWithHTTPClient(client *http.Client) *DcimInterfacesListParams { + var () + return &DcimInterfacesListParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesListParams contains all the parameters to send to the API endpoint +for the dcim interfaces list operation typically these are written to a http.Request +*/ +type DcimInterfacesListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *float64 + /*Enabled*/ + Enabled *string + /*FormFactor*/ + FormFactor *string + /*LagID*/ + LagID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MacAddress*/ + MacAddress *string + /*MgmtOnly*/ + MgmtOnly *string + /*Mtu*/ + Mtu *float64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithTimeout(timeout time.Duration) *DcimInterfacesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithContext(ctx context.Context) *DcimInterfacesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithHTTPClient(client *http.Client) *DcimInterfacesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithDevice(device *string) *DcimInterfacesListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithDeviceID(deviceID *float64) *DcimInterfacesListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetDeviceID(deviceID *float64) { + o.DeviceID = deviceID +} + +// WithEnabled adds the enabled to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithEnabled(enabled *string) *DcimInterfacesListParams { + o.SetEnabled(enabled) + return o +} + +// SetEnabled adds the enabled to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetEnabled(enabled *string) { + o.Enabled = enabled +} + +// WithFormFactor adds the formFactor to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithFormFactor(formFactor *string) *DcimInterfacesListParams { + o.SetFormFactor(formFactor) + return o +} + +// SetFormFactor adds the formFactor to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetFormFactor(formFactor *string) { + o.FormFactor = formFactor +} + +// WithLagID adds the lagID to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithLagID(lagID *string) *DcimInterfacesListParams { + o.SetLagID(lagID) + return o +} + +// SetLagID adds the lagId to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetLagID(lagID *string) { + o.LagID = lagID +} + +// WithLimit adds the limit to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithLimit(limit *int64) *DcimInterfacesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMacAddress adds the macAddress to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithMacAddress(macAddress *string) *DcimInterfacesListParams { + o.SetMacAddress(macAddress) + return o +} + +// SetMacAddress adds the macAddress to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetMacAddress(macAddress *string) { + o.MacAddress = macAddress +} + +// WithMgmtOnly adds the mgmtOnly to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithMgmtOnly(mgmtOnly *string) *DcimInterfacesListParams { + o.SetMgmtOnly(mgmtOnly) + return o +} + +// SetMgmtOnly adds the mgmtOnly to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetMgmtOnly(mgmtOnly *string) { + o.MgmtOnly = mgmtOnly +} + +// WithMtu adds the mtu to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithMtu(mtu *float64) *DcimInterfacesListParams { + o.SetMtu(mtu) + return o +} + +// SetMtu adds the mtu to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetMtu(mtu *float64) { + o.Mtu = mtu +} + +// WithName adds the name to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithName(name *string) *DcimInterfacesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithOffset(offset *int64) *DcimInterfacesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithType adds the typeVar to the dcim interfaces list params +func (o *DcimInterfacesListParams) WithType(typeVar *string) *DcimInterfacesListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim interfaces list params +func (o *DcimInterfacesListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID float64 + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := swag.FormatFloat64(qrDeviceID) + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Enabled != nil { + + // query param enabled + var qrEnabled string + if o.Enabled != nil { + qrEnabled = *o.Enabled + } + qEnabled := qrEnabled + if qEnabled != "" { + if err := r.SetQueryParam("enabled", qEnabled); err != nil { + return err + } + } + + } + + if o.FormFactor != nil { + + // query param form_factor + var qrFormFactor string + if o.FormFactor != nil { + qrFormFactor = *o.FormFactor + } + qFormFactor := qrFormFactor + if qFormFactor != "" { + if err := r.SetQueryParam("form_factor", qFormFactor); err != nil { + return err + } + } + + } + + if o.LagID != nil { + + // query param lag_id + var qrLagID string + if o.LagID != nil { + qrLagID = *o.LagID + } + qLagID := qrLagID + if qLagID != "" { + if err := r.SetQueryParam("lag_id", qLagID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.MacAddress != nil { + + // query param mac_address + var qrMacAddress string + if o.MacAddress != nil { + qrMacAddress = *o.MacAddress + } + qMacAddress := qrMacAddress + if qMacAddress != "" { + if err := r.SetQueryParam("mac_address", qMacAddress); err != nil { + return err + } + } + + } + + if o.MgmtOnly != nil { + + // query param mgmt_only + var qrMgmtOnly string + if o.MgmtOnly != nil { + qrMgmtOnly = *o.MgmtOnly + } + qMgmtOnly := qrMgmtOnly + if qMgmtOnly != "" { + if err := r.SetQueryParam("mgmt_only", qMgmtOnly); err != nil { + return err + } + } + + } + + if o.Mtu != nil { + + // query param mtu + var qrMtu float64 + if o.Mtu != nil { + qrMtu = *o.Mtu + } + qMtu := swag.FormatFloat64(qrMtu) + if qMtu != "" { + if err := r.SetQueryParam("mtu", qMtu); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_interfaces_list_responses.go b/netbox/client/dcim/dcim_interfaces_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..987ca866b1a2d90a2f8df248d68fdc939abbb61b --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// DcimInterfacesListReader is a Reader for the DcimInterfacesList structure. +type DcimInterfacesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesListOK() + 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()) + } +} + +// NewDcimInterfacesListOK creates a DcimInterfacesListOK with default headers values +func NewDcimInterfacesListOK() *DcimInterfacesListOK { + return &DcimInterfacesListOK{} +} + +/*DcimInterfacesListOK handles this case with default header values. + +DcimInterfacesListOK dcim interfaces list o k +*/ +type DcimInterfacesListOK struct { + Payload *models.DcimInterfacesListOKBody +} + +func (o *DcimInterfacesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/interfaces/][%d] dcimInterfacesListOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimInterfacesListOKBody) + + // 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_interfaces_partial_update_parameters.go b/netbox/client/dcim/dcim_interfaces_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dbacb56dde099efe1a67b179047ee11d92ce8940 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// NewDcimInterfacesPartialUpdateParams creates a new DcimInterfacesPartialUpdateParams object +// with the default values initialized. +func NewDcimInterfacesPartialUpdateParams() *DcimInterfacesPartialUpdateParams { + var () + return &DcimInterfacesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesPartialUpdateParamsWithTimeout creates a new DcimInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfacesPartialUpdateParams { + var () + return &DcimInterfacesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesPartialUpdateParamsWithContext creates a new DcimInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesPartialUpdateParamsWithContext(ctx context.Context) *DcimInterfacesPartialUpdateParams { + var () + return &DcimInterfacesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesPartialUpdateParamsWithHTTPClient creates a new DcimInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfacesPartialUpdateParams { + var () + return &DcimInterfacesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim interfaces partial update operation typically these are written to a http.Request +*/ +type DcimInterfacesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInterface + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfacesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithContext(ctx context.Context) *DcimInterfacesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfacesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithData(data *models.WritableInterface) *DcimInterfacesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WithID adds the id to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) WithID(id int64) *DcimInterfacesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces partial update params +func (o *DcimInterfacesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesPartialUpdateParams) 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_interfaces_partial_update_responses.go b/netbox/client/dcim/dcim_interfaces_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ba9fe9cb8c15551a0b78a878ce1886c2d1bfb536 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// DcimInterfacesPartialUpdateReader is a Reader for the DcimInterfacesPartialUpdate structure. +type DcimInterfacesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesPartialUpdateOK() + 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()) + } +} + +// NewDcimInterfacesPartialUpdateOK creates a DcimInterfacesPartialUpdateOK with default headers values +func NewDcimInterfacesPartialUpdateOK() *DcimInterfacesPartialUpdateOK { + return &DcimInterfacesPartialUpdateOK{} +} + +/*DcimInterfacesPartialUpdateOK handles this case with default header values. + +DcimInterfacesPartialUpdateOK dcim interfaces partial update o k +*/ +type DcimInterfacesPartialUpdateOK struct { + Payload *models.WritableInterface +} + +func (o *DcimInterfacesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/interfaces/{id}/][%d] dcimInterfacesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // 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_interfaces_read_parameters.go b/netbox/client/dcim/dcim_interfaces_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..165cc860eec974a00e91e6f7a0e9182a09bf0e7e --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// NewDcimInterfacesReadParams creates a new DcimInterfacesReadParams object +// with the default values initialized. +func NewDcimInterfacesReadParams() *DcimInterfacesReadParams { + var () + return &DcimInterfacesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesReadParamsWithTimeout creates a new DcimInterfacesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesReadParamsWithTimeout(timeout time.Duration) *DcimInterfacesReadParams { + var () + return &DcimInterfacesReadParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesReadParamsWithContext creates a new DcimInterfacesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesReadParamsWithContext(ctx context.Context) *DcimInterfacesReadParams { + var () + return &DcimInterfacesReadParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesReadParamsWithHTTPClient creates a new DcimInterfacesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesReadParamsWithHTTPClient(client *http.Client) *DcimInterfacesReadParams { + var () + return &DcimInterfacesReadParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesReadParams contains all the parameters to send to the API endpoint +for the dcim interfaces read operation typically these are written to a http.Request +*/ +type DcimInterfacesReadParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces read params +func (o *DcimInterfacesReadParams) WithTimeout(timeout time.Duration) *DcimInterfacesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces read params +func (o *DcimInterfacesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces read params +func (o *DcimInterfacesReadParams) WithContext(ctx context.Context) *DcimInterfacesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces read params +func (o *DcimInterfacesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces read params +func (o *DcimInterfacesReadParams) WithHTTPClient(client *http.Client) *DcimInterfacesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces read params +func (o *DcimInterfacesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim interfaces read params +func (o *DcimInterfacesReadParams) WithID(id int64) *DcimInterfacesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces read params +func (o *DcimInterfacesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesReadParams) 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_interfaces_read_responses.go b/netbox/client/dcim/dcim_interfaces_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0bc46f97ba212cb951e7b548b831ef8e6cacde85 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// DcimInterfacesReadReader is a Reader for the DcimInterfacesRead structure. +type DcimInterfacesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesReadOK() + 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()) + } +} + +// NewDcimInterfacesReadOK creates a DcimInterfacesReadOK with default headers values +func NewDcimInterfacesReadOK() *DcimInterfacesReadOK { + return &DcimInterfacesReadOK{} +} + +/*DcimInterfacesReadOK handles this case with default header values. + +DcimInterfacesReadOK dcim interfaces read o k +*/ +type DcimInterfacesReadOK struct { + Payload *models.Interface +} + +func (o *DcimInterfacesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/interfaces/{id}/][%d] dcimInterfacesReadOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Interface) + + // 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_interfaces_update_parameters.go b/netbox/client/dcim/dcim_interfaces_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9c94c35c282e6093349c757acee67e9201ab8566 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// NewDcimInterfacesUpdateParams creates a new DcimInterfacesUpdateParams object +// with the default values initialized. +func NewDcimInterfacesUpdateParams() *DcimInterfacesUpdateParams { + var () + return &DcimInterfacesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInterfacesUpdateParamsWithTimeout creates a new DcimInterfacesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInterfacesUpdateParamsWithTimeout(timeout time.Duration) *DcimInterfacesUpdateParams { + var () + return &DcimInterfacesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInterfacesUpdateParamsWithContext creates a new DcimInterfacesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInterfacesUpdateParamsWithContext(ctx context.Context) *DcimInterfacesUpdateParams { + var () + return &DcimInterfacesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInterfacesUpdateParamsWithHTTPClient creates a new DcimInterfacesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInterfacesUpdateParamsWithHTTPClient(client *http.Client) *DcimInterfacesUpdateParams { + var () + return &DcimInterfacesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInterfacesUpdateParams contains all the parameters to send to the API endpoint +for the dcim interfaces update operation typically these are written to a http.Request +*/ +type DcimInterfacesUpdateParams struct { + + /*Data*/ + Data *models.WritableInterface + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithTimeout(timeout time.Duration) *DcimInterfacesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithContext(ctx context.Context) *DcimInterfacesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithHTTPClient(client *http.Client) *DcimInterfacesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithData(data *models.WritableInterface) *DcimInterfacesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WithID adds the id to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) WithID(id int64) *DcimInterfacesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim interfaces update params +func (o *DcimInterfacesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInterfacesUpdateParams) 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_interfaces_update_responses.go b/netbox/client/dcim/dcim_interfaces_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..899833bd9695bc526e1a421bdcd57c6cb5550668 --- /dev/null +++ b/netbox/client/dcim/dcim_interfaces_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" +) + +// DcimInterfacesUpdateReader is a Reader for the DcimInterfacesUpdate structure. +type DcimInterfacesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInterfacesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInterfacesUpdateOK() + 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()) + } +} + +// NewDcimInterfacesUpdateOK creates a DcimInterfacesUpdateOK with default headers values +func NewDcimInterfacesUpdateOK() *DcimInterfacesUpdateOK { + return &DcimInterfacesUpdateOK{} +} + +/*DcimInterfacesUpdateOK handles this case with default header values. + +DcimInterfacesUpdateOK dcim interfaces update o k +*/ +type DcimInterfacesUpdateOK struct { + Payload *models.WritableInterface +} + +func (o *DcimInterfacesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/interfaces/{id}/][%d] dcimInterfacesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInterfacesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // 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_inventory_items_create_parameters.go b/netbox/client/dcim/dcim_inventory_items_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..96bcb0d6f9c7bb44e845188141e05b0c5167a717 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// NewDcimInventoryItemsCreateParams creates a new DcimInventoryItemsCreateParams object +// with the default values initialized. +func NewDcimInventoryItemsCreateParams() *DcimInventoryItemsCreateParams { + var () + return &DcimInventoryItemsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsCreateParamsWithTimeout creates a new DcimInventoryItemsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsCreateParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsCreateParams { + var () + return &DcimInventoryItemsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsCreateParamsWithContext creates a new DcimInventoryItemsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsCreateParamsWithContext(ctx context.Context) *DcimInventoryItemsCreateParams { + var () + return &DcimInventoryItemsCreateParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsCreateParamsWithHTTPClient creates a new DcimInventoryItemsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsCreateParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsCreateParams { + var () + return &DcimInventoryItemsCreateParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsCreateParams contains all the parameters to send to the API endpoint +for the dcim inventory items create operation typically these are written to a http.Request +*/ +type DcimInventoryItemsCreateParams struct { + + /*Data*/ + Data *models.WritableInventoryItem + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) WithContext(ctx context.Context) *DcimInventoryItemsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) WithData(data *models.WritableInventoryItem) *DcimInventoryItemsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim inventory items create params +func (o *DcimInventoryItemsCreateParams) SetData(data *models.WritableInventoryItem) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsCreateParams) 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_inventory_items_create_responses.go b/netbox/client/dcim/dcim_inventory_items_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bf9783b05bf20ae0c00f0dbf75bb97c3638b7ee4 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// DcimInventoryItemsCreateReader is a Reader for the DcimInventoryItemsCreate structure. +type DcimInventoryItemsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimInventoryItemsCreateCreated() + 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()) + } +} + +// NewDcimInventoryItemsCreateCreated creates a DcimInventoryItemsCreateCreated with default headers values +func NewDcimInventoryItemsCreateCreated() *DcimInventoryItemsCreateCreated { + return &DcimInventoryItemsCreateCreated{} +} + +/*DcimInventoryItemsCreateCreated handles this case with default header values. + +DcimInventoryItemsCreateCreated dcim inventory items create created +*/ +type DcimInventoryItemsCreateCreated struct { + Payload *models.WritableInventoryItem +} + +func (o *DcimInventoryItemsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/inventory-items/][%d] dcimInventoryItemsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimInventoryItemsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInventoryItem) + + // 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_inventory_items_delete_parameters.go b/netbox/client/dcim/dcim_inventory_items_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a67cf42d198d538a6a0d5b1d2a09d4950d894976 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// NewDcimInventoryItemsDeleteParams creates a new DcimInventoryItemsDeleteParams object +// with the default values initialized. +func NewDcimInventoryItemsDeleteParams() *DcimInventoryItemsDeleteParams { + var () + return &DcimInventoryItemsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsDeleteParamsWithTimeout creates a new DcimInventoryItemsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsDeleteParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsDeleteParams { + var () + return &DcimInventoryItemsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsDeleteParamsWithContext creates a new DcimInventoryItemsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsDeleteParamsWithContext(ctx context.Context) *DcimInventoryItemsDeleteParams { + var () + return &DcimInventoryItemsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsDeleteParamsWithHTTPClient creates a new DcimInventoryItemsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsDeleteParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsDeleteParams { + var () + return &DcimInventoryItemsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsDeleteParams contains all the parameters to send to the API endpoint +for the dcim inventory items delete operation typically these are written to a http.Request +*/ +type DcimInventoryItemsDeleteParams struct { + + /*ID + A unique integer value identifying this inventory item. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) WithContext(ctx context.Context) *DcimInventoryItemsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) WithID(id int64) *DcimInventoryItemsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items delete params +func (o *DcimInventoryItemsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsDeleteParams) 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_inventory_items_delete_responses.go b/netbox/client/dcim/dcim_inventory_items_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a3ba276173f15d33a1f05400ef6a47afe5ad631d --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// DcimInventoryItemsDeleteReader is a Reader for the DcimInventoryItemsDelete structure. +type DcimInventoryItemsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimInventoryItemsDeleteNoContent() + 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()) + } +} + +// NewDcimInventoryItemsDeleteNoContent creates a DcimInventoryItemsDeleteNoContent with default headers values +func NewDcimInventoryItemsDeleteNoContent() *DcimInventoryItemsDeleteNoContent { + return &DcimInventoryItemsDeleteNoContent{} +} + +/*DcimInventoryItemsDeleteNoContent handles this case with default header values. + +DcimInventoryItemsDeleteNoContent dcim inventory items delete no content +*/ +type DcimInventoryItemsDeleteNoContent struct { +} + +func (o *DcimInventoryItemsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/inventory-items/{id}/][%d] dcimInventoryItemsDeleteNoContent ", 204) +} + +func (o *DcimInventoryItemsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_inventory_items_list_parameters.go b/netbox/client/dcim/dcim_inventory_items_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dad76e492d6218a1f63807c8ffc7f6d1bf9b4582 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_list_parameters.go @@ -0,0 +1,500 @@ +// 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" +) + +// NewDcimInventoryItemsListParams creates a new DcimInventoryItemsListParams object +// with the default values initialized. +func NewDcimInventoryItemsListParams() *DcimInventoryItemsListParams { + var () + return &DcimInventoryItemsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsListParamsWithTimeout creates a new DcimInventoryItemsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsListParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsListParams { + var () + return &DcimInventoryItemsListParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsListParamsWithContext creates a new DcimInventoryItemsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsListParamsWithContext(ctx context.Context) *DcimInventoryItemsListParams { + var () + return &DcimInventoryItemsListParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsListParamsWithHTTPClient creates a new DcimInventoryItemsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsListParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsListParams { + var () + return &DcimInventoryItemsListParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsListParams contains all the parameters to send to the API endpoint +for the dcim inventory items list operation typically these are written to a http.Request +*/ +type DcimInventoryItemsListParams struct { + + /*AssetTag*/ + AssetTag *string + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Discovered*/ + Discovered *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Manufacturer*/ + Manufacturer *string + /*ManufacturerID*/ + ManufacturerID *string + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*ParentID*/ + ParentID *string + /*PartID*/ + PartID *string + /*Q*/ + Q *string + /*Serial*/ + Serial *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithContext(ctx context.Context) *DcimInventoryItemsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAssetTag adds the assetTag to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithAssetTag(assetTag *string) *DcimInventoryItemsListParams { + o.SetAssetTag(assetTag) + return o +} + +// SetAssetTag adds the assetTag to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetAssetTag(assetTag *string) { + o.AssetTag = assetTag +} + +// WithDevice adds the device to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithDevice(device *string) *DcimInventoryItemsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithDeviceID(deviceID *string) *DcimInventoryItemsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithDiscovered adds the discovered to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithDiscovered(discovered *string) *DcimInventoryItemsListParams { + o.SetDiscovered(discovered) + return o +} + +// SetDiscovered adds the discovered to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetDiscovered(discovered *string) { + o.Discovered = discovered +} + +// WithLimit adds the limit to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithLimit(limit *int64) *DcimInventoryItemsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithManufacturer adds the manufacturer to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithManufacturer(manufacturer *string) *DcimInventoryItemsListParams { + o.SetManufacturer(manufacturer) + return o +} + +// SetManufacturer adds the manufacturer to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetManufacturer(manufacturer *string) { + o.Manufacturer = manufacturer +} + +// WithManufacturerID adds the manufacturerID to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithManufacturerID(manufacturerID *string) *DcimInventoryItemsListParams { + o.SetManufacturerID(manufacturerID) + return o +} + +// SetManufacturerID adds the manufacturerId to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetManufacturerID(manufacturerID *string) { + o.ManufacturerID = manufacturerID +} + +// WithName adds the name to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithName(name *string) *DcimInventoryItemsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithOffset(offset *int64) *DcimInventoryItemsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithParentID adds the parentID to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithParentID(parentID *string) *DcimInventoryItemsListParams { + o.SetParentID(parentID) + return o +} + +// SetParentID adds the parentId to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetParentID(parentID *string) { + o.ParentID = parentID +} + +// WithPartID adds the partID to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithPartID(partID *string) *DcimInventoryItemsListParams { + o.SetPartID(partID) + return o +} + +// SetPartID adds the partId to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetPartID(partID *string) { + o.PartID = partID +} + +// WithQ adds the q to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithQ(q *string) *DcimInventoryItemsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSerial adds the serial to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) WithSerial(serial *string) *DcimInventoryItemsListParams { + o.SetSerial(serial) + return o +} + +// SetSerial adds the serial to the dcim inventory items list params +func (o *DcimInventoryItemsListParams) SetSerial(serial *string) { + o.Serial = serial +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.AssetTag != nil { + + // query param asset_tag + var qrAssetTag string + if o.AssetTag != nil { + qrAssetTag = *o.AssetTag + } + qAssetTag := qrAssetTag + if qAssetTag != "" { + if err := r.SetQueryParam("asset_tag", qAssetTag); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Discovered != nil { + + // query param discovered + var qrDiscovered string + if o.Discovered != nil { + qrDiscovered = *o.Discovered + } + qDiscovered := qrDiscovered + if qDiscovered != "" { + if err := r.SetQueryParam("discovered", qDiscovered); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.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 + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.ParentID != nil { + + // query param parent_id + var qrParentID string + if o.ParentID != nil { + qrParentID = *o.ParentID + } + qParentID := qrParentID + if qParentID != "" { + if err := r.SetQueryParam("parent_id", qParentID); err != nil { + return err + } + } + + } + + if o.PartID != nil { + + // query param part_id + var qrPartID string + if o.PartID != nil { + qrPartID = *o.PartID + } + qPartID := qrPartID + if qPartID != "" { + if err := r.SetQueryParam("part_id", qPartID); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Serial != nil { + + // query param serial + var qrSerial string + if o.Serial != nil { + qrSerial = *o.Serial + } + qSerial := qrSerial + if qSerial != "" { + if err := r.SetQueryParam("serial", qSerial); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_inventory_items_list_responses.go b/netbox/client/dcim/dcim_inventory_items_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b3a54a95679e66e1977b425090e4b5dc818fea84 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// DcimInventoryItemsListReader is a Reader for the DcimInventoryItemsList structure. +type DcimInventoryItemsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInventoryItemsListOK() + 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()) + } +} + +// NewDcimInventoryItemsListOK creates a DcimInventoryItemsListOK with default headers values +func NewDcimInventoryItemsListOK() *DcimInventoryItemsListOK { + return &DcimInventoryItemsListOK{} +} + +/*DcimInventoryItemsListOK handles this case with default header values. + +DcimInventoryItemsListOK dcim inventory items list o k +*/ +type DcimInventoryItemsListOK struct { + Payload *models.DcimInventoryItemsListOKBody +} + +func (o *DcimInventoryItemsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/inventory-items/][%d] dcimInventoryItemsListOK %+v", 200, o.Payload) +} + +func (o *DcimInventoryItemsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimInventoryItemsListOKBody) + + // 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_inventory_items_partial_update_parameters.go b/netbox/client/dcim/dcim_inventory_items_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..cba9cd3a9016a171633ef435e6d6160afb6bcb70 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// NewDcimInventoryItemsPartialUpdateParams creates a new DcimInventoryItemsPartialUpdateParams object +// with the default values initialized. +func NewDcimInventoryItemsPartialUpdateParams() *DcimInventoryItemsPartialUpdateParams { + var () + return &DcimInventoryItemsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsPartialUpdateParamsWithTimeout creates a new DcimInventoryItemsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsPartialUpdateParams { + var () + return &DcimInventoryItemsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsPartialUpdateParamsWithContext creates a new DcimInventoryItemsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsPartialUpdateParamsWithContext(ctx context.Context) *DcimInventoryItemsPartialUpdateParams { + var () + return &DcimInventoryItemsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsPartialUpdateParamsWithHTTPClient creates a new DcimInventoryItemsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsPartialUpdateParams { + var () + return &DcimInventoryItemsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim inventory items partial update operation typically these are written to a http.Request +*/ +type DcimInventoryItemsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInventoryItem + /*ID + A unique integer value identifying this inventory item. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithContext(ctx context.Context) *DcimInventoryItemsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithData(data *models.WritableInventoryItem) *DcimInventoryItemsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetData(data *models.WritableInventoryItem) { + o.Data = data +} + +// WithID adds the id to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) WithID(id int64) *DcimInventoryItemsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items partial update params +func (o *DcimInventoryItemsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsPartialUpdateParams) 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_inventory_items_partial_update_responses.go b/netbox/client/dcim/dcim_inventory_items_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..978d9e00b219c8b4e2264e4ec09ac1cd29a2a8f3 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// DcimInventoryItemsPartialUpdateReader is a Reader for the DcimInventoryItemsPartialUpdate structure. +type DcimInventoryItemsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInventoryItemsPartialUpdateOK() + 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()) + } +} + +// NewDcimInventoryItemsPartialUpdateOK creates a DcimInventoryItemsPartialUpdateOK with default headers values +func NewDcimInventoryItemsPartialUpdateOK() *DcimInventoryItemsPartialUpdateOK { + return &DcimInventoryItemsPartialUpdateOK{} +} + +/*DcimInventoryItemsPartialUpdateOK handles this case with default header values. + +DcimInventoryItemsPartialUpdateOK dcim inventory items partial update o k +*/ +type DcimInventoryItemsPartialUpdateOK struct { + Payload *models.WritableInventoryItem +} + +func (o *DcimInventoryItemsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/inventory-items/{id}/][%d] dcimInventoryItemsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInventoryItemsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInventoryItem) + + // 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_inventory_items_read_parameters.go b/netbox/client/dcim/dcim_inventory_items_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..860cb5b2f60d529ba6652cfcfc31156bb2ce50cd --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// NewDcimInventoryItemsReadParams creates a new DcimInventoryItemsReadParams object +// with the default values initialized. +func NewDcimInventoryItemsReadParams() *DcimInventoryItemsReadParams { + var () + return &DcimInventoryItemsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsReadParamsWithTimeout creates a new DcimInventoryItemsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsReadParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsReadParams { + var () + return &DcimInventoryItemsReadParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsReadParamsWithContext creates a new DcimInventoryItemsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsReadParamsWithContext(ctx context.Context) *DcimInventoryItemsReadParams { + var () + return &DcimInventoryItemsReadParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsReadParamsWithHTTPClient creates a new DcimInventoryItemsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsReadParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsReadParams { + var () + return &DcimInventoryItemsReadParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsReadParams contains all the parameters to send to the API endpoint +for the dcim inventory items read operation typically these are written to a http.Request +*/ +type DcimInventoryItemsReadParams struct { + + /*ID + A unique integer value identifying this inventory item. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) WithContext(ctx context.Context) *DcimInventoryItemsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) WithID(id int64) *DcimInventoryItemsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items read params +func (o *DcimInventoryItemsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsReadParams) 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_inventory_items_read_responses.go b/netbox/client/dcim/dcim_inventory_items_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e7f5ecb9d3405ae418ec2c220f0b861c53b754d7 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// DcimInventoryItemsReadReader is a Reader for the DcimInventoryItemsRead structure. +type DcimInventoryItemsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInventoryItemsReadOK() + 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()) + } +} + +// NewDcimInventoryItemsReadOK creates a DcimInventoryItemsReadOK with default headers values +func NewDcimInventoryItemsReadOK() *DcimInventoryItemsReadOK { + return &DcimInventoryItemsReadOK{} +} + +/*DcimInventoryItemsReadOK handles this case with default header values. + +DcimInventoryItemsReadOK dcim inventory items read o k +*/ +type DcimInventoryItemsReadOK struct { + Payload *models.InventoryItem +} + +func (o *DcimInventoryItemsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/inventory-items/{id}/][%d] dcimInventoryItemsReadOK %+v", 200, o.Payload) +} + +func (o *DcimInventoryItemsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.InventoryItem) + + // 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_inventory_items_update_parameters.go b/netbox/client/dcim/dcim_inventory_items_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9a6b08be006be4f82634903ac310e8747678ab87 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// NewDcimInventoryItemsUpdateParams creates a new DcimInventoryItemsUpdateParams object +// with the default values initialized. +func NewDcimInventoryItemsUpdateParams() *DcimInventoryItemsUpdateParams { + var () + return &DcimInventoryItemsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimInventoryItemsUpdateParamsWithTimeout creates a new DcimInventoryItemsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimInventoryItemsUpdateParamsWithTimeout(timeout time.Duration) *DcimInventoryItemsUpdateParams { + var () + return &DcimInventoryItemsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimInventoryItemsUpdateParamsWithContext creates a new DcimInventoryItemsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimInventoryItemsUpdateParamsWithContext(ctx context.Context) *DcimInventoryItemsUpdateParams { + var () + return &DcimInventoryItemsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimInventoryItemsUpdateParamsWithHTTPClient creates a new DcimInventoryItemsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimInventoryItemsUpdateParamsWithHTTPClient(client *http.Client) *DcimInventoryItemsUpdateParams { + var () + return &DcimInventoryItemsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimInventoryItemsUpdateParams contains all the parameters to send to the API endpoint +for the dcim inventory items update operation typically these are written to a http.Request +*/ +type DcimInventoryItemsUpdateParams struct { + + /*Data*/ + Data *models.WritableInventoryItem + /*ID + A unique integer value identifying this inventory item. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithTimeout(timeout time.Duration) *DcimInventoryItemsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithContext(ctx context.Context) *DcimInventoryItemsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithHTTPClient(client *http.Client) *DcimInventoryItemsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithData(data *models.WritableInventoryItem) *DcimInventoryItemsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetData(data *models.WritableInventoryItem) { + o.Data = data +} + +// WithID adds the id to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) WithID(id int64) *DcimInventoryItemsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim inventory items update params +func (o *DcimInventoryItemsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimInventoryItemsUpdateParams) 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_inventory_items_update_responses.go b/netbox/client/dcim/dcim_inventory_items_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..be85f99d5c459b560157a219accb4fb711607803 --- /dev/null +++ b/netbox/client/dcim/dcim_inventory_items_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" +) + +// DcimInventoryItemsUpdateReader is a Reader for the DcimInventoryItemsUpdate structure. +type DcimInventoryItemsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimInventoryItemsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimInventoryItemsUpdateOK() + 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()) + } +} + +// NewDcimInventoryItemsUpdateOK creates a DcimInventoryItemsUpdateOK with default headers values +func NewDcimInventoryItemsUpdateOK() *DcimInventoryItemsUpdateOK { + return &DcimInventoryItemsUpdateOK{} +} + +/*DcimInventoryItemsUpdateOK handles this case with default header values. + +DcimInventoryItemsUpdateOK dcim inventory items update o k +*/ +type DcimInventoryItemsUpdateOK struct { + Payload *models.WritableInventoryItem +} + +func (o *DcimInventoryItemsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/inventory-items/{id}/][%d] dcimInventoryItemsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimInventoryItemsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInventoryItem) + + // 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_manufacturers_create_parameters.go b/netbox/client/dcim/dcim_manufacturers_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d98e38d433121f9c57de9dc0b1fd171a1bb35945 --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// NewDcimManufacturersCreateParams creates a new DcimManufacturersCreateParams object +// with the default values initialized. +func NewDcimManufacturersCreateParams() *DcimManufacturersCreateParams { + var () + return &DcimManufacturersCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersCreateParamsWithTimeout creates a new DcimManufacturersCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersCreateParamsWithTimeout(timeout time.Duration) *DcimManufacturersCreateParams { + var () + return &DcimManufacturersCreateParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersCreateParamsWithContext creates a new DcimManufacturersCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersCreateParamsWithContext(ctx context.Context) *DcimManufacturersCreateParams { + var () + return &DcimManufacturersCreateParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersCreateParamsWithHTTPClient creates a new DcimManufacturersCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersCreateParamsWithHTTPClient(client *http.Client) *DcimManufacturersCreateParams { + var () + return &DcimManufacturersCreateParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersCreateParams contains all the parameters to send to the API endpoint +for the dcim manufacturers create operation typically these are written to a http.Request +*/ +type DcimManufacturersCreateParams struct { + + /*Data*/ + Data *models.Manufacturer + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) WithTimeout(timeout time.Duration) *DcimManufacturersCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) WithContext(ctx context.Context) *DcimManufacturersCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) WithHTTPClient(client *http.Client) *DcimManufacturersCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) WithData(data *models.Manufacturer) *DcimManufacturersCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim manufacturers create params +func (o *DcimManufacturersCreateParams) SetData(data *models.Manufacturer) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersCreateParams) 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_manufacturers_create_responses.go b/netbox/client/dcim/dcim_manufacturers_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a65b800e452ffe9162fc2dfe07ad2a55722e595a --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// DcimManufacturersCreateReader is a Reader for the DcimManufacturersCreate structure. +type DcimManufacturersCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimManufacturersCreateCreated() + 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()) + } +} + +// NewDcimManufacturersCreateCreated creates a DcimManufacturersCreateCreated with default headers values +func NewDcimManufacturersCreateCreated() *DcimManufacturersCreateCreated { + return &DcimManufacturersCreateCreated{} +} + +/*DcimManufacturersCreateCreated handles this case with default header values. + +DcimManufacturersCreateCreated dcim manufacturers create created +*/ +type DcimManufacturersCreateCreated struct { + Payload *models.Manufacturer +} + +func (o *DcimManufacturersCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/manufacturers/][%d] dcimManufacturersCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimManufacturersCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Manufacturer) + + // 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_manufacturers_delete_parameters.go b/netbox/client/dcim/dcim_manufacturers_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ab479392ae8f37276c2f54a40c5877232c3f2544 --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// NewDcimManufacturersDeleteParams creates a new DcimManufacturersDeleteParams object +// with the default values initialized. +func NewDcimManufacturersDeleteParams() *DcimManufacturersDeleteParams { + var () + return &DcimManufacturersDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersDeleteParamsWithTimeout creates a new DcimManufacturersDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersDeleteParamsWithTimeout(timeout time.Duration) *DcimManufacturersDeleteParams { + var () + return &DcimManufacturersDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersDeleteParamsWithContext creates a new DcimManufacturersDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersDeleteParamsWithContext(ctx context.Context) *DcimManufacturersDeleteParams { + var () + return &DcimManufacturersDeleteParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersDeleteParamsWithHTTPClient creates a new DcimManufacturersDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersDeleteParamsWithHTTPClient(client *http.Client) *DcimManufacturersDeleteParams { + var () + return &DcimManufacturersDeleteParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersDeleteParams contains all the parameters to send to the API endpoint +for the dcim manufacturers delete operation typically these are written to a http.Request +*/ +type DcimManufacturersDeleteParams struct { + + /*ID + A unique integer value identifying this manufacturer. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) WithTimeout(timeout time.Duration) *DcimManufacturersDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) WithContext(ctx context.Context) *DcimManufacturersDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) WithHTTPClient(client *http.Client) *DcimManufacturersDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) WithID(id int64) *DcimManufacturersDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers delete params +func (o *DcimManufacturersDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersDeleteParams) 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_manufacturers_delete_responses.go b/netbox/client/dcim/dcim_manufacturers_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c83eeabb9f45ba8aebf8dd72b4ecbf616065741f --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// DcimManufacturersDeleteReader is a Reader for the DcimManufacturersDelete structure. +type DcimManufacturersDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimManufacturersDeleteNoContent() + 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()) + } +} + +// NewDcimManufacturersDeleteNoContent creates a DcimManufacturersDeleteNoContent with default headers values +func NewDcimManufacturersDeleteNoContent() *DcimManufacturersDeleteNoContent { + return &DcimManufacturersDeleteNoContent{} +} + +/*DcimManufacturersDeleteNoContent handles this case with default header values. + +DcimManufacturersDeleteNoContent dcim manufacturers delete no content +*/ +type DcimManufacturersDeleteNoContent struct { +} + +func (o *DcimManufacturersDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/manufacturers/{id}/][%d] dcimManufacturersDeleteNoContent ", 204) +} + +func (o *DcimManufacturersDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_manufacturers_list_parameters.go b/netbox/client/dcim/dcim_manufacturers_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b8870ed001ce98808d3fabdf6561434e3b17264e --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_list_parameters.go @@ -0,0 +1,239 @@ +// 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" +) + +// NewDcimManufacturersListParams creates a new DcimManufacturersListParams object +// with the default values initialized. +func NewDcimManufacturersListParams() *DcimManufacturersListParams { + var () + return &DcimManufacturersListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersListParamsWithTimeout creates a new DcimManufacturersListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersListParamsWithTimeout(timeout time.Duration) *DcimManufacturersListParams { + var () + return &DcimManufacturersListParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersListParamsWithContext creates a new DcimManufacturersListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersListParamsWithContext(ctx context.Context) *DcimManufacturersListParams { + var () + return &DcimManufacturersListParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersListParamsWithHTTPClient creates a new DcimManufacturersListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersListParamsWithHTTPClient(client *http.Client) *DcimManufacturersListParams { + var () + return &DcimManufacturersListParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersListParams contains all the parameters to send to the API endpoint +for the dcim manufacturers list operation typically these are written to a http.Request +*/ +type DcimManufacturersListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithTimeout(timeout time.Duration) *DcimManufacturersListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithContext(ctx context.Context) *DcimManufacturersListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithHTTPClient(client *http.Client) *DcimManufacturersListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithLimit(limit *int64) *DcimManufacturersListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithName(name *string) *DcimManufacturersListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithOffset(offset *int64) *DcimManufacturersListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the dcim manufacturers list params +func (o *DcimManufacturersListParams) WithSlug(slug *string) *DcimManufacturersListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim manufacturers list params +func (o *DcimManufacturersListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_manufacturers_list_responses.go b/netbox/client/dcim/dcim_manufacturers_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4ac5c97f46e38a85872966b531cfdb3715ee22e3 --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// DcimManufacturersListReader is a Reader for the DcimManufacturersList structure. +type DcimManufacturersListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimManufacturersListOK() + 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()) + } +} + +// NewDcimManufacturersListOK creates a DcimManufacturersListOK with default headers values +func NewDcimManufacturersListOK() *DcimManufacturersListOK { + return &DcimManufacturersListOK{} +} + +/*DcimManufacturersListOK handles this case with default header values. + +DcimManufacturersListOK dcim manufacturers list o k +*/ +type DcimManufacturersListOK struct { + Payload *models.DcimManufacturersListOKBody +} + +func (o *DcimManufacturersListOK) Error() string { + return fmt.Sprintf("[GET /dcim/manufacturers/][%d] dcimManufacturersListOK %+v", 200, o.Payload) +} + +func (o *DcimManufacturersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimManufacturersListOKBody) + + // 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_manufacturers_partial_update_parameters.go b/netbox/client/dcim/dcim_manufacturers_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..102397e2938bb172705c0c642188c51dffa56d79 --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// NewDcimManufacturersPartialUpdateParams creates a new DcimManufacturersPartialUpdateParams object +// with the default values initialized. +func NewDcimManufacturersPartialUpdateParams() *DcimManufacturersPartialUpdateParams { + var () + return &DcimManufacturersPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersPartialUpdateParamsWithTimeout creates a new DcimManufacturersPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimManufacturersPartialUpdateParams { + var () + return &DcimManufacturersPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersPartialUpdateParamsWithContext creates a new DcimManufacturersPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersPartialUpdateParamsWithContext(ctx context.Context) *DcimManufacturersPartialUpdateParams { + var () + return &DcimManufacturersPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersPartialUpdateParamsWithHTTPClient creates a new DcimManufacturersPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimManufacturersPartialUpdateParams { + var () + return &DcimManufacturersPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim manufacturers partial update operation typically these are written to a http.Request +*/ +type DcimManufacturersPartialUpdateParams struct { + + /*Data*/ + Data *models.Manufacturer + /*ID + A unique integer value identifying this manufacturer. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimManufacturersPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithContext(ctx context.Context) *DcimManufacturersPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimManufacturersPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithData(data *models.Manufacturer) *DcimManufacturersPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetData(data *models.Manufacturer) { + o.Data = data +} + +// WithID adds the id to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) WithID(id int64) *DcimManufacturersPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers partial update params +func (o *DcimManufacturersPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersPartialUpdateParams) 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_manufacturers_partial_update_responses.go b/netbox/client/dcim/dcim_manufacturers_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f6855cba47595992896100524881600be9d32f7c --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// DcimManufacturersPartialUpdateReader is a Reader for the DcimManufacturersPartialUpdate structure. +type DcimManufacturersPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimManufacturersPartialUpdateOK() + 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()) + } +} + +// NewDcimManufacturersPartialUpdateOK creates a DcimManufacturersPartialUpdateOK with default headers values +func NewDcimManufacturersPartialUpdateOK() *DcimManufacturersPartialUpdateOK { + return &DcimManufacturersPartialUpdateOK{} +} + +/*DcimManufacturersPartialUpdateOK handles this case with default header values. + +DcimManufacturersPartialUpdateOK dcim manufacturers partial update o k +*/ +type DcimManufacturersPartialUpdateOK struct { + Payload *models.Manufacturer +} + +func (o *DcimManufacturersPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/manufacturers/{id}/][%d] dcimManufacturersPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimManufacturersPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Manufacturer) + + // 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_manufacturers_read_parameters.go b/netbox/client/dcim/dcim_manufacturers_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..92c671b365567c1a3d7d9a1eebf1b150d89c08c7 --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// NewDcimManufacturersReadParams creates a new DcimManufacturersReadParams object +// with the default values initialized. +func NewDcimManufacturersReadParams() *DcimManufacturersReadParams { + var () + return &DcimManufacturersReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersReadParamsWithTimeout creates a new DcimManufacturersReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersReadParamsWithTimeout(timeout time.Duration) *DcimManufacturersReadParams { + var () + return &DcimManufacturersReadParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersReadParamsWithContext creates a new DcimManufacturersReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersReadParamsWithContext(ctx context.Context) *DcimManufacturersReadParams { + var () + return &DcimManufacturersReadParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersReadParamsWithHTTPClient creates a new DcimManufacturersReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersReadParamsWithHTTPClient(client *http.Client) *DcimManufacturersReadParams { + var () + return &DcimManufacturersReadParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersReadParams contains all the parameters to send to the API endpoint +for the dcim manufacturers read operation typically these are written to a http.Request +*/ +type DcimManufacturersReadParams struct { + + /*ID + A unique integer value identifying this manufacturer. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) WithTimeout(timeout time.Duration) *DcimManufacturersReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) WithContext(ctx context.Context) *DcimManufacturersReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) WithHTTPClient(client *http.Client) *DcimManufacturersReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) WithID(id int64) *DcimManufacturersReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers read params +func (o *DcimManufacturersReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersReadParams) 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_manufacturers_read_responses.go b/netbox/client/dcim/dcim_manufacturers_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3df017dcc6629c1f819b29ec7c64244d4ad30d6a --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// DcimManufacturersReadReader is a Reader for the DcimManufacturersRead structure. +type DcimManufacturersReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimManufacturersReadOK() + 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()) + } +} + +// NewDcimManufacturersReadOK creates a DcimManufacturersReadOK with default headers values +func NewDcimManufacturersReadOK() *DcimManufacturersReadOK { + return &DcimManufacturersReadOK{} +} + +/*DcimManufacturersReadOK handles this case with default header values. + +DcimManufacturersReadOK dcim manufacturers read o k +*/ +type DcimManufacturersReadOK struct { + Payload *models.Manufacturer +} + +func (o *DcimManufacturersReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/manufacturers/{id}/][%d] dcimManufacturersReadOK %+v", 200, o.Payload) +} + +func (o *DcimManufacturersReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Manufacturer) + + // 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_manufacturers_update_parameters.go b/netbox/client/dcim/dcim_manufacturers_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9e611b5066f0decb4263809a966f0267994531e2 --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// NewDcimManufacturersUpdateParams creates a new DcimManufacturersUpdateParams object +// with the default values initialized. +func NewDcimManufacturersUpdateParams() *DcimManufacturersUpdateParams { + var () + return &DcimManufacturersUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimManufacturersUpdateParamsWithTimeout creates a new DcimManufacturersUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimManufacturersUpdateParamsWithTimeout(timeout time.Duration) *DcimManufacturersUpdateParams { + var () + return &DcimManufacturersUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimManufacturersUpdateParamsWithContext creates a new DcimManufacturersUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimManufacturersUpdateParamsWithContext(ctx context.Context) *DcimManufacturersUpdateParams { + var () + return &DcimManufacturersUpdateParams{ + + Context: ctx, + } +} + +// NewDcimManufacturersUpdateParamsWithHTTPClient creates a new DcimManufacturersUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimManufacturersUpdateParamsWithHTTPClient(client *http.Client) *DcimManufacturersUpdateParams { + var () + return &DcimManufacturersUpdateParams{ + HTTPClient: client, + } +} + +/*DcimManufacturersUpdateParams contains all the parameters to send to the API endpoint +for the dcim manufacturers update operation typically these are written to a http.Request +*/ +type DcimManufacturersUpdateParams struct { + + /*Data*/ + Data *models.Manufacturer + /*ID + A unique integer value identifying this manufacturer. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithTimeout(timeout time.Duration) *DcimManufacturersUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithContext(ctx context.Context) *DcimManufacturersUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithHTTPClient(client *http.Client) *DcimManufacturersUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithData(data *models.Manufacturer) *DcimManufacturersUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetData(data *models.Manufacturer) { + o.Data = data +} + +// WithID adds the id to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) WithID(id int64) *DcimManufacturersUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim manufacturers update params +func (o *DcimManufacturersUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimManufacturersUpdateParams) 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_manufacturers_update_responses.go b/netbox/client/dcim/dcim_manufacturers_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6c3cb346b801904825044db514126ba7a371d082 --- /dev/null +++ b/netbox/client/dcim/dcim_manufacturers_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" +) + +// DcimManufacturersUpdateReader is a Reader for the DcimManufacturersUpdate structure. +type DcimManufacturersUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimManufacturersUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimManufacturersUpdateOK() + 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()) + } +} + +// NewDcimManufacturersUpdateOK creates a DcimManufacturersUpdateOK with default headers values +func NewDcimManufacturersUpdateOK() *DcimManufacturersUpdateOK { + return &DcimManufacturersUpdateOK{} +} + +/*DcimManufacturersUpdateOK handles this case with default header values. + +DcimManufacturersUpdateOK dcim manufacturers update o k +*/ +type DcimManufacturersUpdateOK struct { + Payload *models.Manufacturer +} + +func (o *DcimManufacturersUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/manufacturers/{id}/][%d] dcimManufacturersUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimManufacturersUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Manufacturer) + + // 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_platforms_create_parameters.go b/netbox/client/dcim/dcim_platforms_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..91908aaff2108f65838304133a5853ac1902d5e1 --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// NewDcimPlatformsCreateParams creates a new DcimPlatformsCreateParams object +// with the default values initialized. +func NewDcimPlatformsCreateParams() *DcimPlatformsCreateParams { + var () + return &DcimPlatformsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsCreateParamsWithTimeout creates a new DcimPlatformsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsCreateParamsWithTimeout(timeout time.Duration) *DcimPlatformsCreateParams { + var () + return &DcimPlatformsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsCreateParamsWithContext creates a new DcimPlatformsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsCreateParamsWithContext(ctx context.Context) *DcimPlatformsCreateParams { + var () + return &DcimPlatformsCreateParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsCreateParamsWithHTTPClient creates a new DcimPlatformsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsCreateParamsWithHTTPClient(client *http.Client) *DcimPlatformsCreateParams { + var () + return &DcimPlatformsCreateParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsCreateParams contains all the parameters to send to the API endpoint +for the dcim platforms create operation typically these are written to a http.Request +*/ +type DcimPlatformsCreateParams struct { + + /*Data*/ + Data *models.Platform + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms create params +func (o *DcimPlatformsCreateParams) WithTimeout(timeout time.Duration) *DcimPlatformsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms create params +func (o *DcimPlatformsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms create params +func (o *DcimPlatformsCreateParams) WithContext(ctx context.Context) *DcimPlatformsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms create params +func (o *DcimPlatformsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms create params +func (o *DcimPlatformsCreateParams) WithHTTPClient(client *http.Client) *DcimPlatformsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms create params +func (o *DcimPlatformsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim platforms create params +func (o *DcimPlatformsCreateParams) WithData(data *models.Platform) *DcimPlatformsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim platforms create params +func (o *DcimPlatformsCreateParams) SetData(data *models.Platform) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsCreateParams) 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_platforms_create_responses.go b/netbox/client/dcim/dcim_platforms_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6e6fb078e20a1eb67b716f818c280e391940ccaa --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// DcimPlatformsCreateReader is a Reader for the DcimPlatformsCreate structure. +type DcimPlatformsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPlatformsCreateCreated() + 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()) + } +} + +// NewDcimPlatformsCreateCreated creates a DcimPlatformsCreateCreated with default headers values +func NewDcimPlatformsCreateCreated() *DcimPlatformsCreateCreated { + return &DcimPlatformsCreateCreated{} +} + +/*DcimPlatformsCreateCreated handles this case with default header values. + +DcimPlatformsCreateCreated dcim platforms create created +*/ +type DcimPlatformsCreateCreated struct { + Payload *models.Platform +} + +func (o *DcimPlatformsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/platforms/][%d] dcimPlatformsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPlatformsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Platform) + + // 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_platforms_delete_parameters.go b/netbox/client/dcim/dcim_platforms_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9d9b9a7cc5d56da6aca1fcf84ce8c5e7b446fde2 --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// NewDcimPlatformsDeleteParams creates a new DcimPlatformsDeleteParams object +// with the default values initialized. +func NewDcimPlatformsDeleteParams() *DcimPlatformsDeleteParams { + var () + return &DcimPlatformsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsDeleteParamsWithTimeout creates a new DcimPlatformsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsDeleteParamsWithTimeout(timeout time.Duration) *DcimPlatformsDeleteParams { + var () + return &DcimPlatformsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsDeleteParamsWithContext creates a new DcimPlatformsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsDeleteParamsWithContext(ctx context.Context) *DcimPlatformsDeleteParams { + var () + return &DcimPlatformsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsDeleteParamsWithHTTPClient creates a new DcimPlatformsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsDeleteParamsWithHTTPClient(client *http.Client) *DcimPlatformsDeleteParams { + var () + return &DcimPlatformsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsDeleteParams contains all the parameters to send to the API endpoint +for the dcim platforms delete operation typically these are written to a http.Request +*/ +type DcimPlatformsDeleteParams struct { + + /*ID + A unique integer value identifying this platform. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) WithTimeout(timeout time.Duration) *DcimPlatformsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) WithContext(ctx context.Context) *DcimPlatformsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) WithHTTPClient(client *http.Client) *DcimPlatformsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) WithID(id int64) *DcimPlatformsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms delete params +func (o *DcimPlatformsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsDeleteParams) 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_platforms_delete_responses.go b/netbox/client/dcim/dcim_platforms_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..96c679efb8ed7ba941fe2c38b96f581cd63cdb59 --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// DcimPlatformsDeleteReader is a Reader for the DcimPlatformsDelete structure. +type DcimPlatformsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPlatformsDeleteNoContent() + 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()) + } +} + +// NewDcimPlatformsDeleteNoContent creates a DcimPlatformsDeleteNoContent with default headers values +func NewDcimPlatformsDeleteNoContent() *DcimPlatformsDeleteNoContent { + return &DcimPlatformsDeleteNoContent{} +} + +/*DcimPlatformsDeleteNoContent handles this case with default header values. + +DcimPlatformsDeleteNoContent dcim platforms delete no content +*/ +type DcimPlatformsDeleteNoContent struct { +} + +func (o *DcimPlatformsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/platforms/{id}/][%d] dcimPlatformsDeleteNoContent ", 204) +} + +func (o *DcimPlatformsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_platforms_list_parameters.go b/netbox/client/dcim/dcim_platforms_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c143538a5ce4ff12889e00974437ee6e6411a916 --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_list_parameters.go @@ -0,0 +1,239 @@ +// 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" +) + +// NewDcimPlatformsListParams creates a new DcimPlatformsListParams object +// with the default values initialized. +func NewDcimPlatformsListParams() *DcimPlatformsListParams { + var () + return &DcimPlatformsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsListParamsWithTimeout creates a new DcimPlatformsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsListParamsWithTimeout(timeout time.Duration) *DcimPlatformsListParams { + var () + return &DcimPlatformsListParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsListParamsWithContext creates a new DcimPlatformsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsListParamsWithContext(ctx context.Context) *DcimPlatformsListParams { + var () + return &DcimPlatformsListParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsListParamsWithHTTPClient creates a new DcimPlatformsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsListParamsWithHTTPClient(client *http.Client) *DcimPlatformsListParams { + var () + return &DcimPlatformsListParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsListParams contains all the parameters to send to the API endpoint +for the dcim platforms list operation typically these are written to a http.Request +*/ +type DcimPlatformsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms list params +func (o *DcimPlatformsListParams) WithTimeout(timeout time.Duration) *DcimPlatformsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms list params +func (o *DcimPlatformsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms list params +func (o *DcimPlatformsListParams) WithContext(ctx context.Context) *DcimPlatformsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms list params +func (o *DcimPlatformsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms list params +func (o *DcimPlatformsListParams) WithHTTPClient(client *http.Client) *DcimPlatformsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms list params +func (o *DcimPlatformsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim platforms list params +func (o *DcimPlatformsListParams) WithLimit(limit *int64) *DcimPlatformsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim platforms list params +func (o *DcimPlatformsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim platforms list params +func (o *DcimPlatformsListParams) WithName(name *string) *DcimPlatformsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim platforms list params +func (o *DcimPlatformsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim platforms list params +func (o *DcimPlatformsListParams) WithOffset(offset *int64) *DcimPlatformsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim platforms list params +func (o *DcimPlatformsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the dcim platforms list params +func (o *DcimPlatformsListParams) WithSlug(slug *string) *DcimPlatformsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim platforms list params +func (o *DcimPlatformsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_platforms_list_responses.go b/netbox/client/dcim/dcim_platforms_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a4ff37b61b663e9892b9d39db292d72eb8fed8f4 --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// DcimPlatformsListReader is a Reader for the DcimPlatformsList structure. +type DcimPlatformsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPlatformsListOK() + 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()) + } +} + +// NewDcimPlatformsListOK creates a DcimPlatformsListOK with default headers values +func NewDcimPlatformsListOK() *DcimPlatformsListOK { + return &DcimPlatformsListOK{} +} + +/*DcimPlatformsListOK handles this case with default header values. + +DcimPlatformsListOK dcim platforms list o k +*/ +type DcimPlatformsListOK struct { + Payload *models.DcimPlatformsListOKBody +} + +func (o *DcimPlatformsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/platforms/][%d] dcimPlatformsListOK %+v", 200, o.Payload) +} + +func (o *DcimPlatformsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPlatformsListOKBody) + + // 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_platforms_partial_update_parameters.go b/netbox/client/dcim/dcim_platforms_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..776f639d894d1dec5f5b8d4f27ab115b1bdf7e60 --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// NewDcimPlatformsPartialUpdateParams creates a new DcimPlatformsPartialUpdateParams object +// with the default values initialized. +func NewDcimPlatformsPartialUpdateParams() *DcimPlatformsPartialUpdateParams { + var () + return &DcimPlatformsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsPartialUpdateParamsWithTimeout creates a new DcimPlatformsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPlatformsPartialUpdateParams { + var () + return &DcimPlatformsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsPartialUpdateParamsWithContext creates a new DcimPlatformsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsPartialUpdateParamsWithContext(ctx context.Context) *DcimPlatformsPartialUpdateParams { + var () + return &DcimPlatformsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsPartialUpdateParamsWithHTTPClient creates a new DcimPlatformsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPlatformsPartialUpdateParams { + var () + return &DcimPlatformsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim platforms partial update operation typically these are written to a http.Request +*/ +type DcimPlatformsPartialUpdateParams struct { + + /*Data*/ + Data *models.Platform + /*ID + A unique integer value identifying this platform. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPlatformsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithContext(ctx context.Context) *DcimPlatformsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPlatformsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithData(data *models.Platform) *DcimPlatformsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetData(data *models.Platform) { + o.Data = data +} + +// WithID adds the id to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) WithID(id int64) *DcimPlatformsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms partial update params +func (o *DcimPlatformsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsPartialUpdateParams) 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_platforms_partial_update_responses.go b/netbox/client/dcim/dcim_platforms_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c2047f9cdceca8b7db3c4a202950206f8c97e84a --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// DcimPlatformsPartialUpdateReader is a Reader for the DcimPlatformsPartialUpdate structure. +type DcimPlatformsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPlatformsPartialUpdateOK() + 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()) + } +} + +// NewDcimPlatformsPartialUpdateOK creates a DcimPlatformsPartialUpdateOK with default headers values +func NewDcimPlatformsPartialUpdateOK() *DcimPlatformsPartialUpdateOK { + return &DcimPlatformsPartialUpdateOK{} +} + +/*DcimPlatformsPartialUpdateOK handles this case with default header values. + +DcimPlatformsPartialUpdateOK dcim platforms partial update o k +*/ +type DcimPlatformsPartialUpdateOK struct { + Payload *models.Platform +} + +func (o *DcimPlatformsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/platforms/{id}/][%d] dcimPlatformsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPlatformsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Platform) + + // 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_platforms_read_parameters.go b/netbox/client/dcim/dcim_platforms_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..10a4604732ca662506936f43004b8779aca98a2f --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// NewDcimPlatformsReadParams creates a new DcimPlatformsReadParams object +// with the default values initialized. +func NewDcimPlatformsReadParams() *DcimPlatformsReadParams { + var () + return &DcimPlatformsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsReadParamsWithTimeout creates a new DcimPlatformsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsReadParamsWithTimeout(timeout time.Duration) *DcimPlatformsReadParams { + var () + return &DcimPlatformsReadParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsReadParamsWithContext creates a new DcimPlatformsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsReadParamsWithContext(ctx context.Context) *DcimPlatformsReadParams { + var () + return &DcimPlatformsReadParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsReadParamsWithHTTPClient creates a new DcimPlatformsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsReadParamsWithHTTPClient(client *http.Client) *DcimPlatformsReadParams { + var () + return &DcimPlatformsReadParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsReadParams contains all the parameters to send to the API endpoint +for the dcim platforms read operation typically these are written to a http.Request +*/ +type DcimPlatformsReadParams struct { + + /*ID + A unique integer value identifying this platform. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms read params +func (o *DcimPlatformsReadParams) WithTimeout(timeout time.Duration) *DcimPlatformsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms read params +func (o *DcimPlatformsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms read params +func (o *DcimPlatformsReadParams) WithContext(ctx context.Context) *DcimPlatformsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms read params +func (o *DcimPlatformsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms read params +func (o *DcimPlatformsReadParams) WithHTTPClient(client *http.Client) *DcimPlatformsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms read params +func (o *DcimPlatformsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim platforms read params +func (o *DcimPlatformsReadParams) WithID(id int64) *DcimPlatformsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms read params +func (o *DcimPlatformsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsReadParams) 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_platforms_read_responses.go b/netbox/client/dcim/dcim_platforms_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5fccfdd5d83806b52843de12ba2eeaa84493537e --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// DcimPlatformsReadReader is a Reader for the DcimPlatformsRead structure. +type DcimPlatformsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPlatformsReadOK() + 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()) + } +} + +// NewDcimPlatformsReadOK creates a DcimPlatformsReadOK with default headers values +func NewDcimPlatformsReadOK() *DcimPlatformsReadOK { + return &DcimPlatformsReadOK{} +} + +/*DcimPlatformsReadOK handles this case with default header values. + +DcimPlatformsReadOK dcim platforms read o k +*/ +type DcimPlatformsReadOK struct { + Payload *models.Platform +} + +func (o *DcimPlatformsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/platforms/{id}/][%d] dcimPlatformsReadOK %+v", 200, o.Payload) +} + +func (o *DcimPlatformsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Platform) + + // 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_platforms_update_parameters.go b/netbox/client/dcim/dcim_platforms_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5a9ba845902adf4962b4723966679bdca2d0cadb --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// NewDcimPlatformsUpdateParams creates a new DcimPlatformsUpdateParams object +// with the default values initialized. +func NewDcimPlatformsUpdateParams() *DcimPlatformsUpdateParams { + var () + return &DcimPlatformsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPlatformsUpdateParamsWithTimeout creates a new DcimPlatformsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPlatformsUpdateParamsWithTimeout(timeout time.Duration) *DcimPlatformsUpdateParams { + var () + return &DcimPlatformsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPlatformsUpdateParamsWithContext creates a new DcimPlatformsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPlatformsUpdateParamsWithContext(ctx context.Context) *DcimPlatformsUpdateParams { + var () + return &DcimPlatformsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPlatformsUpdateParamsWithHTTPClient creates a new DcimPlatformsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPlatformsUpdateParamsWithHTTPClient(client *http.Client) *DcimPlatformsUpdateParams { + var () + return &DcimPlatformsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPlatformsUpdateParams contains all the parameters to send to the API endpoint +for the dcim platforms update operation typically these are written to a http.Request +*/ +type DcimPlatformsUpdateParams struct { + + /*Data*/ + Data *models.Platform + /*ID + A unique integer value identifying this platform. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithTimeout(timeout time.Duration) *DcimPlatformsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithContext(ctx context.Context) *DcimPlatformsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithHTTPClient(client *http.Client) *DcimPlatformsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithData(data *models.Platform) *DcimPlatformsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetData(data *models.Platform) { + o.Data = data +} + +// WithID adds the id to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) WithID(id int64) *DcimPlatformsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim platforms update params +func (o *DcimPlatformsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPlatformsUpdateParams) 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_platforms_update_responses.go b/netbox/client/dcim/dcim_platforms_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2533298987cba40cca25cd4ee7e491f177f0f522 --- /dev/null +++ b/netbox/client/dcim/dcim_platforms_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" +) + +// DcimPlatformsUpdateReader is a Reader for the DcimPlatformsUpdate structure. +type DcimPlatformsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPlatformsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPlatformsUpdateOK() + 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()) + } +} + +// NewDcimPlatformsUpdateOK creates a DcimPlatformsUpdateOK with default headers values +func NewDcimPlatformsUpdateOK() *DcimPlatformsUpdateOK { + return &DcimPlatformsUpdateOK{} +} + +/*DcimPlatformsUpdateOK handles this case with default header values. + +DcimPlatformsUpdateOK dcim platforms update o k +*/ +type DcimPlatformsUpdateOK struct { + Payload *models.Platform +} + +func (o *DcimPlatformsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/platforms/{id}/][%d] dcimPlatformsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPlatformsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Platform) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_connections_list_parameters.go b/netbox/client/dcim/dcim_power_connections_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9ef9eb2a15b250694ab38998fb6bc9914f54947c --- /dev/null +++ b/netbox/client/dcim/dcim_power_connections_list_parameters.go @@ -0,0 +1,297 @@ +// 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" +) + +// NewDcimPowerConnectionsListParams creates a new DcimPowerConnectionsListParams object +// with the default values initialized. +func NewDcimPowerConnectionsListParams() *DcimPowerConnectionsListParams { + var () + return &DcimPowerConnectionsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerConnectionsListParamsWithTimeout creates a new DcimPowerConnectionsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerConnectionsListParamsWithTimeout(timeout time.Duration) *DcimPowerConnectionsListParams { + var () + return &DcimPowerConnectionsListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerConnectionsListParamsWithContext creates a new DcimPowerConnectionsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerConnectionsListParamsWithContext(ctx context.Context) *DcimPowerConnectionsListParams { + var () + return &DcimPowerConnectionsListParams{ + + Context: ctx, + } +} + +// NewDcimPowerConnectionsListParamsWithHTTPClient creates a new DcimPowerConnectionsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerConnectionsListParamsWithHTTPClient(client *http.Client) *DcimPowerConnectionsListParams { + var () + return &DcimPowerConnectionsListParams{ + HTTPClient: client, + } +} + +/*DcimPowerConnectionsListParams contains all the parameters to send to the API endpoint +for the dcim power connections list operation typically these are written to a http.Request +*/ +type DcimPowerConnectionsListParams struct { + + /*ConnectionStatus*/ + ConnectionStatus *string + /*Device*/ + Device *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithTimeout(timeout time.Duration) *DcimPowerConnectionsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithContext(ctx context.Context) *DcimPowerConnectionsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithHTTPClient(client *http.Client) *DcimPowerConnectionsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithConnectionStatus adds the connectionStatus to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithConnectionStatus(connectionStatus *string) *DcimPowerConnectionsListParams { + o.SetConnectionStatus(connectionStatus) + return o +} + +// SetConnectionStatus adds the connectionStatus to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetConnectionStatus(connectionStatus *string) { + o.ConnectionStatus = connectionStatus +} + +// WithDevice adds the device to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithDevice(device *string) *DcimPowerConnectionsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithLimit adds the limit to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithLimit(limit *int64) *DcimPowerConnectionsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithName(name *string) *DcimPowerConnectionsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithOffset(offset *int64) *DcimPowerConnectionsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) WithSite(site *string) *DcimPowerConnectionsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim power connections list params +func (o *DcimPowerConnectionsListParams) SetSite(site *string) { + o.Site = site +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerConnectionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ConnectionStatus != nil { + + // query param connection_status + var qrConnectionStatus string + if o.ConnectionStatus != nil { + qrConnectionStatus = *o.ConnectionStatus + } + qConnectionStatus := qrConnectionStatus + if qConnectionStatus != "" { + if err := r.SetQueryParam("connection_status", qConnectionStatus); err != nil { + return err + } + } + + } + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_connections_list_responses.go b/netbox/client/dcim/dcim_power_connections_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..620fb437b08e3b1fafc4315d44db2d47b51327af --- /dev/null +++ b/netbox/client/dcim/dcim_power_connections_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" +) + +// DcimPowerConnectionsListReader is a Reader for the DcimPowerConnectionsList structure. +type DcimPowerConnectionsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerConnectionsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerConnectionsListOK() + 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()) + } +} + +// NewDcimPowerConnectionsListOK creates a DcimPowerConnectionsListOK with default headers values +func NewDcimPowerConnectionsListOK() *DcimPowerConnectionsListOK { + return &DcimPowerConnectionsListOK{} +} + +/*DcimPowerConnectionsListOK handles this case with default header values. + +DcimPowerConnectionsListOK dcim power connections list o k +*/ +type DcimPowerConnectionsListOK struct { + Payload *models.DcimPowerConnectionsListOKBody +} + +func (o *DcimPowerConnectionsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-connections/][%d] dcimPowerConnectionsListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerConnectionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerConnectionsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8b55ef443a24f882581fd879e84df92f984b8feb --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// NewDcimPowerOutletTemplatesCreateParams creates a new DcimPowerOutletTemplatesCreateParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesCreateParams() *DcimPowerOutletTemplatesCreateParams { + var () + return &DcimPowerOutletTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesCreateParamsWithTimeout creates a new DcimPowerOutletTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesCreateParams { + var () + return &DcimPowerOutletTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesCreateParamsWithContext creates a new DcimPowerOutletTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesCreateParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesCreateParams { + var () + return &DcimPowerOutletTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesCreateParamsWithHTTPClient creates a new DcimPowerOutletTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesCreateParams { + var () + return &DcimPowerOutletTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates create operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritablePowerOutletTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) WithData(data *models.WritablePowerOutletTemplate) *DcimPowerOutletTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlet templates create params +func (o *DcimPowerOutletTemplatesCreateParams) SetData(data *models.WritablePowerOutletTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2a26749e99adda1569c1410f2c9726ec372cb75d --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// DcimPowerOutletTemplatesCreateReader is a Reader for the DcimPowerOutletTemplatesCreate structure. +type DcimPowerOutletTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerOutletTemplatesCreateCreated() + 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()) + } +} + +// NewDcimPowerOutletTemplatesCreateCreated creates a DcimPowerOutletTemplatesCreateCreated with default headers values +func NewDcimPowerOutletTemplatesCreateCreated() *DcimPowerOutletTemplatesCreateCreated { + return &DcimPowerOutletTemplatesCreateCreated{} +} + +/*DcimPowerOutletTemplatesCreateCreated handles this case with default header values. + +DcimPowerOutletTemplatesCreateCreated dcim power outlet templates create created +*/ +type DcimPowerOutletTemplatesCreateCreated struct { + Payload *models.WritablePowerOutletTemplate +} + +func (o *DcimPowerOutletTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-outlet-templates/][%d] dcimPowerOutletTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerOutletTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutletTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..afc3feba96295ba8b6b2821def39f5e495c9348b --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// NewDcimPowerOutletTemplatesDeleteParams creates a new DcimPowerOutletTemplatesDeleteParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesDeleteParams() *DcimPowerOutletTemplatesDeleteParams { + var () + return &DcimPowerOutletTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesDeleteParamsWithTimeout creates a new DcimPowerOutletTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesDeleteParams { + var () + return &DcimPowerOutletTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesDeleteParamsWithContext creates a new DcimPowerOutletTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesDeleteParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesDeleteParams { + var () + return &DcimPowerOutletTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesDeleteParamsWithHTTPClient creates a new DcimPowerOutletTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesDeleteParams { + var () + return &DcimPowerOutletTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates delete operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this power outlet template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) WithID(id int64) *DcimPowerOutletTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates delete params +func (o *DcimPowerOutletTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_delete_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cdabdd030390dd0dee99e7d4a33223c802019595 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// DcimPowerOutletTemplatesDeleteReader is a Reader for the DcimPowerOutletTemplatesDelete structure. +type DcimPowerOutletTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerOutletTemplatesDeleteNoContent() + 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()) + } +} + +// NewDcimPowerOutletTemplatesDeleteNoContent creates a DcimPowerOutletTemplatesDeleteNoContent with default headers values +func NewDcimPowerOutletTemplatesDeleteNoContent() *DcimPowerOutletTemplatesDeleteNoContent { + return &DcimPowerOutletTemplatesDeleteNoContent{} +} + +/*DcimPowerOutletTemplatesDeleteNoContent handles this case with default header values. + +DcimPowerOutletTemplatesDeleteNoContent dcim power outlet templates delete no content +*/ +type DcimPowerOutletTemplatesDeleteNoContent struct { +} + +func (o *DcimPowerOutletTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-outlet-templates/{id}/][%d] dcimPowerOutletTemplatesDeleteNoContent ", 204) +} + +func (o *DcimPowerOutletTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f3514e79f78376262006c9c3512db6928f609b4f --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_list_parameters.go @@ -0,0 +1,239 @@ +// 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" +) + +// NewDcimPowerOutletTemplatesListParams creates a new DcimPowerOutletTemplatesListParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesListParams() *DcimPowerOutletTemplatesListParams { + var () + return &DcimPowerOutletTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesListParamsWithTimeout creates a new DcimPowerOutletTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesListParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesListParams { + var () + return &DcimPowerOutletTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesListParamsWithContext creates a new DcimPowerOutletTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesListParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesListParams { + var () + return &DcimPowerOutletTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesListParamsWithHTTPClient creates a new DcimPowerOutletTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesListParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesListParams { + var () + return &DcimPowerOutletTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates list operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimPowerOutletTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithLimit(limit *int64) *DcimPowerOutletTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithName(name *string) *DcimPowerOutletTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) WithOffset(offset *int64) *DcimPowerOutletTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power outlet templates list params +func (o *DcimPowerOutletTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..51738f9a18b444f20ec80167c22781aae8307f9e --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// DcimPowerOutletTemplatesListReader is a Reader for the DcimPowerOutletTemplatesList structure. +type DcimPowerOutletTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletTemplatesListOK() + 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()) + } +} + +// NewDcimPowerOutletTemplatesListOK creates a DcimPowerOutletTemplatesListOK with default headers values +func NewDcimPowerOutletTemplatesListOK() *DcimPowerOutletTemplatesListOK { + return &DcimPowerOutletTemplatesListOK{} +} + +/*DcimPowerOutletTemplatesListOK handles this case with default header values. + +DcimPowerOutletTemplatesListOK dcim power outlet templates list o k +*/ +type DcimPowerOutletTemplatesListOK struct { + Payload *models.DcimPowerOutletTemplatesListOKBody +} + +func (o *DcimPowerOutletTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlet-templates/][%d] dcimPowerOutletTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerOutletTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ce798d66a7d284a7f54afadbdc5f1c132b5cda6d --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// NewDcimPowerOutletTemplatesPartialUpdateParams creates a new DcimPowerOutletTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesPartialUpdateParams() *DcimPowerOutletTemplatesPartialUpdateParams { + var () + return &DcimPowerOutletTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesPartialUpdateParamsWithTimeout creates a new DcimPowerOutletTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesPartialUpdateParams { + var () + return &DcimPowerOutletTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesPartialUpdateParamsWithContext creates a new DcimPowerOutletTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesPartialUpdateParams { + var () + return &DcimPowerOutletTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimPowerOutletTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesPartialUpdateParams { + var () + return &DcimPowerOutletTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates partial update operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerOutletTemplate + /*ID + A unique integer value identifying this power outlet template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithData(data *models.WritablePowerOutletTemplate) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetData(data *models.WritablePowerOutletTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithID(id int64) *DcimPowerOutletTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates partial update params +func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5fdda82718e70c5775e673a6f353f2e664dba206 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// DcimPowerOutletTemplatesPartialUpdateReader is a Reader for the DcimPowerOutletTemplatesPartialUpdate structure. +type DcimPowerOutletTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletTemplatesPartialUpdateOK() + 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()) + } +} + +// NewDcimPowerOutletTemplatesPartialUpdateOK creates a DcimPowerOutletTemplatesPartialUpdateOK with default headers values +func NewDcimPowerOutletTemplatesPartialUpdateOK() *DcimPowerOutletTemplatesPartialUpdateOK { + return &DcimPowerOutletTemplatesPartialUpdateOK{} +} + +/*DcimPowerOutletTemplatesPartialUpdateOK handles this case with default header values. + +DcimPowerOutletTemplatesPartialUpdateOK dcim power outlet templates partial update o k +*/ +type DcimPowerOutletTemplatesPartialUpdateOK struct { + Payload *models.WritablePowerOutletTemplate +} + +func (o *DcimPowerOutletTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-outlet-templates/{id}/][%d] dcimPowerOutletTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutletTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8fc1d083245ae81070d9c3b5d307903b44773bf1 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// NewDcimPowerOutletTemplatesReadParams creates a new DcimPowerOutletTemplatesReadParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesReadParams() *DcimPowerOutletTemplatesReadParams { + var () + return &DcimPowerOutletTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesReadParamsWithTimeout creates a new DcimPowerOutletTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesReadParams { + var () + return &DcimPowerOutletTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesReadParamsWithContext creates a new DcimPowerOutletTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesReadParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesReadParams { + var () + return &DcimPowerOutletTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesReadParamsWithHTTPClient creates a new DcimPowerOutletTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesReadParams { + var () + return &DcimPowerOutletTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates read operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesReadParams struct { + + /*ID + A unique integer value identifying this power outlet template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) WithID(id int64) *DcimPowerOutletTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates read params +func (o *DcimPowerOutletTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a4b14cee0b0e2aa86a04f87bf00cabddd3e98152 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// DcimPowerOutletTemplatesReadReader is a Reader for the DcimPowerOutletTemplatesRead structure. +type DcimPowerOutletTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletTemplatesReadOK() + 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()) + } +} + +// NewDcimPowerOutletTemplatesReadOK creates a DcimPowerOutletTemplatesReadOK with default headers values +func NewDcimPowerOutletTemplatesReadOK() *DcimPowerOutletTemplatesReadOK { + return &DcimPowerOutletTemplatesReadOK{} +} + +/*DcimPowerOutletTemplatesReadOK handles this case with default header values. + +DcimPowerOutletTemplatesReadOK dcim power outlet templates read o k +*/ +type DcimPowerOutletTemplatesReadOK struct { + Payload *models.PowerOutletTemplate +} + +func (o *DcimPowerOutletTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlet-templates/{id}/][%d] dcimPowerOutletTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerOutletTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go b/netbox/client/dcim/dcim_power_outlet_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a96891ea92a19580b95b3a4626ba663d1a77be80 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// NewDcimPowerOutletTemplatesUpdateParams creates a new DcimPowerOutletTemplatesUpdateParams object +// with the default values initialized. +func NewDcimPowerOutletTemplatesUpdateParams() *DcimPowerOutletTemplatesUpdateParams { + var () + return &DcimPowerOutletTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletTemplatesUpdateParamsWithTimeout creates a new DcimPowerOutletTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesUpdateParams { + var () + return &DcimPowerOutletTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletTemplatesUpdateParamsWithContext creates a new DcimPowerOutletTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletTemplatesUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesUpdateParams { + var () + return &DcimPowerOutletTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletTemplatesUpdateParamsWithHTTPClient creates a new DcimPowerOutletTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesUpdateParams { + var () + return &DcimPowerOutletTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim power outlet templates update operation typically these are written to a http.Request +*/ +type DcimPowerOutletTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerOutletTemplate + /*ID + A unique integer value identifying this power outlet template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithData(data *models.WritablePowerOutletTemplate) *DcimPowerOutletTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetData(data *models.WritablePowerOutletTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) WithID(id int64) *DcimPowerOutletTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlet templates update params +func (o *DcimPowerOutletTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletTemplatesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go b/netbox/client/dcim/dcim_power_outlet_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..480850ddfb1c55ae830b15dced2c7a4242ab7259 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlet_templates_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" +) + +// DcimPowerOutletTemplatesUpdateReader is a Reader for the DcimPowerOutletTemplatesUpdate structure. +type DcimPowerOutletTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletTemplatesUpdateOK() + 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()) + } +} + +// NewDcimPowerOutletTemplatesUpdateOK creates a DcimPowerOutletTemplatesUpdateOK with default headers values +func NewDcimPowerOutletTemplatesUpdateOK() *DcimPowerOutletTemplatesUpdateOK { + return &DcimPowerOutletTemplatesUpdateOK{} +} + +/*DcimPowerOutletTemplatesUpdateOK handles this case with default header values. + +DcimPowerOutletTemplatesUpdateOK dcim power outlet templates update o k +*/ +type DcimPowerOutletTemplatesUpdateOK struct { + Payload *models.WritablePowerOutletTemplate +} + +func (o *DcimPowerOutletTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-outlet-templates/{id}/][%d] dcimPowerOutletTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutletTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_create_parameters.go b/netbox/client/dcim/dcim_power_outlets_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0237c5516331054432d0bb550db7f1c2e35cf692 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// NewDcimPowerOutletsCreateParams creates a new DcimPowerOutletsCreateParams object +// with the default values initialized. +func NewDcimPowerOutletsCreateParams() *DcimPowerOutletsCreateParams { + var () + return &DcimPowerOutletsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsCreateParamsWithTimeout creates a new DcimPowerOutletsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsCreateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsCreateParams { + var () + return &DcimPowerOutletsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsCreateParamsWithContext creates a new DcimPowerOutletsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsCreateParamsWithContext(ctx context.Context) *DcimPowerOutletsCreateParams { + var () + return &DcimPowerOutletsCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsCreateParamsWithHTTPClient creates a new DcimPowerOutletsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsCreateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsCreateParams { + var () + return &DcimPowerOutletsCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsCreateParams contains all the parameters to send to the API endpoint +for the dcim power outlets create operation typically these are written to a http.Request +*/ +type DcimPowerOutletsCreateParams struct { + + /*Data*/ + Data *models.WritablePowerOutlet + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) WithContext(ctx context.Context) *DcimPowerOutletsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) WithData(data *models.WritablePowerOutlet) *DcimPowerOutletsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlets create params +func (o *DcimPowerOutletsCreateParams) SetData(data *models.WritablePowerOutlet) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_create_responses.go b/netbox/client/dcim/dcim_power_outlets_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c811c5cd00e70a75d740ece80fefa78c6ba421fd --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// DcimPowerOutletsCreateReader is a Reader for the DcimPowerOutletsCreate structure. +type DcimPowerOutletsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerOutletsCreateCreated() + 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()) + } +} + +// NewDcimPowerOutletsCreateCreated creates a DcimPowerOutletsCreateCreated with default headers values +func NewDcimPowerOutletsCreateCreated() *DcimPowerOutletsCreateCreated { + return &DcimPowerOutletsCreateCreated{} +} + +/*DcimPowerOutletsCreateCreated handles this case with default header values. + +DcimPowerOutletsCreateCreated dcim power outlets create created +*/ +type DcimPowerOutletsCreateCreated struct { + Payload *models.WritablePowerOutlet +} + +func (o *DcimPowerOutletsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-outlets/][%d] dcimPowerOutletsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerOutletsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_delete_parameters.go b/netbox/client/dcim/dcim_power_outlets_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..79599875561c7f1aa7593a870d3a9fcd25636770 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// NewDcimPowerOutletsDeleteParams creates a new DcimPowerOutletsDeleteParams object +// with the default values initialized. +func NewDcimPowerOutletsDeleteParams() *DcimPowerOutletsDeleteParams { + var () + return &DcimPowerOutletsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsDeleteParamsWithTimeout creates a new DcimPowerOutletsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsDeleteParams { + var () + return &DcimPowerOutletsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsDeleteParamsWithContext creates a new DcimPowerOutletsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsDeleteParamsWithContext(ctx context.Context) *DcimPowerOutletsDeleteParams { + var () + return &DcimPowerOutletsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsDeleteParamsWithHTTPClient creates a new DcimPowerOutletsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsDeleteParams { + var () + return &DcimPowerOutletsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsDeleteParams contains all the parameters to send to the API endpoint +for the dcim power outlets delete operation typically these are written to a http.Request +*/ +type DcimPowerOutletsDeleteParams struct { + + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) WithContext(ctx context.Context) *DcimPowerOutletsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) WithID(id int64) *DcimPowerOutletsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets delete params +func (o *DcimPowerOutletsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_delete_responses.go b/netbox/client/dcim/dcim_power_outlets_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4f267e56d64796676b7dbc44cbf503afc4d7c7e0 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// DcimPowerOutletsDeleteReader is a Reader for the DcimPowerOutletsDelete structure. +type DcimPowerOutletsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerOutletsDeleteNoContent() + 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()) + } +} + +// NewDcimPowerOutletsDeleteNoContent creates a DcimPowerOutletsDeleteNoContent with default headers values +func NewDcimPowerOutletsDeleteNoContent() *DcimPowerOutletsDeleteNoContent { + return &DcimPowerOutletsDeleteNoContent{} +} + +/*DcimPowerOutletsDeleteNoContent handles this case with default header values. + +DcimPowerOutletsDeleteNoContent dcim power outlets delete no content +*/ +type DcimPowerOutletsDeleteNoContent struct { +} + +func (o *DcimPowerOutletsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-outlets/{id}/][%d] dcimPowerOutletsDeleteNoContent ", 204) +} + +func (o *DcimPowerOutletsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_list_parameters.go b/netbox/client/dcim/dcim_power_outlets_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3643d0e07fbfa259e901227e1e5e93fd7cf466bc --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_list_parameters.go @@ -0,0 +1,268 @@ +// 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" +) + +// NewDcimPowerOutletsListParams creates a new DcimPowerOutletsListParams object +// with the default values initialized. +func NewDcimPowerOutletsListParams() *DcimPowerOutletsListParams { + var () + return &DcimPowerOutletsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsListParamsWithTimeout creates a new DcimPowerOutletsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsListParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsListParams { + var () + return &DcimPowerOutletsListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsListParamsWithContext creates a new DcimPowerOutletsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsListParamsWithContext(ctx context.Context) *DcimPowerOutletsListParams { + var () + return &DcimPowerOutletsListParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsListParamsWithHTTPClient creates a new DcimPowerOutletsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsListParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsListParams { + var () + return &DcimPowerOutletsListParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsListParams contains all the parameters to send to the API endpoint +for the dcim power outlets list operation typically these are written to a http.Request +*/ +type DcimPowerOutletsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithContext(ctx context.Context) *DcimPowerOutletsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithDevice(device *string) *DcimPowerOutletsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithDeviceID(deviceID *string) *DcimPowerOutletsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithLimit(limit *int64) *DcimPowerOutletsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithName(name *string) *DcimPowerOutletsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) WithOffset(offset *int64) *DcimPowerOutletsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power outlets list params +func (o *DcimPowerOutletsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_list_responses.go b/netbox/client/dcim/dcim_power_outlets_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..dc401297da55f95e11184f38af3068f9a785d7b1 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// DcimPowerOutletsListReader is a Reader for the DcimPowerOutletsList structure. +type DcimPowerOutletsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsListOK() + 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()) + } +} + +// NewDcimPowerOutletsListOK creates a DcimPowerOutletsListOK with default headers values +func NewDcimPowerOutletsListOK() *DcimPowerOutletsListOK { + return &DcimPowerOutletsListOK{} +} + +/*DcimPowerOutletsListOK handles this case with default header values. + +DcimPowerOutletsListOK dcim power outlets list o k +*/ +type DcimPowerOutletsListOK struct { + Payload *models.DcimPowerOutletsListOKBody +} + +func (o *DcimPowerOutletsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlets/][%d] dcimPowerOutletsListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerOutletsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go b/netbox/client/dcim/dcim_power_outlets_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f9a16ca8e842d3faf2522386b06f5e9eb2273280 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// NewDcimPowerOutletsPartialUpdateParams creates a new DcimPowerOutletsPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerOutletsPartialUpdateParams() *DcimPowerOutletsPartialUpdateParams { + var () + return &DcimPowerOutletsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsPartialUpdateParamsWithTimeout creates a new DcimPowerOutletsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsPartialUpdateParams { + var () + return &DcimPowerOutletsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsPartialUpdateParamsWithContext creates a new DcimPowerOutletsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletsPartialUpdateParams { + var () + return &DcimPowerOutletsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsPartialUpdateParamsWithHTTPClient creates a new DcimPowerOutletsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsPartialUpdateParams { + var () + return &DcimPowerOutletsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power outlets partial update operation typically these are written to a http.Request +*/ +type DcimPowerOutletsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerOutlet + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithData(data *models.WritablePowerOutlet) *DcimPowerOutletsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetData(data *models.WritablePowerOutlet) { + o.Data = data +} + +// WithID adds the id to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) WithID(id int64) *DcimPowerOutletsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets partial update params +func (o *DcimPowerOutletsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go b/netbox/client/dcim/dcim_power_outlets_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..74575f316bd5c4fbacebc3c3af3ccfbb704b110d --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// DcimPowerOutletsPartialUpdateReader is a Reader for the DcimPowerOutletsPartialUpdate structure. +type DcimPowerOutletsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsPartialUpdateOK() + 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()) + } +} + +// NewDcimPowerOutletsPartialUpdateOK creates a DcimPowerOutletsPartialUpdateOK with default headers values +func NewDcimPowerOutletsPartialUpdateOK() *DcimPowerOutletsPartialUpdateOK { + return &DcimPowerOutletsPartialUpdateOK{} +} + +/*DcimPowerOutletsPartialUpdateOK handles this case with default header values. + +DcimPowerOutletsPartialUpdateOK dcim power outlets partial update o k +*/ +type DcimPowerOutletsPartialUpdateOK struct { + Payload *models.WritablePowerOutlet +} + +func (o *DcimPowerOutletsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-outlets/{id}/][%d] dcimPowerOutletsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_read_parameters.go b/netbox/client/dcim/dcim_power_outlets_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..baa7f3b9a57d8c03b36f3e8cf276138ea219f3ae --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// NewDcimPowerOutletsReadParams creates a new DcimPowerOutletsReadParams object +// with the default values initialized. +func NewDcimPowerOutletsReadParams() *DcimPowerOutletsReadParams { + var () + return &DcimPowerOutletsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsReadParamsWithTimeout creates a new DcimPowerOutletsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsReadParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsReadParams { + var () + return &DcimPowerOutletsReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsReadParamsWithContext creates a new DcimPowerOutletsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsReadParamsWithContext(ctx context.Context) *DcimPowerOutletsReadParams { + var () + return &DcimPowerOutletsReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsReadParamsWithHTTPClient creates a new DcimPowerOutletsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsReadParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsReadParams { + var () + return &DcimPowerOutletsReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsReadParams contains all the parameters to send to the API endpoint +for the dcim power outlets read operation typically these are written to a http.Request +*/ +type DcimPowerOutletsReadParams struct { + + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) WithContext(ctx context.Context) *DcimPowerOutletsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) WithID(id int64) *DcimPowerOutletsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets read params +func (o *DcimPowerOutletsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_read_responses.go b/netbox/client/dcim/dcim_power_outlets_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..71476e27c42a2b1baf5db93fabef496cdecb858f --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// DcimPowerOutletsReadReader is a Reader for the DcimPowerOutletsRead structure. +type DcimPowerOutletsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsReadOK() + 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()) + } +} + +// NewDcimPowerOutletsReadOK creates a DcimPowerOutletsReadOK with default headers values +func NewDcimPowerOutletsReadOK() *DcimPowerOutletsReadOK { + return &DcimPowerOutletsReadOK{} +} + +/*DcimPowerOutletsReadOK handles this case with default header values. + +DcimPowerOutletsReadOK dcim power outlets read o k +*/ +type DcimPowerOutletsReadOK struct { + Payload *models.PowerOutlet +} + +func (o *DcimPowerOutletsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-outlets/{id}/][%d] dcimPowerOutletsReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_update_parameters.go b/netbox/client/dcim/dcim_power_outlets_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8e4ef0c8035607a2c4b7ea72b5fa8e847ec72d62 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// NewDcimPowerOutletsUpdateParams creates a new DcimPowerOutletsUpdateParams object +// with the default values initialized. +func NewDcimPowerOutletsUpdateParams() *DcimPowerOutletsUpdateParams { + var () + return &DcimPowerOutletsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerOutletsUpdateParamsWithTimeout creates a new DcimPowerOutletsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerOutletsUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletsUpdateParams { + var () + return &DcimPowerOutletsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerOutletsUpdateParamsWithContext creates a new DcimPowerOutletsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerOutletsUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletsUpdateParams { + var () + return &DcimPowerOutletsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerOutletsUpdateParamsWithHTTPClient creates a new DcimPowerOutletsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerOutletsUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletsUpdateParams { + var () + return &DcimPowerOutletsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerOutletsUpdateParams contains all the parameters to send to the API endpoint +for the dcim power outlets update operation typically these are written to a http.Request +*/ +type DcimPowerOutletsUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerOutlet + /*ID + A unique integer value identifying this power outlet. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithData(data *models.WritablePowerOutlet) *DcimPowerOutletsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetData(data *models.WritablePowerOutlet) { + o.Data = data +} + +// WithID adds the id to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) WithID(id int64) *DcimPowerOutletsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power outlets update params +func (o *DcimPowerOutletsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerOutletsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_outlets_update_responses.go b/netbox/client/dcim/dcim_power_outlets_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d0cf326c311abc672aac72d2e447a3671218ee84 --- /dev/null +++ b/netbox/client/dcim/dcim_power_outlets_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" +) + +// DcimPowerOutletsUpdateReader is a Reader for the DcimPowerOutletsUpdate structure. +type DcimPowerOutletsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerOutletsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerOutletsUpdateOK() + 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()) + } +} + +// NewDcimPowerOutletsUpdateOK creates a DcimPowerOutletsUpdateOK with default headers values +func NewDcimPowerOutletsUpdateOK() *DcimPowerOutletsUpdateOK { + return &DcimPowerOutletsUpdateOK{} +} + +/*DcimPowerOutletsUpdateOK handles this case with default header values. + +DcimPowerOutletsUpdateOK dcim power outlets update o k +*/ +type DcimPowerOutletsUpdateOK struct { + Payload *models.WritablePowerOutlet +} + +func (o *DcimPowerOutletsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-outlets/{id}/][%d] dcimPowerOutletsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerOutletsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerOutlet) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_create_parameters.go b/netbox/client/dcim/dcim_power_port_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8580557672c9faa71292490c32edc37369092e1b --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// NewDcimPowerPortTemplatesCreateParams creates a new DcimPowerPortTemplatesCreateParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesCreateParams() *DcimPowerPortTemplatesCreateParams { + var () + return &DcimPowerPortTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesCreateParamsWithTimeout creates a new DcimPowerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesCreateParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesCreateParams { + var () + return &DcimPowerPortTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesCreateParamsWithContext creates a new DcimPowerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesCreateParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesCreateParams { + var () + return &DcimPowerPortTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesCreateParamsWithHTTPClient creates a new DcimPowerPortTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesCreateParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesCreateParams { + var () + return &DcimPowerPortTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesCreateParams contains all the parameters to send to the API endpoint +for the dcim power port templates create operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesCreateParams struct { + + /*Data*/ + Data *models.WritablePowerPortTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) WithData(data *models.WritablePowerPortTemplate) *DcimPowerPortTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power port templates create params +func (o *DcimPowerPortTemplatesCreateParams) SetData(data *models.WritablePowerPortTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_create_responses.go b/netbox/client/dcim/dcim_power_port_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7cbe7cd071b3ea5ad4322de3511c40796f83222d --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// DcimPowerPortTemplatesCreateReader is a Reader for the DcimPowerPortTemplatesCreate structure. +type DcimPowerPortTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerPortTemplatesCreateCreated() + 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()) + } +} + +// NewDcimPowerPortTemplatesCreateCreated creates a DcimPowerPortTemplatesCreateCreated with default headers values +func NewDcimPowerPortTemplatesCreateCreated() *DcimPowerPortTemplatesCreateCreated { + return &DcimPowerPortTemplatesCreateCreated{} +} + +/*DcimPowerPortTemplatesCreateCreated handles this case with default header values. + +DcimPowerPortTemplatesCreateCreated dcim power port templates create created +*/ +type DcimPowerPortTemplatesCreateCreated struct { + Payload *models.WritablePowerPortTemplate +} + +func (o *DcimPowerPortTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-port-templates/][%d] dcimPowerPortTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerPortTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go b/netbox/client/dcim/dcim_power_port_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..76c0fcc4243b908227cc8d7a5ed06f622c5259dc --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// NewDcimPowerPortTemplatesDeleteParams creates a new DcimPowerPortTemplatesDeleteParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesDeleteParams() *DcimPowerPortTemplatesDeleteParams { + var () + return &DcimPowerPortTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesDeleteParamsWithTimeout creates a new DcimPowerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesDeleteParams { + var () + return &DcimPowerPortTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesDeleteParamsWithContext creates a new DcimPowerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesDeleteParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesDeleteParams { + var () + return &DcimPowerPortTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesDeleteParamsWithHTTPClient creates a new DcimPowerPortTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesDeleteParams { + var () + return &DcimPowerPortTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the dcim power port templates delete operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this power port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) WithID(id int64) *DcimPowerPortTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates delete params +func (o *DcimPowerPortTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_delete_responses.go b/netbox/client/dcim/dcim_power_port_templates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8e0c12396f863afe6c4aa4f46a29722f41aea4d9 --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// DcimPowerPortTemplatesDeleteReader is a Reader for the DcimPowerPortTemplatesDelete structure. +type DcimPowerPortTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerPortTemplatesDeleteNoContent() + 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()) + } +} + +// NewDcimPowerPortTemplatesDeleteNoContent creates a DcimPowerPortTemplatesDeleteNoContent with default headers values +func NewDcimPowerPortTemplatesDeleteNoContent() *DcimPowerPortTemplatesDeleteNoContent { + return &DcimPowerPortTemplatesDeleteNoContent{} +} + +/*DcimPowerPortTemplatesDeleteNoContent handles this case with default header values. + +DcimPowerPortTemplatesDeleteNoContent dcim power port templates delete no content +*/ +type DcimPowerPortTemplatesDeleteNoContent struct { +} + +func (o *DcimPowerPortTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-port-templates/{id}/][%d] dcimPowerPortTemplatesDeleteNoContent ", 204) +} + +func (o *DcimPowerPortTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_list_parameters.go b/netbox/client/dcim/dcim_power_port_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..edaf7b123714e1b29b1bbda6fbc64d421b1369f8 --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_list_parameters.go @@ -0,0 +1,239 @@ +// 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" +) + +// NewDcimPowerPortTemplatesListParams creates a new DcimPowerPortTemplatesListParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesListParams() *DcimPowerPortTemplatesListParams { + var () + return &DcimPowerPortTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesListParamsWithTimeout creates a new DcimPowerPortTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesListParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesListParams { + var () + return &DcimPowerPortTemplatesListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesListParamsWithContext creates a new DcimPowerPortTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesListParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesListParams { + var () + return &DcimPowerPortTemplatesListParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesListParamsWithHTTPClient creates a new DcimPowerPortTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesListParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesListParams { + var () + return &DcimPowerPortTemplatesListParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesListParams contains all the parameters to send to the API endpoint +for the dcim power port templates list operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesListParams struct { + + /*DevicetypeID*/ + DevicetypeID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevicetypeID adds the devicetypeID to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithDevicetypeID(devicetypeID *string) *DcimPowerPortTemplatesListParams { + o.SetDevicetypeID(devicetypeID) + return o +} + +// SetDevicetypeID adds the devicetypeId to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetDevicetypeID(devicetypeID *string) { + o.DevicetypeID = devicetypeID +} + +// WithLimit adds the limit to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithLimit(limit *int64) *DcimPowerPortTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithName(name *string) *DcimPowerPortTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) WithOffset(offset *int64) *DcimPowerPortTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power port templates list params +func (o *DcimPowerPortTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DevicetypeID != nil { + + // query param devicetype_id + var qrDevicetypeID string + if o.DevicetypeID != nil { + qrDevicetypeID = *o.DevicetypeID + } + qDevicetypeID := qrDevicetypeID + if qDevicetypeID != "" { + if err := r.SetQueryParam("devicetype_id", qDevicetypeID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_list_responses.go b/netbox/client/dcim/dcim_power_port_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fa4c58290663d868f5d447dd6ff9047c18f56a05 --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// DcimPowerPortTemplatesListReader is a Reader for the DcimPowerPortTemplatesList structure. +type DcimPowerPortTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortTemplatesListOK() + 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()) + } +} + +// NewDcimPowerPortTemplatesListOK creates a DcimPowerPortTemplatesListOK with default headers values +func NewDcimPowerPortTemplatesListOK() *DcimPowerPortTemplatesListOK { + return &DcimPowerPortTemplatesListOK{} +} + +/*DcimPowerPortTemplatesListOK handles this case with default header values. + +DcimPowerPortTemplatesListOK dcim power port templates list o k +*/ +type DcimPowerPortTemplatesListOK struct { + Payload *models.DcimPowerPortTemplatesListOKBody +} + +func (o *DcimPowerPortTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-port-templates/][%d] dcimPowerPortTemplatesListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerPortTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go b/netbox/client/dcim/dcim_power_port_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..971d80a60114eccd55b56a62308f2972fb1a37e3 --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// NewDcimPowerPortTemplatesPartialUpdateParams creates a new DcimPowerPortTemplatesPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesPartialUpdateParams() *DcimPowerPortTemplatesPartialUpdateParams { + var () + return &DcimPowerPortTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesPartialUpdateParamsWithTimeout creates a new DcimPowerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesPartialUpdateParams { + var () + return &DcimPowerPortTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesPartialUpdateParamsWithContext creates a new DcimPowerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesPartialUpdateParams { + var () + return &DcimPowerPortTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimPowerPortTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesPartialUpdateParams { + var () + return &DcimPowerPortTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power port templates partial update operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPortTemplate + /*ID + A unique integer value identifying this power port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithData(data *models.WritablePowerPortTemplate) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetData(data *models.WritablePowerPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) WithID(id int64) *DcimPowerPortTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates partial update params +func (o *DcimPowerPortTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go b/netbox/client/dcim/dcim_power_port_templates_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..16aa54112ec584873a29416dcb32e73b82c42c73 --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// DcimPowerPortTemplatesPartialUpdateReader is a Reader for the DcimPowerPortTemplatesPartialUpdate structure. +type DcimPowerPortTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortTemplatesPartialUpdateOK() + 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()) + } +} + +// NewDcimPowerPortTemplatesPartialUpdateOK creates a DcimPowerPortTemplatesPartialUpdateOK with default headers values +func NewDcimPowerPortTemplatesPartialUpdateOK() *DcimPowerPortTemplatesPartialUpdateOK { + return &DcimPowerPortTemplatesPartialUpdateOK{} +} + +/*DcimPowerPortTemplatesPartialUpdateOK handles this case with default header values. + +DcimPowerPortTemplatesPartialUpdateOK dcim power port templates partial update o k +*/ +type DcimPowerPortTemplatesPartialUpdateOK struct { + Payload *models.WritablePowerPortTemplate +} + +func (o *DcimPowerPortTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-port-templates/{id}/][%d] dcimPowerPortTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_read_parameters.go b/netbox/client/dcim/dcim_power_port_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..beebeadfe900d36add69d6e466ad422d16d4938f --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// NewDcimPowerPortTemplatesReadParams creates a new DcimPowerPortTemplatesReadParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesReadParams() *DcimPowerPortTemplatesReadParams { + var () + return &DcimPowerPortTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesReadParamsWithTimeout creates a new DcimPowerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesReadParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesReadParams { + var () + return &DcimPowerPortTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesReadParamsWithContext creates a new DcimPowerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesReadParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesReadParams { + var () + return &DcimPowerPortTemplatesReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesReadParamsWithHTTPClient creates a new DcimPowerPortTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesReadParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesReadParams { + var () + return &DcimPowerPortTemplatesReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesReadParams contains all the parameters to send to the API endpoint +for the dcim power port templates read operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesReadParams struct { + + /*ID + A unique integer value identifying this power port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) WithID(id int64) *DcimPowerPortTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates read params +func (o *DcimPowerPortTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_read_responses.go b/netbox/client/dcim/dcim_power_port_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a3770283214475e28093a89ecb54af8c55952a25 --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// DcimPowerPortTemplatesReadReader is a Reader for the DcimPowerPortTemplatesRead structure. +type DcimPowerPortTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortTemplatesReadOK() + 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()) + } +} + +// NewDcimPowerPortTemplatesReadOK creates a DcimPowerPortTemplatesReadOK with default headers values +func NewDcimPowerPortTemplatesReadOK() *DcimPowerPortTemplatesReadOK { + return &DcimPowerPortTemplatesReadOK{} +} + +/*DcimPowerPortTemplatesReadOK handles this case with default header values. + +DcimPowerPortTemplatesReadOK dcim power port templates read o k +*/ +type DcimPowerPortTemplatesReadOK struct { + Payload *models.PowerPortTemplate +} + +func (o *DcimPowerPortTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-port-templates/{id}/][%d] dcimPowerPortTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_update_parameters.go b/netbox/client/dcim/dcim_power_port_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..27b4f24b7dd38faf38f4dd903556dee21d17654f --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// NewDcimPowerPortTemplatesUpdateParams creates a new DcimPowerPortTemplatesUpdateParams object +// with the default values initialized. +func NewDcimPowerPortTemplatesUpdateParams() *DcimPowerPortTemplatesUpdateParams { + var () + return &DcimPowerPortTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortTemplatesUpdateParamsWithTimeout creates a new DcimPowerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortTemplatesUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPortTemplatesUpdateParams { + var () + return &DcimPowerPortTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortTemplatesUpdateParamsWithContext creates a new DcimPowerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortTemplatesUpdateParamsWithContext(ctx context.Context) *DcimPowerPortTemplatesUpdateParams { + var () + return &DcimPowerPortTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortTemplatesUpdateParamsWithHTTPClient creates a new DcimPowerPortTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortTemplatesUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPortTemplatesUpdateParams { + var () + return &DcimPowerPortTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the dcim power port templates update operation typically these are written to a http.Request +*/ +type DcimPowerPortTemplatesUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPortTemplate + /*ID + A unique integer value identifying this power port template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPortTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithContext(ctx context.Context) *DcimPowerPortTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPortTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithData(data *models.WritablePowerPortTemplate) *DcimPowerPortTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetData(data *models.WritablePowerPortTemplate) { + o.Data = data +} + +// WithID adds the id to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) WithID(id int64) *DcimPowerPortTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power port templates update params +func (o *DcimPowerPortTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortTemplatesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_port_templates_update_responses.go b/netbox/client/dcim/dcim_power_port_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..97ab0ee03836ff8cb09f76b3027d04693c40744b --- /dev/null +++ b/netbox/client/dcim/dcim_power_port_templates_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" +) + +// DcimPowerPortTemplatesUpdateReader is a Reader for the DcimPowerPortTemplatesUpdate structure. +type DcimPowerPortTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortTemplatesUpdateOK() + 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()) + } +} + +// NewDcimPowerPortTemplatesUpdateOK creates a DcimPowerPortTemplatesUpdateOK with default headers values +func NewDcimPowerPortTemplatesUpdateOK() *DcimPowerPortTemplatesUpdateOK { + return &DcimPowerPortTemplatesUpdateOK{} +} + +/*DcimPowerPortTemplatesUpdateOK handles this case with default header values. + +DcimPowerPortTemplatesUpdateOK dcim power port templates update o k +*/ +type DcimPowerPortTemplatesUpdateOK struct { + Payload *models.WritablePowerPortTemplate +} + +func (o *DcimPowerPortTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-port-templates/{id}/][%d] dcimPowerPortTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPortTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_create_parameters.go b/netbox/client/dcim/dcim_power_ports_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..eeea3222e6aefa081e1bcc45a1c39285bf6dacbf --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// NewDcimPowerPortsCreateParams creates a new DcimPowerPortsCreateParams object +// with the default values initialized. +func NewDcimPowerPortsCreateParams() *DcimPowerPortsCreateParams { + var () + return &DcimPowerPortsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsCreateParamsWithTimeout creates a new DcimPowerPortsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsCreateParamsWithTimeout(timeout time.Duration) *DcimPowerPortsCreateParams { + var () + return &DcimPowerPortsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsCreateParamsWithContext creates a new DcimPowerPortsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsCreateParamsWithContext(ctx context.Context) *DcimPowerPortsCreateParams { + var () + return &DcimPowerPortsCreateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsCreateParamsWithHTTPClient creates a new DcimPowerPortsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsCreateParamsWithHTTPClient(client *http.Client) *DcimPowerPortsCreateParams { + var () + return &DcimPowerPortsCreateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsCreateParams contains all the parameters to send to the API endpoint +for the dcim power ports create operation typically these are written to a http.Request +*/ +type DcimPowerPortsCreateParams struct { + + /*Data*/ + Data *models.WritablePowerPort + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) WithTimeout(timeout time.Duration) *DcimPowerPortsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) WithContext(ctx context.Context) *DcimPowerPortsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) WithHTTPClient(client *http.Client) *DcimPowerPortsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) WithData(data *models.WritablePowerPort) *DcimPowerPortsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power ports create params +func (o *DcimPowerPortsCreateParams) SetData(data *models.WritablePowerPort) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_create_responses.go b/netbox/client/dcim/dcim_power_ports_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d3083ab7a7a53c790f2324d950e43f93930f1107 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// DcimPowerPortsCreateReader is a Reader for the DcimPowerPortsCreate structure. +type DcimPowerPortsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimPowerPortsCreateCreated() + 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()) + } +} + +// NewDcimPowerPortsCreateCreated creates a DcimPowerPortsCreateCreated with default headers values +func NewDcimPowerPortsCreateCreated() *DcimPowerPortsCreateCreated { + return &DcimPowerPortsCreateCreated{} +} + +/*DcimPowerPortsCreateCreated handles this case with default header values. + +DcimPowerPortsCreateCreated dcim power ports create created +*/ +type DcimPowerPortsCreateCreated struct { + Payload *models.WritablePowerPort +} + +func (o *DcimPowerPortsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/power-ports/][%d] dcimPowerPortsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimPowerPortsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_delete_parameters.go b/netbox/client/dcim/dcim_power_ports_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..03b065a79bedf871bd09a607a6de140133a6f774 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// NewDcimPowerPortsDeleteParams creates a new DcimPowerPortsDeleteParams object +// with the default values initialized. +func NewDcimPowerPortsDeleteParams() *DcimPowerPortsDeleteParams { + var () + return &DcimPowerPortsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsDeleteParamsWithTimeout creates a new DcimPowerPortsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsDeleteParamsWithTimeout(timeout time.Duration) *DcimPowerPortsDeleteParams { + var () + return &DcimPowerPortsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsDeleteParamsWithContext creates a new DcimPowerPortsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsDeleteParamsWithContext(ctx context.Context) *DcimPowerPortsDeleteParams { + var () + return &DcimPowerPortsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsDeleteParamsWithHTTPClient creates a new DcimPowerPortsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsDeleteParamsWithHTTPClient(client *http.Client) *DcimPowerPortsDeleteParams { + var () + return &DcimPowerPortsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsDeleteParams contains all the parameters to send to the API endpoint +for the dcim power ports delete operation typically these are written to a http.Request +*/ +type DcimPowerPortsDeleteParams struct { + + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) WithTimeout(timeout time.Duration) *DcimPowerPortsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) WithContext(ctx context.Context) *DcimPowerPortsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) WithHTTPClient(client *http.Client) *DcimPowerPortsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) WithID(id int64) *DcimPowerPortsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports delete params +func (o *DcimPowerPortsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_delete_responses.go b/netbox/client/dcim/dcim_power_ports_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9b4e06c95138b11f1d0522064eaf5de3566872b3 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// DcimPowerPortsDeleteReader is a Reader for the DcimPowerPortsDelete structure. +type DcimPowerPortsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimPowerPortsDeleteNoContent() + 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()) + } +} + +// NewDcimPowerPortsDeleteNoContent creates a DcimPowerPortsDeleteNoContent with default headers values +func NewDcimPowerPortsDeleteNoContent() *DcimPowerPortsDeleteNoContent { + return &DcimPowerPortsDeleteNoContent{} +} + +/*DcimPowerPortsDeleteNoContent handles this case with default header values. + +DcimPowerPortsDeleteNoContent dcim power ports delete no content +*/ +type DcimPowerPortsDeleteNoContent struct { +} + +func (o *DcimPowerPortsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/power-ports/{id}/][%d] dcimPowerPortsDeleteNoContent ", 204) +} + +func (o *DcimPowerPortsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_list_parameters.go b/netbox/client/dcim/dcim_power_ports_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0ad2de9519d6c9822621310a02c8a700296d8d82 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_list_parameters.go @@ -0,0 +1,268 @@ +// 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" +) + +// NewDcimPowerPortsListParams creates a new DcimPowerPortsListParams object +// with the default values initialized. +func NewDcimPowerPortsListParams() *DcimPowerPortsListParams { + var () + return &DcimPowerPortsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsListParamsWithTimeout creates a new DcimPowerPortsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsListParamsWithTimeout(timeout time.Duration) *DcimPowerPortsListParams { + var () + return &DcimPowerPortsListParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsListParamsWithContext creates a new DcimPowerPortsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsListParamsWithContext(ctx context.Context) *DcimPowerPortsListParams { + var () + return &DcimPowerPortsListParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsListParamsWithHTTPClient creates a new DcimPowerPortsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsListParamsWithHTTPClient(client *http.Client) *DcimPowerPortsListParams { + var () + return &DcimPowerPortsListParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsListParams contains all the parameters to send to the API endpoint +for the dcim power ports list operation typically these are written to a http.Request +*/ +type DcimPowerPortsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithTimeout(timeout time.Duration) *DcimPowerPortsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithContext(ctx context.Context) *DcimPowerPortsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithHTTPClient(client *http.Client) *DcimPowerPortsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithDevice(device *string) *DcimPowerPortsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithDeviceID(deviceID *string) *DcimPowerPortsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithLimit(limit *int64) *DcimPowerPortsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithName(name *string) *DcimPowerPortsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim power ports list params +func (o *DcimPowerPortsListParams) WithOffset(offset *int64) *DcimPowerPortsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim power ports list params +func (o *DcimPowerPortsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_list_responses.go b/netbox/client/dcim/dcim_power_ports_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c800096c910a87dd4935fa8e6b3c513f87a3d598 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// DcimPowerPortsListReader is a Reader for the DcimPowerPortsList structure. +type DcimPowerPortsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsListOK() + 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()) + } +} + +// NewDcimPowerPortsListOK creates a DcimPowerPortsListOK with default headers values +func NewDcimPowerPortsListOK() *DcimPowerPortsListOK { + return &DcimPowerPortsListOK{} +} + +/*DcimPowerPortsListOK handles this case with default header values. + +DcimPowerPortsListOK dcim power ports list o k +*/ +type DcimPowerPortsListOK struct { + Payload *models.DcimPowerPortsListOKBody +} + +func (o *DcimPowerPortsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-ports/][%d] dcimPowerPortsListOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimPowerPortsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go b/netbox/client/dcim/dcim_power_ports_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..59e96afad9c1698b8cab2d5ceb38c0c7047eea50 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// NewDcimPowerPortsPartialUpdateParams creates a new DcimPowerPortsPartialUpdateParams object +// with the default values initialized. +func NewDcimPowerPortsPartialUpdateParams() *DcimPowerPortsPartialUpdateParams { + var () + return &DcimPowerPortsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsPartialUpdateParamsWithTimeout creates a new DcimPowerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPortsPartialUpdateParams { + var () + return &DcimPowerPortsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsPartialUpdateParamsWithContext creates a new DcimPowerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerPortsPartialUpdateParams { + var () + return &DcimPowerPortsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsPartialUpdateParamsWithHTTPClient creates a new DcimPowerPortsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPortsPartialUpdateParams { + var () + return &DcimPowerPortsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim power ports partial update operation typically these are written to a http.Request +*/ +type DcimPowerPortsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPort + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPortsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerPortsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPortsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithData(data *models.WritablePowerPort) *DcimPowerPortsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetData(data *models.WritablePowerPort) { + o.Data = data +} + +// WithID adds the id to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) WithID(id int64) *DcimPowerPortsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports partial update params +func (o *DcimPowerPortsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_partial_update_responses.go b/netbox/client/dcim/dcim_power_ports_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a9dca2865658d53b890e387ad981f7e34cd32327 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// DcimPowerPortsPartialUpdateReader is a Reader for the DcimPowerPortsPartialUpdate structure. +type DcimPowerPortsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsPartialUpdateOK() + 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()) + } +} + +// NewDcimPowerPortsPartialUpdateOK creates a DcimPowerPortsPartialUpdateOK with default headers values +func NewDcimPowerPortsPartialUpdateOK() *DcimPowerPortsPartialUpdateOK { + return &DcimPowerPortsPartialUpdateOK{} +} + +/*DcimPowerPortsPartialUpdateOK handles this case with default header values. + +DcimPowerPortsPartialUpdateOK dcim power ports partial update o k +*/ +type DcimPowerPortsPartialUpdateOK struct { + Payload *models.WritablePowerPort +} + +func (o *DcimPowerPortsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/power-ports/{id}/][%d] dcimPowerPortsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_read_parameters.go b/netbox/client/dcim/dcim_power_ports_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b0943682f58df5567b78445c0e87ab2bf3c7c8d6 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// NewDcimPowerPortsReadParams creates a new DcimPowerPortsReadParams object +// with the default values initialized. +func NewDcimPowerPortsReadParams() *DcimPowerPortsReadParams { + var () + return &DcimPowerPortsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsReadParamsWithTimeout creates a new DcimPowerPortsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsReadParamsWithTimeout(timeout time.Duration) *DcimPowerPortsReadParams { + var () + return &DcimPowerPortsReadParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsReadParamsWithContext creates a new DcimPowerPortsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsReadParamsWithContext(ctx context.Context) *DcimPowerPortsReadParams { + var () + return &DcimPowerPortsReadParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsReadParamsWithHTTPClient creates a new DcimPowerPortsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsReadParamsWithHTTPClient(client *http.Client) *DcimPowerPortsReadParams { + var () + return &DcimPowerPortsReadParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsReadParams contains all the parameters to send to the API endpoint +for the dcim power ports read operation typically these are written to a http.Request +*/ +type DcimPowerPortsReadParams struct { + + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports read params +func (o *DcimPowerPortsReadParams) WithTimeout(timeout time.Duration) *DcimPowerPortsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports read params +func (o *DcimPowerPortsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports read params +func (o *DcimPowerPortsReadParams) WithContext(ctx context.Context) *DcimPowerPortsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports read params +func (o *DcimPowerPortsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports read params +func (o *DcimPowerPortsReadParams) WithHTTPClient(client *http.Client) *DcimPowerPortsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports read params +func (o *DcimPowerPortsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim power ports read params +func (o *DcimPowerPortsReadParams) WithID(id int64) *DcimPowerPortsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports read params +func (o *DcimPowerPortsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_read_responses.go b/netbox/client/dcim/dcim_power_ports_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bb82e66f0bc12712b7080a8a72a62fc98c16cf19 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// DcimPowerPortsReadReader is a Reader for the DcimPowerPortsRead structure. +type DcimPowerPortsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsReadOK() + 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()) + } +} + +// NewDcimPowerPortsReadOK creates a DcimPowerPortsReadOK with default headers values +func NewDcimPowerPortsReadOK() *DcimPowerPortsReadOK { + return &DcimPowerPortsReadOK{} +} + +/*DcimPowerPortsReadOK handles this case with default header values. + +DcimPowerPortsReadOK dcim power ports read o k +*/ +type DcimPowerPortsReadOK struct { + Payload *models.PowerPort +} + +func (o *DcimPowerPortsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/power-ports/{id}/][%d] dcimPowerPortsReadOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.PowerPort) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_update_parameters.go b/netbox/client/dcim/dcim_power_ports_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a29b17ce7c53c5b674ee797f23c69342b43011d9 --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// NewDcimPowerPortsUpdateParams creates a new DcimPowerPortsUpdateParams object +// with the default values initialized. +func NewDcimPowerPortsUpdateParams() *DcimPowerPortsUpdateParams { + var () + return &DcimPowerPortsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimPowerPortsUpdateParamsWithTimeout creates a new DcimPowerPortsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimPowerPortsUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerPortsUpdateParams { + var () + return &DcimPowerPortsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimPowerPortsUpdateParamsWithContext creates a new DcimPowerPortsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimPowerPortsUpdateParamsWithContext(ctx context.Context) *DcimPowerPortsUpdateParams { + var () + return &DcimPowerPortsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimPowerPortsUpdateParamsWithHTTPClient creates a new DcimPowerPortsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimPowerPortsUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerPortsUpdateParams { + var () + return &DcimPowerPortsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimPowerPortsUpdateParams contains all the parameters to send to the API endpoint +for the dcim power ports update operation typically these are written to a http.Request +*/ +type DcimPowerPortsUpdateParams struct { + + /*Data*/ + Data *models.WritablePowerPort + /*ID + A unique integer value identifying this power port. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerPortsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithContext(ctx context.Context) *DcimPowerPortsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerPortsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithData(data *models.WritablePowerPort) *DcimPowerPortsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetData(data *models.WritablePowerPort) { + o.Data = data +} + +// WithID adds the id to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) WithID(id int64) *DcimPowerPortsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim power ports update params +func (o *DcimPowerPortsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimPowerPortsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_power_ports_update_responses.go b/netbox/client/dcim/dcim_power_ports_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a2d84137001f5d21c1f9c83a228c8110e454dbdb --- /dev/null +++ b/netbox/client/dcim/dcim_power_ports_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" +) + +// DcimPowerPortsUpdateReader is a Reader for the DcimPowerPortsUpdate structure. +type DcimPowerPortsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimPowerPortsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimPowerPortsUpdateOK() + 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()) + } +} + +// NewDcimPowerPortsUpdateOK creates a DcimPowerPortsUpdateOK with default headers values +func NewDcimPowerPortsUpdateOK() *DcimPowerPortsUpdateOK { + return &DcimPowerPortsUpdateOK{} +} + +/*DcimPowerPortsUpdateOK handles this case with default header values. + +DcimPowerPortsUpdateOK dcim power ports update o k +*/ +type DcimPowerPortsUpdateOK struct { + Payload *models.WritablePowerPort +} + +func (o *DcimPowerPortsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/power-ports/{id}/][%d] dcimPowerPortsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimPowerPortsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePowerPort) + + // 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_rack_groups_create_parameters.go b/netbox/client/dcim/dcim_rack_groups_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c2e615895371d3d973c7e95f897d9c368a816ab6 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// NewDcimRackGroupsCreateParams creates a new DcimRackGroupsCreateParams object +// with the default values initialized. +func NewDcimRackGroupsCreateParams() *DcimRackGroupsCreateParams { + var () + return &DcimRackGroupsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsCreateParamsWithTimeout creates a new DcimRackGroupsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsCreateParamsWithTimeout(timeout time.Duration) *DcimRackGroupsCreateParams { + var () + return &DcimRackGroupsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsCreateParamsWithContext creates a new DcimRackGroupsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsCreateParamsWithContext(ctx context.Context) *DcimRackGroupsCreateParams { + var () + return &DcimRackGroupsCreateParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsCreateParamsWithHTTPClient creates a new DcimRackGroupsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsCreateParamsWithHTTPClient(client *http.Client) *DcimRackGroupsCreateParams { + var () + return &DcimRackGroupsCreateParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsCreateParams contains all the parameters to send to the API endpoint +for the dcim rack groups create operation typically these are written to a http.Request +*/ +type DcimRackGroupsCreateParams struct { + + /*Data*/ + Data *models.WritableRackGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) WithTimeout(timeout time.Duration) *DcimRackGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) WithContext(ctx context.Context) *DcimRackGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) WithHTTPClient(client *http.Client) *DcimRackGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) WithData(data *models.WritableRackGroup) *DcimRackGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack groups create params +func (o *DcimRackGroupsCreateParams) SetData(data *models.WritableRackGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsCreateParams) 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_rack_groups_create_responses.go b/netbox/client/dcim/dcim_rack_groups_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a22f0b87e73e73c8ca341c6f9394077b854cd59d --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// DcimRackGroupsCreateReader is a Reader for the DcimRackGroupsCreate structure. +type DcimRackGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRackGroupsCreateCreated() + 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()) + } +} + +// NewDcimRackGroupsCreateCreated creates a DcimRackGroupsCreateCreated with default headers values +func NewDcimRackGroupsCreateCreated() *DcimRackGroupsCreateCreated { + return &DcimRackGroupsCreateCreated{} +} + +/*DcimRackGroupsCreateCreated handles this case with default header values. + +DcimRackGroupsCreateCreated dcim rack groups create created +*/ +type DcimRackGroupsCreateCreated struct { + Payload *models.WritableRackGroup +} + +func (o *DcimRackGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/rack-groups/][%d] dcimRackGroupsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRackGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackGroup) + + // 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_rack_groups_delete_parameters.go b/netbox/client/dcim/dcim_rack_groups_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..532d707faa021b2d6f0943a02bb8be9e8885b8e8 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// NewDcimRackGroupsDeleteParams creates a new DcimRackGroupsDeleteParams object +// with the default values initialized. +func NewDcimRackGroupsDeleteParams() *DcimRackGroupsDeleteParams { + var () + return &DcimRackGroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsDeleteParamsWithTimeout creates a new DcimRackGroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsDeleteParamsWithTimeout(timeout time.Duration) *DcimRackGroupsDeleteParams { + var () + return &DcimRackGroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsDeleteParamsWithContext creates a new DcimRackGroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsDeleteParamsWithContext(ctx context.Context) *DcimRackGroupsDeleteParams { + var () + return &DcimRackGroupsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsDeleteParamsWithHTTPClient creates a new DcimRackGroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsDeleteParamsWithHTTPClient(client *http.Client) *DcimRackGroupsDeleteParams { + var () + return &DcimRackGroupsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsDeleteParams contains all the parameters to send to the API endpoint +for the dcim rack groups delete operation typically these are written to a http.Request +*/ +type DcimRackGroupsDeleteParams struct { + + /*ID + A unique integer value identifying this rack group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) WithTimeout(timeout time.Duration) *DcimRackGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) WithContext(ctx context.Context) *DcimRackGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) WithHTTPClient(client *http.Client) *DcimRackGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) WithID(id int64) *DcimRackGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups delete params +func (o *DcimRackGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsDeleteParams) 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_rack_groups_delete_responses.go b/netbox/client/dcim/dcim_rack_groups_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0080941bf20d4ff7f6b4d3746d7a1c92ac5c49fd --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// DcimRackGroupsDeleteReader is a Reader for the DcimRackGroupsDelete structure. +type DcimRackGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRackGroupsDeleteNoContent() + 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()) + } +} + +// NewDcimRackGroupsDeleteNoContent creates a DcimRackGroupsDeleteNoContent with default headers values +func NewDcimRackGroupsDeleteNoContent() *DcimRackGroupsDeleteNoContent { + return &DcimRackGroupsDeleteNoContent{} +} + +/*DcimRackGroupsDeleteNoContent handles this case with default header values. + +DcimRackGroupsDeleteNoContent dcim rack groups delete no content +*/ +type DcimRackGroupsDeleteNoContent struct { +} + +func (o *DcimRackGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/rack-groups/{id}/][%d] dcimRackGroupsDeleteNoContent ", 204) +} + +func (o *DcimRackGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_rack_groups_list_parameters.go b/netbox/client/dcim/dcim_rack_groups_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..490145068586e91e24ee01538fe6edc7e7f62b2f --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_list_parameters.go @@ -0,0 +1,297 @@ +// 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" +) + +// NewDcimRackGroupsListParams creates a new DcimRackGroupsListParams object +// with the default values initialized. +func NewDcimRackGroupsListParams() *DcimRackGroupsListParams { + var () + return &DcimRackGroupsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsListParamsWithTimeout creates a new DcimRackGroupsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsListParamsWithTimeout(timeout time.Duration) *DcimRackGroupsListParams { + var () + return &DcimRackGroupsListParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsListParamsWithContext creates a new DcimRackGroupsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsListParamsWithContext(ctx context.Context) *DcimRackGroupsListParams { + var () + return &DcimRackGroupsListParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsListParamsWithHTTPClient creates a new DcimRackGroupsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsListParamsWithHTTPClient(client *http.Client) *DcimRackGroupsListParams { + var () + return &DcimRackGroupsListParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsListParams contains all the parameters to send to the API endpoint +for the dcim rack groups list operation typically these are written to a http.Request +*/ +type DcimRackGroupsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithTimeout(timeout time.Duration) *DcimRackGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithContext(ctx context.Context) *DcimRackGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithHTTPClient(client *http.Client) *DcimRackGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithLimit(limit *int64) *DcimRackGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithName(name *string) *DcimRackGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithOffset(offset *int64) *DcimRackGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithSite(site *string) *DcimRackGroupsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithSiteID(siteID *string) *DcimRackGroupsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSlug adds the slug to the dcim rack groups list params +func (o *DcimRackGroupsListParams) WithSlug(slug *string) *DcimRackGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim rack groups list params +func (o *DcimRackGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rack_groups_list_responses.go b/netbox/client/dcim/dcim_rack_groups_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f1901a30014a9ef5d12d2a912ab336aa2333cf03 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// DcimRackGroupsListReader is a Reader for the DcimRackGroupsList structure. +type DcimRackGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackGroupsListOK() + 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()) + } +} + +// NewDcimRackGroupsListOK creates a DcimRackGroupsListOK with default headers values +func NewDcimRackGroupsListOK() *DcimRackGroupsListOK { + return &DcimRackGroupsListOK{} +} + +/*DcimRackGroupsListOK handles this case with default header values. + +DcimRackGroupsListOK dcim rack groups list o k +*/ +type DcimRackGroupsListOK struct { + Payload *models.DcimRackGroupsListOKBody +} + +func (o *DcimRackGroupsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-groups/][%d] dcimRackGroupsListOK %+v", 200, o.Payload) +} + +func (o *DcimRackGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRackGroupsListOKBody) + + // 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_rack_groups_partial_update_parameters.go b/netbox/client/dcim/dcim_rack_groups_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3375918fab47b32226ce459029ecb093b0d56487 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// NewDcimRackGroupsPartialUpdateParams creates a new DcimRackGroupsPartialUpdateParams object +// with the default values initialized. +func NewDcimRackGroupsPartialUpdateParams() *DcimRackGroupsPartialUpdateParams { + var () + return &DcimRackGroupsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsPartialUpdateParamsWithTimeout creates a new DcimRackGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRackGroupsPartialUpdateParams { + var () + return &DcimRackGroupsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsPartialUpdateParamsWithContext creates a new DcimRackGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsPartialUpdateParamsWithContext(ctx context.Context) *DcimRackGroupsPartialUpdateParams { + var () + return &DcimRackGroupsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsPartialUpdateParamsWithHTTPClient creates a new DcimRackGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRackGroupsPartialUpdateParams { + var () + return &DcimRackGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack groups partial update operation typically these are written to a http.Request +*/ +type DcimRackGroupsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRackGroup + /*ID + A unique integer value identifying this rack group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRackGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithContext(ctx context.Context) *DcimRackGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRackGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithData(data *models.WritableRackGroup) *DcimRackGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetData(data *models.WritableRackGroup) { + o.Data = data +} + +// WithID adds the id to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) WithID(id int64) *DcimRackGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups partial update params +func (o *DcimRackGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsPartialUpdateParams) 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_rack_groups_partial_update_responses.go b/netbox/client/dcim/dcim_rack_groups_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7db0a71a2066ce9c18cbc3dde11c4db49fbedb2d --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// DcimRackGroupsPartialUpdateReader is a Reader for the DcimRackGroupsPartialUpdate structure. +type DcimRackGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackGroupsPartialUpdateOK() + 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()) + } +} + +// NewDcimRackGroupsPartialUpdateOK creates a DcimRackGroupsPartialUpdateOK with default headers values +func NewDcimRackGroupsPartialUpdateOK() *DcimRackGroupsPartialUpdateOK { + return &DcimRackGroupsPartialUpdateOK{} +} + +/*DcimRackGroupsPartialUpdateOK handles this case with default header values. + +DcimRackGroupsPartialUpdateOK dcim rack groups partial update o k +*/ +type DcimRackGroupsPartialUpdateOK struct { + Payload *models.WritableRackGroup +} + +func (o *DcimRackGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/rack-groups/{id}/][%d] dcimRackGroupsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackGroup) + + // 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_rack_groups_read_parameters.go b/netbox/client/dcim/dcim_rack_groups_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..949ff668597b6048a02da306a4fdd5989ed53b3a --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// NewDcimRackGroupsReadParams creates a new DcimRackGroupsReadParams object +// with the default values initialized. +func NewDcimRackGroupsReadParams() *DcimRackGroupsReadParams { + var () + return &DcimRackGroupsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsReadParamsWithTimeout creates a new DcimRackGroupsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsReadParamsWithTimeout(timeout time.Duration) *DcimRackGroupsReadParams { + var () + return &DcimRackGroupsReadParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsReadParamsWithContext creates a new DcimRackGroupsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsReadParamsWithContext(ctx context.Context) *DcimRackGroupsReadParams { + var () + return &DcimRackGroupsReadParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsReadParamsWithHTTPClient creates a new DcimRackGroupsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsReadParamsWithHTTPClient(client *http.Client) *DcimRackGroupsReadParams { + var () + return &DcimRackGroupsReadParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsReadParams contains all the parameters to send to the API endpoint +for the dcim rack groups read operation typically these are written to a http.Request +*/ +type DcimRackGroupsReadParams struct { + + /*ID + A unique integer value identifying this rack group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) WithTimeout(timeout time.Duration) *DcimRackGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) WithContext(ctx context.Context) *DcimRackGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) WithHTTPClient(client *http.Client) *DcimRackGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) WithID(id int64) *DcimRackGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups read params +func (o *DcimRackGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsReadParams) 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_rack_groups_read_responses.go b/netbox/client/dcim/dcim_rack_groups_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e991ab1ca5cf7d1394d2c2968afb6f6e4492747b --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// DcimRackGroupsReadReader is a Reader for the DcimRackGroupsRead structure. +type DcimRackGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackGroupsReadOK() + 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()) + } +} + +// NewDcimRackGroupsReadOK creates a DcimRackGroupsReadOK with default headers values +func NewDcimRackGroupsReadOK() *DcimRackGroupsReadOK { + return &DcimRackGroupsReadOK{} +} + +/*DcimRackGroupsReadOK handles this case with default header values. + +DcimRackGroupsReadOK dcim rack groups read o k +*/ +type DcimRackGroupsReadOK struct { + Payload *models.RackGroup +} + +func (o *DcimRackGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-groups/{id}/][%d] dcimRackGroupsReadOK %+v", 200, o.Payload) +} + +func (o *DcimRackGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackGroup) + + // 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_rack_groups_update_parameters.go b/netbox/client/dcim/dcim_rack_groups_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..797976875f0e6dff023f4707a3d8e59e35b57500 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// NewDcimRackGroupsUpdateParams creates a new DcimRackGroupsUpdateParams object +// with the default values initialized. +func NewDcimRackGroupsUpdateParams() *DcimRackGroupsUpdateParams { + var () + return &DcimRackGroupsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackGroupsUpdateParamsWithTimeout creates a new DcimRackGroupsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackGroupsUpdateParamsWithTimeout(timeout time.Duration) *DcimRackGroupsUpdateParams { + var () + return &DcimRackGroupsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackGroupsUpdateParamsWithContext creates a new DcimRackGroupsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackGroupsUpdateParamsWithContext(ctx context.Context) *DcimRackGroupsUpdateParams { + var () + return &DcimRackGroupsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackGroupsUpdateParamsWithHTTPClient creates a new DcimRackGroupsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackGroupsUpdateParamsWithHTTPClient(client *http.Client) *DcimRackGroupsUpdateParams { + var () + return &DcimRackGroupsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackGroupsUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack groups update operation typically these are written to a http.Request +*/ +type DcimRackGroupsUpdateParams struct { + + /*Data*/ + Data *models.WritableRackGroup + /*ID + A unique integer value identifying this rack group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithTimeout(timeout time.Duration) *DcimRackGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithContext(ctx context.Context) *DcimRackGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithHTTPClient(client *http.Client) *DcimRackGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithData(data *models.WritableRackGroup) *DcimRackGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetData(data *models.WritableRackGroup) { + o.Data = data +} + +// WithID adds the id to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) WithID(id int64) *DcimRackGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack groups update params +func (o *DcimRackGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackGroupsUpdateParams) 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_rack_groups_update_responses.go b/netbox/client/dcim/dcim_rack_groups_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8dfa9f8c642dd86bd3937a54b0bef7615d301555 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_groups_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" +) + +// DcimRackGroupsUpdateReader is a Reader for the DcimRackGroupsUpdate structure. +type DcimRackGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackGroupsUpdateOK() + 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()) + } +} + +// NewDcimRackGroupsUpdateOK creates a DcimRackGroupsUpdateOK with default headers values +func NewDcimRackGroupsUpdateOK() *DcimRackGroupsUpdateOK { + return &DcimRackGroupsUpdateOK{} +} + +/*DcimRackGroupsUpdateOK handles this case with default header values. + +DcimRackGroupsUpdateOK dcim rack groups update o k +*/ +type DcimRackGroupsUpdateOK struct { + Payload *models.WritableRackGroup +} + +func (o *DcimRackGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/rack-groups/{id}/][%d] dcimRackGroupsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackGroup) + + // 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_rack_reservations_create_parameters.go b/netbox/client/dcim/dcim_rack_reservations_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..04024b5d14e5d161c91e09fed5c93de51278c087 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// NewDcimRackReservationsCreateParams creates a new DcimRackReservationsCreateParams object +// with the default values initialized. +func NewDcimRackReservationsCreateParams() *DcimRackReservationsCreateParams { + var () + return &DcimRackReservationsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsCreateParamsWithTimeout creates a new DcimRackReservationsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsCreateParamsWithTimeout(timeout time.Duration) *DcimRackReservationsCreateParams { + var () + return &DcimRackReservationsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsCreateParamsWithContext creates a new DcimRackReservationsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsCreateParamsWithContext(ctx context.Context) *DcimRackReservationsCreateParams { + var () + return &DcimRackReservationsCreateParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsCreateParamsWithHTTPClient creates a new DcimRackReservationsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsCreateParamsWithHTTPClient(client *http.Client) *DcimRackReservationsCreateParams { + var () + return &DcimRackReservationsCreateParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsCreateParams contains all the parameters to send to the API endpoint +for the dcim rack reservations create operation typically these are written to a http.Request +*/ +type DcimRackReservationsCreateParams struct { + + /*Data*/ + Data *models.WritableRackReservation + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) WithTimeout(timeout time.Duration) *DcimRackReservationsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) WithContext(ctx context.Context) *DcimRackReservationsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) WithHTTPClient(client *http.Client) *DcimRackReservationsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) WithData(data *models.WritableRackReservation) *DcimRackReservationsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack reservations create params +func (o *DcimRackReservationsCreateParams) SetData(data *models.WritableRackReservation) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsCreateParams) 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_rack_reservations_create_responses.go b/netbox/client/dcim/dcim_rack_reservations_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e3c40fdde7bbef89f52043a668491c81320e8abf --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// DcimRackReservationsCreateReader is a Reader for the DcimRackReservationsCreate structure. +type DcimRackReservationsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRackReservationsCreateCreated() + 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()) + } +} + +// NewDcimRackReservationsCreateCreated creates a DcimRackReservationsCreateCreated with default headers values +func NewDcimRackReservationsCreateCreated() *DcimRackReservationsCreateCreated { + return &DcimRackReservationsCreateCreated{} +} + +/*DcimRackReservationsCreateCreated handles this case with default header values. + +DcimRackReservationsCreateCreated dcim rack reservations create created +*/ +type DcimRackReservationsCreateCreated struct { + Payload *models.WritableRackReservation +} + +func (o *DcimRackReservationsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/rack-reservations/][%d] dcimRackReservationsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRackReservationsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackReservation) + + // 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_rack_reservations_delete_parameters.go b/netbox/client/dcim/dcim_rack_reservations_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0b272ec0f9cd5a28f98f9a7dbdaf0b5dc2f6287a --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// NewDcimRackReservationsDeleteParams creates a new DcimRackReservationsDeleteParams object +// with the default values initialized. +func NewDcimRackReservationsDeleteParams() *DcimRackReservationsDeleteParams { + var () + return &DcimRackReservationsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsDeleteParamsWithTimeout creates a new DcimRackReservationsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsDeleteParamsWithTimeout(timeout time.Duration) *DcimRackReservationsDeleteParams { + var () + return &DcimRackReservationsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsDeleteParamsWithContext creates a new DcimRackReservationsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsDeleteParamsWithContext(ctx context.Context) *DcimRackReservationsDeleteParams { + var () + return &DcimRackReservationsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsDeleteParamsWithHTTPClient creates a new DcimRackReservationsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsDeleteParamsWithHTTPClient(client *http.Client) *DcimRackReservationsDeleteParams { + var () + return &DcimRackReservationsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsDeleteParams contains all the parameters to send to the API endpoint +for the dcim rack reservations delete operation typically these are written to a http.Request +*/ +type DcimRackReservationsDeleteParams struct { + + /*ID + A unique integer value identifying this rack reservation. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) WithTimeout(timeout time.Duration) *DcimRackReservationsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) WithContext(ctx context.Context) *DcimRackReservationsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) WithHTTPClient(client *http.Client) *DcimRackReservationsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) WithID(id int64) *DcimRackReservationsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack reservations delete params +func (o *DcimRackReservationsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsDeleteParams) 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_rack_reservations_delete_responses.go b/netbox/client/dcim/dcim_rack_reservations_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..43aa099cc321d142970be81459f7202fb73de0ab --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// DcimRackReservationsDeleteReader is a Reader for the DcimRackReservationsDelete structure. +type DcimRackReservationsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRackReservationsDeleteNoContent() + 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()) + } +} + +// NewDcimRackReservationsDeleteNoContent creates a DcimRackReservationsDeleteNoContent with default headers values +func NewDcimRackReservationsDeleteNoContent() *DcimRackReservationsDeleteNoContent { + return &DcimRackReservationsDeleteNoContent{} +} + +/*DcimRackReservationsDeleteNoContent handles this case with default header values. + +DcimRackReservationsDeleteNoContent dcim rack reservations delete no content +*/ +type DcimRackReservationsDeleteNoContent struct { +} + +func (o *DcimRackReservationsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/rack-reservations/{id}/][%d] dcimRackReservationsDeleteNoContent ", 204) +} + +func (o *DcimRackReservationsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_rack_reservations_list_parameters.go b/netbox/client/dcim/dcim_rack_reservations_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9aaa112cd81993f271744c340f7613a1523c0306 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_list_parameters.go @@ -0,0 +1,474 @@ +// 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" +) + +// NewDcimRackReservationsListParams creates a new DcimRackReservationsListParams object +// with the default values initialized. +func NewDcimRackReservationsListParams() *DcimRackReservationsListParams { + var () + return &DcimRackReservationsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsListParamsWithTimeout creates a new DcimRackReservationsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsListParamsWithTimeout(timeout time.Duration) *DcimRackReservationsListParams { + var () + return &DcimRackReservationsListParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsListParamsWithContext creates a new DcimRackReservationsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsListParamsWithContext(ctx context.Context) *DcimRackReservationsListParams { + var () + return &DcimRackReservationsListParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsListParamsWithHTTPClient creates a new DcimRackReservationsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsListParamsWithHTTPClient(client *http.Client) *DcimRackReservationsListParams { + var () + return &DcimRackReservationsListParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsListParams contains all the parameters to send to the API endpoint +for the dcim rack reservations list operation typically these are written to a http.Request +*/ +type DcimRackReservationsListParams struct { + + /*Created*/ + Created *string + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*RackID*/ + RackID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*User*/ + User *string + /*UserID*/ + UserID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithTimeout(timeout time.Duration) *DcimRackReservationsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithContext(ctx context.Context) *DcimRackReservationsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithHTTPClient(client *http.Client) *DcimRackReservationsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCreated adds the created to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithCreated(created *string) *DcimRackReservationsListParams { + o.SetCreated(created) + return o +} + +// SetCreated adds the created to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetCreated(created *string) { + o.Created = created +} + +// WithGroup adds the group to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithGroup(group *string) *DcimRackReservationsListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithGroupID(groupID *string) *DcimRackReservationsListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithIDIn(iDIn *float64) *DcimRackReservationsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithLimit(limit *int64) *DcimRackReservationsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithOffset(offset *int64) *DcimRackReservationsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithQ(q *string) *DcimRackReservationsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRackID adds the rackID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithRackID(rackID *string) *DcimRackReservationsListParams { + o.SetRackID(rackID) + return o +} + +// SetRackID adds the rackId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetRackID(rackID *string) { + o.RackID = rackID +} + +// WithSite adds the site to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithSite(site *string) *DcimRackReservationsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithSiteID(siteID *string) *DcimRackReservationsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithUser adds the user to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithUser(user *string) *DcimRackReservationsListParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetUser(user *string) { + o.User = user +} + +// WithUserID adds the userID to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) WithUserID(userID *string) *DcimRackReservationsListParams { + o.SetUserID(userID) + return o +} + +// SetUserID adds the userId to the dcim rack reservations list params +func (o *DcimRackReservationsListParams) SetUserID(userID *string) { + o.UserID = userID +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Created != nil { + + // query param created + var qrCreated string + if o.Created != nil { + qrCreated = *o.Created + } + qCreated := qrCreated + if qCreated != "" { + if err := r.SetQueryParam("created", qCreated); err != nil { + return err + } + } + + } + + if o.Group != nil { + + // query param group + var qrGroup string + if o.Group != nil { + qrGroup = *o.Group + } + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("group", qGroup); err != nil { + return err + } + } + + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.RackID != nil { + + // query param rack_id + var qrRackID string + if o.RackID != nil { + qrRackID = *o.RackID + } + qRackID := qrRackID + if qRackID != "" { + if err := r.SetQueryParam("rack_id", qRackID); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.User != nil { + + // query param user + var qrUser string + if o.User != nil { + qrUser = *o.User + } + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + } + + if o.UserID != nil { + + // query param user_id + var qrUserID string + if o.UserID != nil { + qrUserID = *o.UserID + } + qUserID := qrUserID + if qUserID != "" { + if err := r.SetQueryParam("user_id", qUserID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rack_reservations_list_responses.go b/netbox/client/dcim/dcim_rack_reservations_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..80b52aefb53b2e5ffdb0d4e19734db5b7c3308d1 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// DcimRackReservationsListReader is a Reader for the DcimRackReservationsList structure. +type DcimRackReservationsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackReservationsListOK() + 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()) + } +} + +// NewDcimRackReservationsListOK creates a DcimRackReservationsListOK with default headers values +func NewDcimRackReservationsListOK() *DcimRackReservationsListOK { + return &DcimRackReservationsListOK{} +} + +/*DcimRackReservationsListOK handles this case with default header values. + +DcimRackReservationsListOK dcim rack reservations list o k +*/ +type DcimRackReservationsListOK struct { + Payload *models.DcimRackReservationsListOKBody +} + +func (o *DcimRackReservationsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-reservations/][%d] dcimRackReservationsListOK %+v", 200, o.Payload) +} + +func (o *DcimRackReservationsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRackReservationsListOKBody) + + // 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_rack_reservations_partial_update_parameters.go b/netbox/client/dcim/dcim_rack_reservations_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3c40693691dc79f4a5ef8e5ac052aa45135be718 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// NewDcimRackReservationsPartialUpdateParams creates a new DcimRackReservationsPartialUpdateParams object +// with the default values initialized. +func NewDcimRackReservationsPartialUpdateParams() *DcimRackReservationsPartialUpdateParams { + var () + return &DcimRackReservationsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsPartialUpdateParamsWithTimeout creates a new DcimRackReservationsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRackReservationsPartialUpdateParams { + var () + return &DcimRackReservationsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsPartialUpdateParamsWithContext creates a new DcimRackReservationsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsPartialUpdateParamsWithContext(ctx context.Context) *DcimRackReservationsPartialUpdateParams { + var () + return &DcimRackReservationsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsPartialUpdateParamsWithHTTPClient creates a new DcimRackReservationsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRackReservationsPartialUpdateParams { + var () + return &DcimRackReservationsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack reservations partial update operation typically these are written to a http.Request +*/ +type DcimRackReservationsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRackReservation + /*ID + A unique integer value identifying this rack reservation. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRackReservationsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithContext(ctx context.Context) *DcimRackReservationsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRackReservationsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithData(data *models.WritableRackReservation) *DcimRackReservationsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetData(data *models.WritableRackReservation) { + o.Data = data +} + +// WithID adds the id to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) WithID(id int64) *DcimRackReservationsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack reservations partial update params +func (o *DcimRackReservationsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsPartialUpdateParams) 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_rack_reservations_partial_update_responses.go b/netbox/client/dcim/dcim_rack_reservations_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0e99d374964e0c636922c7eece0fe6d6ecc81c94 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// DcimRackReservationsPartialUpdateReader is a Reader for the DcimRackReservationsPartialUpdate structure. +type DcimRackReservationsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackReservationsPartialUpdateOK() + 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()) + } +} + +// NewDcimRackReservationsPartialUpdateOK creates a DcimRackReservationsPartialUpdateOK with default headers values +func NewDcimRackReservationsPartialUpdateOK() *DcimRackReservationsPartialUpdateOK { + return &DcimRackReservationsPartialUpdateOK{} +} + +/*DcimRackReservationsPartialUpdateOK handles this case with default header values. + +DcimRackReservationsPartialUpdateOK dcim rack reservations partial update o k +*/ +type DcimRackReservationsPartialUpdateOK struct { + Payload *models.WritableRackReservation +} + +func (o *DcimRackReservationsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/rack-reservations/{id}/][%d] dcimRackReservationsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackReservationsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackReservation) + + // 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_rack_reservations_read_parameters.go b/netbox/client/dcim/dcim_rack_reservations_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..24ff5971c0202830b59f42d72d9e7d9d4c3a0014 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// NewDcimRackReservationsReadParams creates a new DcimRackReservationsReadParams object +// with the default values initialized. +func NewDcimRackReservationsReadParams() *DcimRackReservationsReadParams { + var () + return &DcimRackReservationsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsReadParamsWithTimeout creates a new DcimRackReservationsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsReadParamsWithTimeout(timeout time.Duration) *DcimRackReservationsReadParams { + var () + return &DcimRackReservationsReadParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsReadParamsWithContext creates a new DcimRackReservationsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsReadParamsWithContext(ctx context.Context) *DcimRackReservationsReadParams { + var () + return &DcimRackReservationsReadParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsReadParamsWithHTTPClient creates a new DcimRackReservationsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsReadParamsWithHTTPClient(client *http.Client) *DcimRackReservationsReadParams { + var () + return &DcimRackReservationsReadParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsReadParams contains all the parameters to send to the API endpoint +for the dcim rack reservations read operation typically these are written to a http.Request +*/ +type DcimRackReservationsReadParams struct { + + /*ID + A unique integer value identifying this rack reservation. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) WithTimeout(timeout time.Duration) *DcimRackReservationsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) WithContext(ctx context.Context) *DcimRackReservationsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) WithHTTPClient(client *http.Client) *DcimRackReservationsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) WithID(id int64) *DcimRackReservationsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack reservations read params +func (o *DcimRackReservationsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsReadParams) 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_rack_reservations_read_responses.go b/netbox/client/dcim/dcim_rack_reservations_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..111e57c8b38ca8cce21868dc070f4cb04aef5057 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// DcimRackReservationsReadReader is a Reader for the DcimRackReservationsRead structure. +type DcimRackReservationsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackReservationsReadOK() + 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()) + } +} + +// NewDcimRackReservationsReadOK creates a DcimRackReservationsReadOK with default headers values +func NewDcimRackReservationsReadOK() *DcimRackReservationsReadOK { + return &DcimRackReservationsReadOK{} +} + +/*DcimRackReservationsReadOK handles this case with default header values. + +DcimRackReservationsReadOK dcim rack reservations read o k +*/ +type DcimRackReservationsReadOK struct { + Payload *models.RackReservation +} + +func (o *DcimRackReservationsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-reservations/{id}/][%d] dcimRackReservationsReadOK %+v", 200, o.Payload) +} + +func (o *DcimRackReservationsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackReservation) + + // 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_rack_reservations_update_parameters.go b/netbox/client/dcim/dcim_rack_reservations_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5f888ba4d6f599ca923a8ad38090ad59c99a9916 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// NewDcimRackReservationsUpdateParams creates a new DcimRackReservationsUpdateParams object +// with the default values initialized. +func NewDcimRackReservationsUpdateParams() *DcimRackReservationsUpdateParams { + var () + return &DcimRackReservationsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackReservationsUpdateParamsWithTimeout creates a new DcimRackReservationsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackReservationsUpdateParamsWithTimeout(timeout time.Duration) *DcimRackReservationsUpdateParams { + var () + return &DcimRackReservationsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackReservationsUpdateParamsWithContext creates a new DcimRackReservationsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackReservationsUpdateParamsWithContext(ctx context.Context) *DcimRackReservationsUpdateParams { + var () + return &DcimRackReservationsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackReservationsUpdateParamsWithHTTPClient creates a new DcimRackReservationsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackReservationsUpdateParamsWithHTTPClient(client *http.Client) *DcimRackReservationsUpdateParams { + var () + return &DcimRackReservationsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackReservationsUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack reservations update operation typically these are written to a http.Request +*/ +type DcimRackReservationsUpdateParams struct { + + /*Data*/ + Data *models.WritableRackReservation + /*ID + A unique integer value identifying this rack reservation. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithTimeout(timeout time.Duration) *DcimRackReservationsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithContext(ctx context.Context) *DcimRackReservationsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithHTTPClient(client *http.Client) *DcimRackReservationsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithData(data *models.WritableRackReservation) *DcimRackReservationsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetData(data *models.WritableRackReservation) { + o.Data = data +} + +// WithID adds the id to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) WithID(id int64) *DcimRackReservationsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack reservations update params +func (o *DcimRackReservationsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackReservationsUpdateParams) 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_rack_reservations_update_responses.go b/netbox/client/dcim/dcim_rack_reservations_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4778e7c488861e19b26098b86639d4b5026b61d6 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_reservations_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" +) + +// DcimRackReservationsUpdateReader is a Reader for the DcimRackReservationsUpdate structure. +type DcimRackReservationsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackReservationsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackReservationsUpdateOK() + 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()) + } +} + +// NewDcimRackReservationsUpdateOK creates a DcimRackReservationsUpdateOK with default headers values +func NewDcimRackReservationsUpdateOK() *DcimRackReservationsUpdateOK { + return &DcimRackReservationsUpdateOK{} +} + +/*DcimRackReservationsUpdateOK handles this case with default header values. + +DcimRackReservationsUpdateOK dcim rack reservations update o k +*/ +type DcimRackReservationsUpdateOK struct { + Payload *models.WritableRackReservation +} + +func (o *DcimRackReservationsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/rack-reservations/{id}/][%d] dcimRackReservationsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackReservationsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRackReservation) + + // 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_rack_roles_create_parameters.go b/netbox/client/dcim/dcim_rack_roles_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..12ffe2477192b69feb0da409542564a8315120d3 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// NewDcimRackRolesCreateParams creates a new DcimRackRolesCreateParams object +// with the default values initialized. +func NewDcimRackRolesCreateParams() *DcimRackRolesCreateParams { + var () + return &DcimRackRolesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesCreateParamsWithTimeout creates a new DcimRackRolesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesCreateParamsWithTimeout(timeout time.Duration) *DcimRackRolesCreateParams { + var () + return &DcimRackRolesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesCreateParamsWithContext creates a new DcimRackRolesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesCreateParamsWithContext(ctx context.Context) *DcimRackRolesCreateParams { + var () + return &DcimRackRolesCreateParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesCreateParamsWithHTTPClient creates a new DcimRackRolesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesCreateParamsWithHTTPClient(client *http.Client) *DcimRackRolesCreateParams { + var () + return &DcimRackRolesCreateParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesCreateParams contains all the parameters to send to the API endpoint +for the dcim rack roles create operation typically these are written to a http.Request +*/ +type DcimRackRolesCreateParams struct { + + /*Data*/ + Data *models.RackRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) WithTimeout(timeout time.Duration) *DcimRackRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) WithContext(ctx context.Context) *DcimRackRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) WithHTTPClient(client *http.Client) *DcimRackRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) WithData(data *models.RackRole) *DcimRackRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack roles create params +func (o *DcimRackRolesCreateParams) SetData(data *models.RackRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesCreateParams) 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_rack_roles_create_responses.go b/netbox/client/dcim/dcim_rack_roles_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e647a316ac2469375066ca86757dc870f037f08b --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// DcimRackRolesCreateReader is a Reader for the DcimRackRolesCreate structure. +type DcimRackRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRackRolesCreateCreated() + 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()) + } +} + +// NewDcimRackRolesCreateCreated creates a DcimRackRolesCreateCreated with default headers values +func NewDcimRackRolesCreateCreated() *DcimRackRolesCreateCreated { + return &DcimRackRolesCreateCreated{} +} + +/*DcimRackRolesCreateCreated handles this case with default header values. + +DcimRackRolesCreateCreated dcim rack roles create created +*/ +type DcimRackRolesCreateCreated struct { + Payload *models.RackRole +} + +func (o *DcimRackRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/rack-roles/][%d] dcimRackRolesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRackRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackRole) + + // 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_rack_roles_delete_parameters.go b/netbox/client/dcim/dcim_rack_roles_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..82d9ac8ebc402f367af74289a5941986aa8ea020 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// NewDcimRackRolesDeleteParams creates a new DcimRackRolesDeleteParams object +// with the default values initialized. +func NewDcimRackRolesDeleteParams() *DcimRackRolesDeleteParams { + var () + return &DcimRackRolesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesDeleteParamsWithTimeout creates a new DcimRackRolesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesDeleteParamsWithTimeout(timeout time.Duration) *DcimRackRolesDeleteParams { + var () + return &DcimRackRolesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesDeleteParamsWithContext creates a new DcimRackRolesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesDeleteParamsWithContext(ctx context.Context) *DcimRackRolesDeleteParams { + var () + return &DcimRackRolesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesDeleteParamsWithHTTPClient creates a new DcimRackRolesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesDeleteParamsWithHTTPClient(client *http.Client) *DcimRackRolesDeleteParams { + var () + return &DcimRackRolesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesDeleteParams contains all the parameters to send to the API endpoint +for the dcim rack roles delete operation typically these are written to a http.Request +*/ +type DcimRackRolesDeleteParams struct { + + /*ID + A unique integer value identifying this rack role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) WithTimeout(timeout time.Duration) *DcimRackRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) WithContext(ctx context.Context) *DcimRackRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) WithHTTPClient(client *http.Client) *DcimRackRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) WithID(id int64) *DcimRackRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles delete params +func (o *DcimRackRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesDeleteParams) 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_rack_roles_delete_responses.go b/netbox/client/dcim/dcim_rack_roles_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7918b452fa5b19ebba601853904d68104dd1b172 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// DcimRackRolesDeleteReader is a Reader for the DcimRackRolesDelete structure. +type DcimRackRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRackRolesDeleteNoContent() + 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()) + } +} + +// NewDcimRackRolesDeleteNoContent creates a DcimRackRolesDeleteNoContent with default headers values +func NewDcimRackRolesDeleteNoContent() *DcimRackRolesDeleteNoContent { + return &DcimRackRolesDeleteNoContent{} +} + +/*DcimRackRolesDeleteNoContent handles this case with default header values. + +DcimRackRolesDeleteNoContent dcim rack roles delete no content +*/ +type DcimRackRolesDeleteNoContent struct { +} + +func (o *DcimRackRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/rack-roles/{id}/][%d] dcimRackRolesDeleteNoContent ", 204) +} + +func (o *DcimRackRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_rack_roles_list_parameters.go b/netbox/client/dcim/dcim_rack_roles_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b02dfd7864bde29c656214a06b1a17113d5bd83a --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_list_parameters.go @@ -0,0 +1,268 @@ +// 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" +) + +// NewDcimRackRolesListParams creates a new DcimRackRolesListParams object +// with the default values initialized. +func NewDcimRackRolesListParams() *DcimRackRolesListParams { + var () + return &DcimRackRolesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesListParamsWithTimeout creates a new DcimRackRolesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesListParamsWithTimeout(timeout time.Duration) *DcimRackRolesListParams { + var () + return &DcimRackRolesListParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesListParamsWithContext creates a new DcimRackRolesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesListParamsWithContext(ctx context.Context) *DcimRackRolesListParams { + var () + return &DcimRackRolesListParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesListParamsWithHTTPClient creates a new DcimRackRolesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesListParamsWithHTTPClient(client *http.Client) *DcimRackRolesListParams { + var () + return &DcimRackRolesListParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesListParams contains all the parameters to send to the API endpoint +for the dcim rack roles list operation typically these are written to a http.Request +*/ +type DcimRackRolesListParams struct { + + /*Color*/ + Color *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithTimeout(timeout time.Duration) *DcimRackRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithContext(ctx context.Context) *DcimRackRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithHTTPClient(client *http.Client) *DcimRackRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithColor adds the color to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithColor(color *string) *DcimRackRolesListParams { + o.SetColor(color) + return o +} + +// SetColor adds the color to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetColor(color *string) { + o.Color = color +} + +// WithLimit adds the limit to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithLimit(limit *int64) *DcimRackRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithName(name *string) *DcimRackRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithOffset(offset *int64) *DcimRackRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the dcim rack roles list params +func (o *DcimRackRolesListParams) WithSlug(slug *string) *DcimRackRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim rack roles list params +func (o *DcimRackRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Color != nil { + + // query param color + var qrColor string + if o.Color != nil { + qrColor = *o.Color + } + qColor := qrColor + if qColor != "" { + if err := r.SetQueryParam("color", qColor); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_rack_roles_list_responses.go b/netbox/client/dcim/dcim_rack_roles_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..344f766e7a6ad69321141024578f1568429e0010 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// DcimRackRolesListReader is a Reader for the DcimRackRolesList structure. +type DcimRackRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackRolesListOK() + 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()) + } +} + +// NewDcimRackRolesListOK creates a DcimRackRolesListOK with default headers values +func NewDcimRackRolesListOK() *DcimRackRolesListOK { + return &DcimRackRolesListOK{} +} + +/*DcimRackRolesListOK handles this case with default header values. + +DcimRackRolesListOK dcim rack roles list o k +*/ +type DcimRackRolesListOK struct { + Payload *models.DcimRackRolesListOKBody +} + +func (o *DcimRackRolesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-roles/][%d] dcimRackRolesListOK %+v", 200, o.Payload) +} + +func (o *DcimRackRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRackRolesListOKBody) + + // 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_rack_roles_partial_update_parameters.go b/netbox/client/dcim/dcim_rack_roles_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..05f63d1250982ed8be54850ac63da6632808855b --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// NewDcimRackRolesPartialUpdateParams creates a new DcimRackRolesPartialUpdateParams object +// with the default values initialized. +func NewDcimRackRolesPartialUpdateParams() *DcimRackRolesPartialUpdateParams { + var () + return &DcimRackRolesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesPartialUpdateParamsWithTimeout creates a new DcimRackRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRackRolesPartialUpdateParams { + var () + return &DcimRackRolesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesPartialUpdateParamsWithContext creates a new DcimRackRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesPartialUpdateParamsWithContext(ctx context.Context) *DcimRackRolesPartialUpdateParams { + var () + return &DcimRackRolesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesPartialUpdateParamsWithHTTPClient creates a new DcimRackRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRackRolesPartialUpdateParams { + var () + return &DcimRackRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack roles partial update operation typically these are written to a http.Request +*/ +type DcimRackRolesPartialUpdateParams struct { + + /*Data*/ + Data *models.RackRole + /*ID + A unique integer value identifying this rack role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRackRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithContext(ctx context.Context) *DcimRackRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRackRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithData(data *models.RackRole) *DcimRackRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetData(data *models.RackRole) { + o.Data = data +} + +// WithID adds the id to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) WithID(id int64) *DcimRackRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles partial update params +func (o *DcimRackRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesPartialUpdateParams) 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_rack_roles_partial_update_responses.go b/netbox/client/dcim/dcim_rack_roles_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..062973c3f704692c6ecbb87e96bc9a582934ee6a --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// DcimRackRolesPartialUpdateReader is a Reader for the DcimRackRolesPartialUpdate structure. +type DcimRackRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackRolesPartialUpdateOK() + 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()) + } +} + +// NewDcimRackRolesPartialUpdateOK creates a DcimRackRolesPartialUpdateOK with default headers values +func NewDcimRackRolesPartialUpdateOK() *DcimRackRolesPartialUpdateOK { + return &DcimRackRolesPartialUpdateOK{} +} + +/*DcimRackRolesPartialUpdateOK handles this case with default header values. + +DcimRackRolesPartialUpdateOK dcim rack roles partial update o k +*/ +type DcimRackRolesPartialUpdateOK struct { + Payload *models.RackRole +} + +func (o *DcimRackRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/rack-roles/{id}/][%d] dcimRackRolesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackRole) + + // 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_rack_roles_read_parameters.go b/netbox/client/dcim/dcim_rack_roles_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8327fa6b382c33fb49de8b1a4814318f7939acc5 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// NewDcimRackRolesReadParams creates a new DcimRackRolesReadParams object +// with the default values initialized. +func NewDcimRackRolesReadParams() *DcimRackRolesReadParams { + var () + return &DcimRackRolesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesReadParamsWithTimeout creates a new DcimRackRolesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesReadParamsWithTimeout(timeout time.Duration) *DcimRackRolesReadParams { + var () + return &DcimRackRolesReadParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesReadParamsWithContext creates a new DcimRackRolesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesReadParamsWithContext(ctx context.Context) *DcimRackRolesReadParams { + var () + return &DcimRackRolesReadParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesReadParamsWithHTTPClient creates a new DcimRackRolesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesReadParamsWithHTTPClient(client *http.Client) *DcimRackRolesReadParams { + var () + return &DcimRackRolesReadParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesReadParams contains all the parameters to send to the API endpoint +for the dcim rack roles read operation typically these are written to a http.Request +*/ +type DcimRackRolesReadParams struct { + + /*ID + A unique integer value identifying this rack role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles read params +func (o *DcimRackRolesReadParams) WithTimeout(timeout time.Duration) *DcimRackRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles read params +func (o *DcimRackRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles read params +func (o *DcimRackRolesReadParams) WithContext(ctx context.Context) *DcimRackRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles read params +func (o *DcimRackRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles read params +func (o *DcimRackRolesReadParams) WithHTTPClient(client *http.Client) *DcimRackRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles read params +func (o *DcimRackRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim rack roles read params +func (o *DcimRackRolesReadParams) WithID(id int64) *DcimRackRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles read params +func (o *DcimRackRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesReadParams) 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_rack_roles_read_responses.go b/netbox/client/dcim/dcim_rack_roles_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ee035ce6b5ca37551f33f8cc2d6701510d5b0812 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// DcimRackRolesReadReader is a Reader for the DcimRackRolesRead structure. +type DcimRackRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackRolesReadOK() + 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()) + } +} + +// NewDcimRackRolesReadOK creates a DcimRackRolesReadOK with default headers values +func NewDcimRackRolesReadOK() *DcimRackRolesReadOK { + return &DcimRackRolesReadOK{} +} + +/*DcimRackRolesReadOK handles this case with default header values. + +DcimRackRolesReadOK dcim rack roles read o k +*/ +type DcimRackRolesReadOK struct { + Payload *models.RackRole +} + +func (o *DcimRackRolesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/rack-roles/{id}/][%d] dcimRackRolesReadOK %+v", 200, o.Payload) +} + +func (o *DcimRackRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackRole) + + // 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_rack_roles_update_parameters.go b/netbox/client/dcim/dcim_rack_roles_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..bf3883ca72ea7a23e3f3afc1752bcb804eb4eac5 --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// NewDcimRackRolesUpdateParams creates a new DcimRackRolesUpdateParams object +// with the default values initialized. +func NewDcimRackRolesUpdateParams() *DcimRackRolesUpdateParams { + var () + return &DcimRackRolesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRackRolesUpdateParamsWithTimeout creates a new DcimRackRolesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRackRolesUpdateParamsWithTimeout(timeout time.Duration) *DcimRackRolesUpdateParams { + var () + return &DcimRackRolesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRackRolesUpdateParamsWithContext creates a new DcimRackRolesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRackRolesUpdateParamsWithContext(ctx context.Context) *DcimRackRolesUpdateParams { + var () + return &DcimRackRolesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRackRolesUpdateParamsWithHTTPClient creates a new DcimRackRolesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRackRolesUpdateParamsWithHTTPClient(client *http.Client) *DcimRackRolesUpdateParams { + var () + return &DcimRackRolesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRackRolesUpdateParams contains all the parameters to send to the API endpoint +for the dcim rack roles update operation typically these are written to a http.Request +*/ +type DcimRackRolesUpdateParams struct { + + /*Data*/ + Data *models.RackRole + /*ID + A unique integer value identifying this rack role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithTimeout(timeout time.Duration) *DcimRackRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithContext(ctx context.Context) *DcimRackRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithHTTPClient(client *http.Client) *DcimRackRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithData(data *models.RackRole) *DcimRackRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetData(data *models.RackRole) { + o.Data = data +} + +// WithID adds the id to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) WithID(id int64) *DcimRackRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim rack roles update params +func (o *DcimRackRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRackRolesUpdateParams) 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_rack_roles_update_responses.go b/netbox/client/dcim/dcim_rack_roles_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fe4d8df844a7c7a5587eec6e7416d059cfae4a7c --- /dev/null +++ b/netbox/client/dcim/dcim_rack_roles_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" +) + +// DcimRackRolesUpdateReader is a Reader for the DcimRackRolesUpdate structure. +type DcimRackRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRackRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRackRolesUpdateOK() + 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()) + } +} + +// NewDcimRackRolesUpdateOK creates a DcimRackRolesUpdateOK with default headers values +func NewDcimRackRolesUpdateOK() *DcimRackRolesUpdateOK { + return &DcimRackRolesUpdateOK{} +} + +/*DcimRackRolesUpdateOK handles this case with default header values. + +DcimRackRolesUpdateOK dcim rack roles update o k +*/ +type DcimRackRolesUpdateOK struct { + Payload *models.RackRole +} + +func (o *DcimRackRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/rack-roles/{id}/][%d] dcimRackRolesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRackRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RackRole) + + // 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_racks_create_parameters.go b/netbox/client/dcim/dcim_racks_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6d498179ff15440fb2cd4381d5aa024079375d0d --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// NewDcimRacksCreateParams creates a new DcimRacksCreateParams object +// with the default values initialized. +func NewDcimRacksCreateParams() *DcimRacksCreateParams { + var () + return &DcimRacksCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksCreateParamsWithTimeout creates a new DcimRacksCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksCreateParamsWithTimeout(timeout time.Duration) *DcimRacksCreateParams { + var () + return &DcimRacksCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRacksCreateParamsWithContext creates a new DcimRacksCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksCreateParamsWithContext(ctx context.Context) *DcimRacksCreateParams { + var () + return &DcimRacksCreateParams{ + + Context: ctx, + } +} + +// NewDcimRacksCreateParamsWithHTTPClient creates a new DcimRacksCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksCreateParamsWithHTTPClient(client *http.Client) *DcimRacksCreateParams { + var () + return &DcimRacksCreateParams{ + HTTPClient: client, + } +} + +/*DcimRacksCreateParams contains all the parameters to send to the API endpoint +for the dcim racks create operation typically these are written to a http.Request +*/ +type DcimRacksCreateParams struct { + + /*Data*/ + Data *models.WritableRack + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks create params +func (o *DcimRacksCreateParams) WithTimeout(timeout time.Duration) *DcimRacksCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks create params +func (o *DcimRacksCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks create params +func (o *DcimRacksCreateParams) WithContext(ctx context.Context) *DcimRacksCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks create params +func (o *DcimRacksCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks create params +func (o *DcimRacksCreateParams) WithHTTPClient(client *http.Client) *DcimRacksCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks create params +func (o *DcimRacksCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim racks create params +func (o *DcimRacksCreateParams) WithData(data *models.WritableRack) *DcimRacksCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim racks create params +func (o *DcimRacksCreateParams) SetData(data *models.WritableRack) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksCreateParams) 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_racks_create_responses.go b/netbox/client/dcim/dcim_racks_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5f123e3da9b4b842d4d6bb994b5b1a83335eb215 --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// DcimRacksCreateReader is a Reader for the DcimRacksCreate structure. +type DcimRacksCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRacksCreateCreated() + 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()) + } +} + +// NewDcimRacksCreateCreated creates a DcimRacksCreateCreated with default headers values +func NewDcimRacksCreateCreated() *DcimRacksCreateCreated { + return &DcimRacksCreateCreated{} +} + +/*DcimRacksCreateCreated handles this case with default header values. + +DcimRacksCreateCreated dcim racks create created +*/ +type DcimRacksCreateCreated struct { + Payload *models.WritableRack +} + +func (o *DcimRacksCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/racks/][%d] dcimRacksCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRacksCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRack) + + // 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_racks_delete_parameters.go b/netbox/client/dcim/dcim_racks_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b6458c9f3a69db041bdfa573cac90f64864399f4 --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// NewDcimRacksDeleteParams creates a new DcimRacksDeleteParams object +// with the default values initialized. +func NewDcimRacksDeleteParams() *DcimRacksDeleteParams { + var () + return &DcimRacksDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksDeleteParamsWithTimeout creates a new DcimRacksDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksDeleteParamsWithTimeout(timeout time.Duration) *DcimRacksDeleteParams { + var () + return &DcimRacksDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRacksDeleteParamsWithContext creates a new DcimRacksDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksDeleteParamsWithContext(ctx context.Context) *DcimRacksDeleteParams { + var () + return &DcimRacksDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRacksDeleteParamsWithHTTPClient creates a new DcimRacksDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksDeleteParamsWithHTTPClient(client *http.Client) *DcimRacksDeleteParams { + var () + return &DcimRacksDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRacksDeleteParams contains all the parameters to send to the API endpoint +for the dcim racks delete operation typically these are written to a http.Request +*/ +type DcimRacksDeleteParams struct { + + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks delete params +func (o *DcimRacksDeleteParams) WithTimeout(timeout time.Duration) *DcimRacksDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks delete params +func (o *DcimRacksDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks delete params +func (o *DcimRacksDeleteParams) WithContext(ctx context.Context) *DcimRacksDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks delete params +func (o *DcimRacksDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks delete params +func (o *DcimRacksDeleteParams) WithHTTPClient(client *http.Client) *DcimRacksDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks delete params +func (o *DcimRacksDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim racks delete params +func (o *DcimRacksDeleteParams) WithID(id int64) *DcimRacksDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks delete params +func (o *DcimRacksDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksDeleteParams) 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_racks_delete_responses.go b/netbox/client/dcim/dcim_racks_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e0abe07c7413b0fd921ba2935647cb1b76f33e07 --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// DcimRacksDeleteReader is a Reader for the DcimRacksDelete structure. +type DcimRacksDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRacksDeleteNoContent() + 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()) + } +} + +// NewDcimRacksDeleteNoContent creates a DcimRacksDeleteNoContent with default headers values +func NewDcimRacksDeleteNoContent() *DcimRacksDeleteNoContent { + return &DcimRacksDeleteNoContent{} +} + +/*DcimRacksDeleteNoContent handles this case with default header values. + +DcimRacksDeleteNoContent dcim racks delete no content +*/ +type DcimRacksDeleteNoContent struct { +} + +func (o *DcimRacksDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/racks/{id}/][%d] dcimRacksDeleteNoContent ", 204) +} + +func (o *DcimRacksDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_racks_list_parameters.go b/netbox/client/dcim/dcim_racks_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..44d44538bf966a245483db222e6f456c62ff473d --- /dev/null +++ b/netbox/client/dcim/dcim_racks_list_parameters.go @@ -0,0 +1,677 @@ +// 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" +) + +// NewDcimRacksListParams creates a new DcimRacksListParams object +// with the default values initialized. +func NewDcimRacksListParams() *DcimRacksListParams { + var () + return &DcimRacksListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksListParamsWithTimeout creates a new DcimRacksListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksListParamsWithTimeout(timeout time.Duration) *DcimRacksListParams { + var () + return &DcimRacksListParams{ + + timeout: timeout, + } +} + +// NewDcimRacksListParamsWithContext creates a new DcimRacksListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksListParamsWithContext(ctx context.Context) *DcimRacksListParams { + var () + return &DcimRacksListParams{ + + Context: ctx, + } +} + +// NewDcimRacksListParamsWithHTTPClient creates a new DcimRacksListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksListParamsWithHTTPClient(client *http.Client) *DcimRacksListParams { + var () + return &DcimRacksListParams{ + HTTPClient: client, + } +} + +/*DcimRacksListParams contains all the parameters to send to the API endpoint +for the dcim racks list operation typically these are written to a http.Request +*/ +type DcimRacksListParams struct { + + /*DescUnits*/ + DescUnits *string + /*FacilityID*/ + FacilityID *string + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Serial*/ + Serial *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*Type*/ + Type *string + /*UHeight*/ + UHeight *float64 + /*Width*/ + Width *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks list params +func (o *DcimRacksListParams) WithTimeout(timeout time.Duration) *DcimRacksListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks list params +func (o *DcimRacksListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks list params +func (o *DcimRacksListParams) WithContext(ctx context.Context) *DcimRacksListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks list params +func (o *DcimRacksListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks list params +func (o *DcimRacksListParams) WithHTTPClient(client *http.Client) *DcimRacksListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks list params +func (o *DcimRacksListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDescUnits adds the descUnits to the dcim racks list params +func (o *DcimRacksListParams) WithDescUnits(descUnits *string) *DcimRacksListParams { + o.SetDescUnits(descUnits) + return o +} + +// SetDescUnits adds the descUnits to the dcim racks list params +func (o *DcimRacksListParams) SetDescUnits(descUnits *string) { + o.DescUnits = descUnits +} + +// WithFacilityID adds the facilityID to the dcim racks list params +func (o *DcimRacksListParams) WithFacilityID(facilityID *string) *DcimRacksListParams { + o.SetFacilityID(facilityID) + return o +} + +// SetFacilityID adds the facilityId to the dcim racks list params +func (o *DcimRacksListParams) SetFacilityID(facilityID *string) { + o.FacilityID = facilityID +} + +// WithGroup adds the group to the dcim racks list params +func (o *DcimRacksListParams) WithGroup(group *string) *DcimRacksListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the dcim racks list params +func (o *DcimRacksListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the dcim racks list params +func (o *DcimRacksListParams) WithGroupID(groupID *string) *DcimRacksListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the dcim racks list params +func (o *DcimRacksListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the dcim racks list params +func (o *DcimRacksListParams) WithIDIn(iDIn *float64) *DcimRacksListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim racks list params +func (o *DcimRacksListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the dcim racks list params +func (o *DcimRacksListParams) WithLimit(limit *int64) *DcimRacksListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim racks list params +func (o *DcimRacksListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim racks list params +func (o *DcimRacksListParams) WithName(name *string) *DcimRacksListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim racks list params +func (o *DcimRacksListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim racks list params +func (o *DcimRacksListParams) WithOffset(offset *int64) *DcimRacksListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim racks list params +func (o *DcimRacksListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim racks list params +func (o *DcimRacksListParams) WithQ(q *string) *DcimRacksListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim racks list params +func (o *DcimRacksListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the dcim racks list params +func (o *DcimRacksListParams) WithRole(role *string) *DcimRacksListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the dcim racks list params +func (o *DcimRacksListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the dcim racks list params +func (o *DcimRacksListParams) WithRoleID(roleID *string) *DcimRacksListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the dcim racks list params +func (o *DcimRacksListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSerial adds the serial to the dcim racks list params +func (o *DcimRacksListParams) WithSerial(serial *string) *DcimRacksListParams { + o.SetSerial(serial) + return o +} + +// SetSerial adds the serial to the dcim racks list params +func (o *DcimRacksListParams) SetSerial(serial *string) { + o.Serial = serial +} + +// WithSite adds the site to the dcim racks list params +func (o *DcimRacksListParams) WithSite(site *string) *DcimRacksListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the dcim racks list params +func (o *DcimRacksListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the dcim racks list params +func (o *DcimRacksListParams) WithSiteID(siteID *string) *DcimRacksListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the dcim racks list params +func (o *DcimRacksListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithTenant adds the tenant to the dcim racks list params +func (o *DcimRacksListParams) WithTenant(tenant *string) *DcimRacksListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim racks list params +func (o *DcimRacksListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the dcim racks list params +func (o *DcimRacksListParams) WithTenantID(tenantID *string) *DcimRacksListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim racks list params +func (o *DcimRacksListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithType adds the typeVar to the dcim racks list params +func (o *DcimRacksListParams) WithType(typeVar *string) *DcimRacksListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the dcim racks list params +func (o *DcimRacksListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithUHeight adds the uHeight to the dcim racks list params +func (o *DcimRacksListParams) WithUHeight(uHeight *float64) *DcimRacksListParams { + o.SetUHeight(uHeight) + return o +} + +// SetUHeight adds the uHeight to the dcim racks list params +func (o *DcimRacksListParams) SetUHeight(uHeight *float64) { + o.UHeight = uHeight +} + +// WithWidth adds the width to the dcim racks list params +func (o *DcimRacksListParams) WithWidth(width *string) *DcimRacksListParams { + o.SetWidth(width) + return o +} + +// SetWidth adds the width to the dcim racks list params +func (o *DcimRacksListParams) SetWidth(width *string) { + o.Width = width +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DescUnits != nil { + + // query param desc_units + var qrDescUnits string + if o.DescUnits != nil { + qrDescUnits = *o.DescUnits + } + qDescUnits := qrDescUnits + if qDescUnits != "" { + if err := r.SetQueryParam("desc_units", qDescUnits); err != nil { + return err + } + } + + } + + if o.FacilityID != nil { + + // query param facility_id + var qrFacilityID string + if o.FacilityID != nil { + qrFacilityID = *o.FacilityID + } + qFacilityID := qrFacilityID + if qFacilityID != "" { + if err := r.SetQueryParam("facility_id", qFacilityID); err != nil { + return err + } + } + + } + + if o.Group != nil { + + // query param group + var qrGroup string + if o.Group != nil { + qrGroup = *o.Group + } + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("group", qGroup); err != nil { + return err + } + } + + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Role != nil { + + // query param role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + + } + + if o.RoleID != nil { + + // query param role_id + var qrRoleID string + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + if err := r.SetQueryParam("role_id", qRoleID); err != nil { + return err + } + } + + } + + if o.Serial != nil { + + // query param serial + var qrSerial string + if o.Serial != nil { + qrSerial = *o.Serial + } + qSerial := qrSerial + if qSerial != "" { + if err := r.SetQueryParam("serial", qSerial); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Tenant != nil { + + // query param tenant + var qrTenant string + if o.Tenant != nil { + qrTenant = *o.Tenant + } + qTenant := qrTenant + if qTenant != "" { + if err := r.SetQueryParam("tenant", qTenant); err != nil { + return err + } + } + + } + + if o.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.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if o.UHeight != nil { + + // query param u_height + var qrUHeight float64 + if o.UHeight != nil { + qrUHeight = *o.UHeight + } + qUHeight := swag.FormatFloat64(qrUHeight) + if qUHeight != "" { + if err := r.SetQueryParam("u_height", qUHeight); err != nil { + return err + } + } + + } + + if o.Width != nil { + + // query param width + var qrWidth string + if o.Width != nil { + qrWidth = *o.Width + } + qWidth := qrWidth + if qWidth != "" { + if err := r.SetQueryParam("width", qWidth); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_racks_list_responses.go b/netbox/client/dcim/dcim_racks_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e194d9d74102706a6d7dfd186ba1efc93a2aa7d6 --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// DcimRacksListReader is a Reader for the DcimRacksList structure. +type DcimRacksListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksListOK() + 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()) + } +} + +// NewDcimRacksListOK creates a DcimRacksListOK with default headers values +func NewDcimRacksListOK() *DcimRacksListOK { + return &DcimRacksListOK{} +} + +/*DcimRacksListOK handles this case with default header values. + +DcimRacksListOK dcim racks list o k +*/ +type DcimRacksListOK struct { + Payload *models.DcimRacksListOKBody +} + +func (o *DcimRacksListOK) Error() string { + return fmt.Sprintf("[GET /dcim/racks/][%d] dcimRacksListOK %+v", 200, o.Payload) +} + +func (o *DcimRacksListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRacksListOKBody) + + // 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_racks_partial_update_parameters.go b/netbox/client/dcim/dcim_racks_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4f5d04cdd50521a0f1d4a8308e29efa0e18a6fac --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// NewDcimRacksPartialUpdateParams creates a new DcimRacksPartialUpdateParams object +// with the default values initialized. +func NewDcimRacksPartialUpdateParams() *DcimRacksPartialUpdateParams { + var () + return &DcimRacksPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksPartialUpdateParamsWithTimeout creates a new DcimRacksPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRacksPartialUpdateParams { + var () + return &DcimRacksPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRacksPartialUpdateParamsWithContext creates a new DcimRacksPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksPartialUpdateParamsWithContext(ctx context.Context) *DcimRacksPartialUpdateParams { + var () + return &DcimRacksPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRacksPartialUpdateParamsWithHTTPClient creates a new DcimRacksPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRacksPartialUpdateParams { + var () + return &DcimRacksPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRacksPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim racks partial update operation typically these are written to a http.Request +*/ +type DcimRacksPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRack + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRacksPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithContext(ctx context.Context) *DcimRacksPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRacksPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithData(data *models.WritableRack) *DcimRacksPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetData(data *models.WritableRack) { + o.Data = data +} + +// WithID adds the id to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) WithID(id int64) *DcimRacksPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks partial update params +func (o *DcimRacksPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksPartialUpdateParams) 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_racks_partial_update_responses.go b/netbox/client/dcim/dcim_racks_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7194ae4406aaa52d843a8b77f52971cf7cc813d4 --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// DcimRacksPartialUpdateReader is a Reader for the DcimRacksPartialUpdate structure. +type DcimRacksPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksPartialUpdateOK() + 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()) + } +} + +// NewDcimRacksPartialUpdateOK creates a DcimRacksPartialUpdateOK with default headers values +func NewDcimRacksPartialUpdateOK() *DcimRacksPartialUpdateOK { + return &DcimRacksPartialUpdateOK{} +} + +/*DcimRacksPartialUpdateOK handles this case with default header values. + +DcimRacksPartialUpdateOK dcim racks partial update o k +*/ +type DcimRacksPartialUpdateOK struct { + Payload *models.WritableRack +} + +func (o *DcimRacksPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/racks/{id}/][%d] dcimRacksPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRacksPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRack) + + // 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_racks_read_parameters.go b/netbox/client/dcim/dcim_racks_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4845f67b397622b7466912da5fbdee374f000222 --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// NewDcimRacksReadParams creates a new DcimRacksReadParams object +// with the default values initialized. +func NewDcimRacksReadParams() *DcimRacksReadParams { + var () + return &DcimRacksReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksReadParamsWithTimeout creates a new DcimRacksReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksReadParamsWithTimeout(timeout time.Duration) *DcimRacksReadParams { + var () + return &DcimRacksReadParams{ + + timeout: timeout, + } +} + +// NewDcimRacksReadParamsWithContext creates a new DcimRacksReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksReadParamsWithContext(ctx context.Context) *DcimRacksReadParams { + var () + return &DcimRacksReadParams{ + + Context: ctx, + } +} + +// NewDcimRacksReadParamsWithHTTPClient creates a new DcimRacksReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksReadParamsWithHTTPClient(client *http.Client) *DcimRacksReadParams { + var () + return &DcimRacksReadParams{ + HTTPClient: client, + } +} + +/*DcimRacksReadParams contains all the parameters to send to the API endpoint +for the dcim racks read operation typically these are written to a http.Request +*/ +type DcimRacksReadParams struct { + + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks read params +func (o *DcimRacksReadParams) WithTimeout(timeout time.Duration) *DcimRacksReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks read params +func (o *DcimRacksReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks read params +func (o *DcimRacksReadParams) WithContext(ctx context.Context) *DcimRacksReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks read params +func (o *DcimRacksReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks read params +func (o *DcimRacksReadParams) WithHTTPClient(client *http.Client) *DcimRacksReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks read params +func (o *DcimRacksReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim racks read params +func (o *DcimRacksReadParams) WithID(id int64) *DcimRacksReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks read params +func (o *DcimRacksReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksReadParams) 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_racks_read_responses.go b/netbox/client/dcim/dcim_racks_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fdb3cfe4f9544e22e1f05c19e2c7fc7f9b416d8f --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// DcimRacksReadReader is a Reader for the DcimRacksRead structure. +type DcimRacksReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksReadOK() + 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()) + } +} + +// NewDcimRacksReadOK creates a DcimRacksReadOK with default headers values +func NewDcimRacksReadOK() *DcimRacksReadOK { + return &DcimRacksReadOK{} +} + +/*DcimRacksReadOK handles this case with default header values. + +DcimRacksReadOK dcim racks read o k +*/ +type DcimRacksReadOK struct { + Payload *models.Rack +} + +func (o *DcimRacksReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/racks/{id}/][%d] dcimRacksReadOK %+v", 200, o.Payload) +} + +func (o *DcimRacksReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Rack) + + // 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_racks_units_parameters.go b/netbox/client/dcim/dcim_racks_units_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..916da78f7c7051079602f88889451f37dc0fccd6 --- /dev/null +++ b/netbox/client/dcim/dcim_racks_units_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" +) + +// NewDcimRacksUnitsParams creates a new DcimRacksUnitsParams object +// with the default values initialized. +func NewDcimRacksUnitsParams() *DcimRacksUnitsParams { + var () + return &DcimRacksUnitsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksUnitsParamsWithTimeout creates a new DcimRacksUnitsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksUnitsParamsWithTimeout(timeout time.Duration) *DcimRacksUnitsParams { + var () + return &DcimRacksUnitsParams{ + + timeout: timeout, + } +} + +// NewDcimRacksUnitsParamsWithContext creates a new DcimRacksUnitsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksUnitsParamsWithContext(ctx context.Context) *DcimRacksUnitsParams { + var () + return &DcimRacksUnitsParams{ + + Context: ctx, + } +} + +// NewDcimRacksUnitsParamsWithHTTPClient creates a new DcimRacksUnitsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksUnitsParamsWithHTTPClient(client *http.Client) *DcimRacksUnitsParams { + var () + return &DcimRacksUnitsParams{ + HTTPClient: client, + } +} + +/*DcimRacksUnitsParams contains all the parameters to send to the API endpoint +for the dcim racks units operation typically these are written to a http.Request +*/ +type DcimRacksUnitsParams struct { + + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks units params +func (o *DcimRacksUnitsParams) WithTimeout(timeout time.Duration) *DcimRacksUnitsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks units params +func (o *DcimRacksUnitsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks units params +func (o *DcimRacksUnitsParams) WithContext(ctx context.Context) *DcimRacksUnitsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks units params +func (o *DcimRacksUnitsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks units params +func (o *DcimRacksUnitsParams) WithHTTPClient(client *http.Client) *DcimRacksUnitsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks units params +func (o *DcimRacksUnitsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim racks units params +func (o *DcimRacksUnitsParams) WithID(id int64) *DcimRacksUnitsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks units params +func (o *DcimRacksUnitsParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksUnitsParams) 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_racks_units_responses.go b/netbox/client/dcim/dcim_racks_units_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..beb1893b1b2ae0018bfacb3ff6927ecfa0510448 --- /dev/null +++ b/netbox/client/dcim/dcim_racks_units_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" +) + +// DcimRacksUnitsReader is a Reader for the DcimRacksUnits structure. +type DcimRacksUnitsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksUnitsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksUnitsOK() + 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()) + } +} + +// NewDcimRacksUnitsOK creates a DcimRacksUnitsOK with default headers values +func NewDcimRacksUnitsOK() *DcimRacksUnitsOK { + return &DcimRacksUnitsOK{} +} + +/*DcimRacksUnitsOK handles this case with default header values. + +DcimRacksUnitsOK dcim racks units o k +*/ +type DcimRacksUnitsOK struct { + Payload *models.Rack +} + +func (o *DcimRacksUnitsOK) Error() string { + return fmt.Sprintf("[GET /dcim/racks/{id}/units/][%d] dcimRacksUnitsOK %+v", 200, o.Payload) +} + +func (o *DcimRacksUnitsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Rack) + + // 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_racks_update_parameters.go b/netbox/client/dcim/dcim_racks_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4fce160e3bfc2c2c3b608d931327f8620c7b8a4e --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// NewDcimRacksUpdateParams creates a new DcimRacksUpdateParams object +// with the default values initialized. +func NewDcimRacksUpdateParams() *DcimRacksUpdateParams { + var () + return &DcimRacksUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRacksUpdateParamsWithTimeout creates a new DcimRacksUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRacksUpdateParamsWithTimeout(timeout time.Duration) *DcimRacksUpdateParams { + var () + return &DcimRacksUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRacksUpdateParamsWithContext creates a new DcimRacksUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRacksUpdateParamsWithContext(ctx context.Context) *DcimRacksUpdateParams { + var () + return &DcimRacksUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRacksUpdateParamsWithHTTPClient creates a new DcimRacksUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRacksUpdateParamsWithHTTPClient(client *http.Client) *DcimRacksUpdateParams { + var () + return &DcimRacksUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRacksUpdateParams contains all the parameters to send to the API endpoint +for the dcim racks update operation typically these are written to a http.Request +*/ +type DcimRacksUpdateParams struct { + + /*Data*/ + Data *models.WritableRack + /*ID + A unique integer value identifying this rack. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim racks update params +func (o *DcimRacksUpdateParams) WithTimeout(timeout time.Duration) *DcimRacksUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim racks update params +func (o *DcimRacksUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim racks update params +func (o *DcimRacksUpdateParams) WithContext(ctx context.Context) *DcimRacksUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim racks update params +func (o *DcimRacksUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim racks update params +func (o *DcimRacksUpdateParams) WithHTTPClient(client *http.Client) *DcimRacksUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim racks update params +func (o *DcimRacksUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim racks update params +func (o *DcimRacksUpdateParams) WithData(data *models.WritableRack) *DcimRacksUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim racks update params +func (o *DcimRacksUpdateParams) SetData(data *models.WritableRack) { + o.Data = data +} + +// WithID adds the id to the dcim racks update params +func (o *DcimRacksUpdateParams) WithID(id int64) *DcimRacksUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim racks update params +func (o *DcimRacksUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRacksUpdateParams) 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_racks_update_responses.go b/netbox/client/dcim/dcim_racks_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5e591f212f09e34d975b81db4340b8665cf0ed0f --- /dev/null +++ b/netbox/client/dcim/dcim_racks_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" +) + +// DcimRacksUpdateReader is a Reader for the DcimRacksUpdate structure. +type DcimRacksUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRacksUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRacksUpdateOK() + 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()) + } +} + +// NewDcimRacksUpdateOK creates a DcimRacksUpdateOK with default headers values +func NewDcimRacksUpdateOK() *DcimRacksUpdateOK { + return &DcimRacksUpdateOK{} +} + +/*DcimRacksUpdateOK handles this case with default header values. + +DcimRacksUpdateOK dcim racks update o k +*/ +type DcimRacksUpdateOK struct { + Payload *models.WritableRack +} + +func (o *DcimRacksUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/racks/{id}/][%d] dcimRacksUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRacksUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRack) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_regions_create_parameters.go b/netbox/client/dcim/dcim_regions_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2046f84db3647eb1aa3741f7cd3b069e5a0076fd --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// NewDcimRegionsCreateParams creates a new DcimRegionsCreateParams object +// with the default values initialized. +func NewDcimRegionsCreateParams() *DcimRegionsCreateParams { + var () + return &DcimRegionsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsCreateParamsWithTimeout creates a new DcimRegionsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsCreateParamsWithTimeout(timeout time.Duration) *DcimRegionsCreateParams { + var () + return &DcimRegionsCreateParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsCreateParamsWithContext creates a new DcimRegionsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsCreateParamsWithContext(ctx context.Context) *DcimRegionsCreateParams { + var () + return &DcimRegionsCreateParams{ + + Context: ctx, + } +} + +// NewDcimRegionsCreateParamsWithHTTPClient creates a new DcimRegionsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsCreateParamsWithHTTPClient(client *http.Client) *DcimRegionsCreateParams { + var () + return &DcimRegionsCreateParams{ + HTTPClient: client, + } +} + +/*DcimRegionsCreateParams contains all the parameters to send to the API endpoint +for the dcim regions create operation typically these are written to a http.Request +*/ +type DcimRegionsCreateParams struct { + + /*Data*/ + Data *models.WritableRegion + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions create params +func (o *DcimRegionsCreateParams) WithTimeout(timeout time.Duration) *DcimRegionsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions create params +func (o *DcimRegionsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions create params +func (o *DcimRegionsCreateParams) WithContext(ctx context.Context) *DcimRegionsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions create params +func (o *DcimRegionsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions create params +func (o *DcimRegionsCreateParams) WithHTTPClient(client *http.Client) *DcimRegionsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions create params +func (o *DcimRegionsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim regions create params +func (o *DcimRegionsCreateParams) WithData(data *models.WritableRegion) *DcimRegionsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim regions create params +func (o *DcimRegionsCreateParams) SetData(data *models.WritableRegion) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsCreateParams) 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_regions_create_responses.go b/netbox/client/dcim/dcim_regions_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fb5fa83ef2859f7e1b46dfc8735a8f9276086236 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// DcimRegionsCreateReader is a Reader for the DcimRegionsCreate structure. +type DcimRegionsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimRegionsCreateCreated() + 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()) + } +} + +// NewDcimRegionsCreateCreated creates a DcimRegionsCreateCreated with default headers values +func NewDcimRegionsCreateCreated() *DcimRegionsCreateCreated { + return &DcimRegionsCreateCreated{} +} + +/*DcimRegionsCreateCreated handles this case with default header values. + +DcimRegionsCreateCreated dcim regions create created +*/ +type DcimRegionsCreateCreated struct { + Payload *models.WritableRegion +} + +func (o *DcimRegionsCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/regions/][%d] dcimRegionsCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimRegionsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRegion) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_regions_delete_parameters.go b/netbox/client/dcim/dcim_regions_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5129f04cb700906dc2f0f27abc9cc6b969beeeed --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// NewDcimRegionsDeleteParams creates a new DcimRegionsDeleteParams object +// with the default values initialized. +func NewDcimRegionsDeleteParams() *DcimRegionsDeleteParams { + var () + return &DcimRegionsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsDeleteParamsWithTimeout creates a new DcimRegionsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsDeleteParamsWithTimeout(timeout time.Duration) *DcimRegionsDeleteParams { + var () + return &DcimRegionsDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsDeleteParamsWithContext creates a new DcimRegionsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsDeleteParamsWithContext(ctx context.Context) *DcimRegionsDeleteParams { + var () + return &DcimRegionsDeleteParams{ + + Context: ctx, + } +} + +// NewDcimRegionsDeleteParamsWithHTTPClient creates a new DcimRegionsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsDeleteParamsWithHTTPClient(client *http.Client) *DcimRegionsDeleteParams { + var () + return &DcimRegionsDeleteParams{ + HTTPClient: client, + } +} + +/*DcimRegionsDeleteParams contains all the parameters to send to the API endpoint +for the dcim regions delete operation typically these are written to a http.Request +*/ +type DcimRegionsDeleteParams struct { + + /*ID + A unique integer value identifying this region. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions delete params +func (o *DcimRegionsDeleteParams) WithTimeout(timeout time.Duration) *DcimRegionsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions delete params +func (o *DcimRegionsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions delete params +func (o *DcimRegionsDeleteParams) WithContext(ctx context.Context) *DcimRegionsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions delete params +func (o *DcimRegionsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions delete params +func (o *DcimRegionsDeleteParams) WithHTTPClient(client *http.Client) *DcimRegionsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions delete params +func (o *DcimRegionsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim regions delete params +func (o *DcimRegionsDeleteParams) WithID(id int64) *DcimRegionsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions delete params +func (o *DcimRegionsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsDeleteParams) 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_regions_delete_responses.go b/netbox/client/dcim/dcim_regions_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..debc754261b092b527171f73198e695574ca0154 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// DcimRegionsDeleteReader is a Reader for the DcimRegionsDelete structure. +type DcimRegionsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimRegionsDeleteNoContent() + 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()) + } +} + +// NewDcimRegionsDeleteNoContent creates a DcimRegionsDeleteNoContent with default headers values +func NewDcimRegionsDeleteNoContent() *DcimRegionsDeleteNoContent { + return &DcimRegionsDeleteNoContent{} +} + +/*DcimRegionsDeleteNoContent handles this case with default header values. + +DcimRegionsDeleteNoContent dcim regions delete no content +*/ +type DcimRegionsDeleteNoContent struct { +} + +func (o *DcimRegionsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/regions/{id}/][%d] dcimRegionsDeleteNoContent ", 204) +} + +func (o *DcimRegionsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_regions_list_parameters.go b/netbox/client/dcim/dcim_regions_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dcd08dae62ab8f11acecc868c31c4b02e207be17 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_list_parameters.go @@ -0,0 +1,326 @@ +// 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" +) + +// NewDcimRegionsListParams creates a new DcimRegionsListParams object +// with the default values initialized. +func NewDcimRegionsListParams() *DcimRegionsListParams { + var () + return &DcimRegionsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsListParamsWithTimeout creates a new DcimRegionsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsListParamsWithTimeout(timeout time.Duration) *DcimRegionsListParams { + var () + return &DcimRegionsListParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsListParamsWithContext creates a new DcimRegionsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsListParamsWithContext(ctx context.Context) *DcimRegionsListParams { + var () + return &DcimRegionsListParams{ + + Context: ctx, + } +} + +// NewDcimRegionsListParamsWithHTTPClient creates a new DcimRegionsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsListParamsWithHTTPClient(client *http.Client) *DcimRegionsListParams { + var () + return &DcimRegionsListParams{ + HTTPClient: client, + } +} + +/*DcimRegionsListParams contains all the parameters to send to the API endpoint +for the dcim regions list operation typically these are written to a http.Request +*/ +type DcimRegionsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Parent*/ + Parent *string + /*ParentID*/ + ParentID *string + /*Q*/ + Q *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions list params +func (o *DcimRegionsListParams) WithTimeout(timeout time.Duration) *DcimRegionsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions list params +func (o *DcimRegionsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions list params +func (o *DcimRegionsListParams) WithContext(ctx context.Context) *DcimRegionsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions list params +func (o *DcimRegionsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions list params +func (o *DcimRegionsListParams) WithHTTPClient(client *http.Client) *DcimRegionsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions list params +func (o *DcimRegionsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the dcim regions list params +func (o *DcimRegionsListParams) WithLimit(limit *int64) *DcimRegionsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim regions list params +func (o *DcimRegionsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim regions list params +func (o *DcimRegionsListParams) WithName(name *string) *DcimRegionsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim regions list params +func (o *DcimRegionsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim regions list params +func (o *DcimRegionsListParams) WithOffset(offset *int64) *DcimRegionsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim regions list params +func (o *DcimRegionsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithParent adds the parent to the dcim regions list params +func (o *DcimRegionsListParams) WithParent(parent *string) *DcimRegionsListParams { + o.SetParent(parent) + return o +} + +// SetParent adds the parent to the dcim regions list params +func (o *DcimRegionsListParams) SetParent(parent *string) { + o.Parent = parent +} + +// WithParentID adds the parentID to the dcim regions list params +func (o *DcimRegionsListParams) WithParentID(parentID *string) *DcimRegionsListParams { + o.SetParentID(parentID) + return o +} + +// SetParentID adds the parentId to the dcim regions list params +func (o *DcimRegionsListParams) SetParentID(parentID *string) { + o.ParentID = parentID +} + +// WithQ adds the q to the dcim regions list params +func (o *DcimRegionsListParams) WithQ(q *string) *DcimRegionsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim regions list params +func (o *DcimRegionsListParams) SetQ(q *string) { + o.Q = q +} + +// WithSlug adds the slug to the dcim regions list params +func (o *DcimRegionsListParams) WithSlug(slug *string) *DcimRegionsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim regions list params +func (o *DcimRegionsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.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.ParentID != nil { + + // query param parent_id + var qrParentID string + if o.ParentID != nil { + qrParentID = *o.ParentID + } + qParentID := qrParentID + if qParentID != "" { + if err := r.SetQueryParam("parent_id", qParentID); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_regions_list_responses.go b/netbox/client/dcim/dcim_regions_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..812928ad1988f866e7c5f6b12583ea62a6e491db --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// DcimRegionsListReader is a Reader for the DcimRegionsList structure. +type DcimRegionsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRegionsListOK() + 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()) + } +} + +// NewDcimRegionsListOK creates a DcimRegionsListOK with default headers values +func NewDcimRegionsListOK() *DcimRegionsListOK { + return &DcimRegionsListOK{} +} + +/*DcimRegionsListOK handles this case with default header values. + +DcimRegionsListOK dcim regions list o k +*/ +type DcimRegionsListOK struct { + Payload *models.DcimRegionsListOKBody +} + +func (o *DcimRegionsListOK) Error() string { + return fmt.Sprintf("[GET /dcim/regions/][%d] dcimRegionsListOK %+v", 200, o.Payload) +} + +func (o *DcimRegionsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimRegionsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_regions_partial_update_parameters.go b/netbox/client/dcim/dcim_regions_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6ea231a6a9bc5d243b7cadbf8b7f2b1f263cb417 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// NewDcimRegionsPartialUpdateParams creates a new DcimRegionsPartialUpdateParams object +// with the default values initialized. +func NewDcimRegionsPartialUpdateParams() *DcimRegionsPartialUpdateParams { + var () + return &DcimRegionsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsPartialUpdateParamsWithTimeout creates a new DcimRegionsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimRegionsPartialUpdateParams { + var () + return &DcimRegionsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsPartialUpdateParamsWithContext creates a new DcimRegionsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsPartialUpdateParamsWithContext(ctx context.Context) *DcimRegionsPartialUpdateParams { + var () + return &DcimRegionsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRegionsPartialUpdateParamsWithHTTPClient creates a new DcimRegionsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimRegionsPartialUpdateParams { + var () + return &DcimRegionsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRegionsPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim regions partial update operation typically these are written to a http.Request +*/ +type DcimRegionsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableRegion + /*ID + A unique integer value identifying this region. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimRegionsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithContext(ctx context.Context) *DcimRegionsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimRegionsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithData(data *models.WritableRegion) *DcimRegionsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetData(data *models.WritableRegion) { + o.Data = data +} + +// WithID adds the id to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) WithID(id int64) *DcimRegionsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions partial update params +func (o *DcimRegionsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsPartialUpdateParams) 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_regions_partial_update_responses.go b/netbox/client/dcim/dcim_regions_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e0fbbc63b1f2b9a547cd15246dc3145f23bf6318 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// DcimRegionsPartialUpdateReader is a Reader for the DcimRegionsPartialUpdate structure. +type DcimRegionsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRegionsPartialUpdateOK() + 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()) + } +} + +// NewDcimRegionsPartialUpdateOK creates a DcimRegionsPartialUpdateOK with default headers values +func NewDcimRegionsPartialUpdateOK() *DcimRegionsPartialUpdateOK { + return &DcimRegionsPartialUpdateOK{} +} + +/*DcimRegionsPartialUpdateOK handles this case with default header values. + +DcimRegionsPartialUpdateOK dcim regions partial update o k +*/ +type DcimRegionsPartialUpdateOK struct { + Payload *models.WritableRegion +} + +func (o *DcimRegionsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/regions/{id}/][%d] dcimRegionsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRegionsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRegion) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_regions_read_parameters.go b/netbox/client/dcim/dcim_regions_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..85ab6ffd0c3f8942a17ae5969b0fa10952e9b500 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// NewDcimRegionsReadParams creates a new DcimRegionsReadParams object +// with the default values initialized. +func NewDcimRegionsReadParams() *DcimRegionsReadParams { + var () + return &DcimRegionsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsReadParamsWithTimeout creates a new DcimRegionsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsReadParamsWithTimeout(timeout time.Duration) *DcimRegionsReadParams { + var () + return &DcimRegionsReadParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsReadParamsWithContext creates a new DcimRegionsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsReadParamsWithContext(ctx context.Context) *DcimRegionsReadParams { + var () + return &DcimRegionsReadParams{ + + Context: ctx, + } +} + +// NewDcimRegionsReadParamsWithHTTPClient creates a new DcimRegionsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsReadParamsWithHTTPClient(client *http.Client) *DcimRegionsReadParams { + var () + return &DcimRegionsReadParams{ + HTTPClient: client, + } +} + +/*DcimRegionsReadParams contains all the parameters to send to the API endpoint +for the dcim regions read operation typically these are written to a http.Request +*/ +type DcimRegionsReadParams struct { + + /*ID + A unique integer value identifying this region. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions read params +func (o *DcimRegionsReadParams) WithTimeout(timeout time.Duration) *DcimRegionsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions read params +func (o *DcimRegionsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions read params +func (o *DcimRegionsReadParams) WithContext(ctx context.Context) *DcimRegionsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions read params +func (o *DcimRegionsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions read params +func (o *DcimRegionsReadParams) WithHTTPClient(client *http.Client) *DcimRegionsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions read params +func (o *DcimRegionsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim regions read params +func (o *DcimRegionsReadParams) WithID(id int64) *DcimRegionsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions read params +func (o *DcimRegionsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsReadParams) 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_regions_read_responses.go b/netbox/client/dcim/dcim_regions_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fe5fdc616a8445f5262e7dd5a7f4c7f880be0847 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// DcimRegionsReadReader is a Reader for the DcimRegionsRead structure. +type DcimRegionsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRegionsReadOK() + 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()) + } +} + +// NewDcimRegionsReadOK creates a DcimRegionsReadOK with default headers values +func NewDcimRegionsReadOK() *DcimRegionsReadOK { + return &DcimRegionsReadOK{} +} + +/*DcimRegionsReadOK handles this case with default header values. + +DcimRegionsReadOK dcim regions read o k +*/ +type DcimRegionsReadOK struct { + Payload *models.Region +} + +func (o *DcimRegionsReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/regions/{id}/][%d] dcimRegionsReadOK %+v", 200, o.Payload) +} + +func (o *DcimRegionsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Region) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/dcim/dcim_regions_update_parameters.go b/netbox/client/dcim/dcim_regions_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..497b704f3331e069c3dc9e5f3d126e2771e04629 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// NewDcimRegionsUpdateParams creates a new DcimRegionsUpdateParams object +// with the default values initialized. +func NewDcimRegionsUpdateParams() *DcimRegionsUpdateParams { + var () + return &DcimRegionsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimRegionsUpdateParamsWithTimeout creates a new DcimRegionsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimRegionsUpdateParamsWithTimeout(timeout time.Duration) *DcimRegionsUpdateParams { + var () + return &DcimRegionsUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimRegionsUpdateParamsWithContext creates a new DcimRegionsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimRegionsUpdateParamsWithContext(ctx context.Context) *DcimRegionsUpdateParams { + var () + return &DcimRegionsUpdateParams{ + + Context: ctx, + } +} + +// NewDcimRegionsUpdateParamsWithHTTPClient creates a new DcimRegionsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimRegionsUpdateParamsWithHTTPClient(client *http.Client) *DcimRegionsUpdateParams { + var () + return &DcimRegionsUpdateParams{ + HTTPClient: client, + } +} + +/*DcimRegionsUpdateParams contains all the parameters to send to the API endpoint +for the dcim regions update operation typically these are written to a http.Request +*/ +type DcimRegionsUpdateParams struct { + + /*Data*/ + Data *models.WritableRegion + /*ID + A unique integer value identifying this region. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithTimeout(timeout time.Duration) *DcimRegionsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithContext(ctx context.Context) *DcimRegionsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithHTTPClient(client *http.Client) *DcimRegionsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithData(data *models.WritableRegion) *DcimRegionsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetData(data *models.WritableRegion) { + o.Data = data +} + +// WithID adds the id to the dcim regions update params +func (o *DcimRegionsUpdateParams) WithID(id int64) *DcimRegionsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim regions update params +func (o *DcimRegionsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimRegionsUpdateParams) 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_regions_update_responses.go b/netbox/client/dcim/dcim_regions_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e62cb7a4ab7cd0204bb8d54af983a410abf91807 --- /dev/null +++ b/netbox/client/dcim/dcim_regions_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" +) + +// DcimRegionsUpdateReader is a Reader for the DcimRegionsUpdate structure. +type DcimRegionsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimRegionsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimRegionsUpdateOK() + 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()) + } +} + +// NewDcimRegionsUpdateOK creates a DcimRegionsUpdateOK with default headers values +func NewDcimRegionsUpdateOK() *DcimRegionsUpdateOK { + return &DcimRegionsUpdateOK{} +} + +/*DcimRegionsUpdateOK handles this case with default header values. + +DcimRegionsUpdateOK dcim regions update o k +*/ +type DcimRegionsUpdateOK struct { + Payload *models.WritableRegion +} + +func (o *DcimRegionsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/regions/{id}/][%d] dcimRegionsUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimRegionsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableRegion) + + // 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_sites_create_parameters.go b/netbox/client/dcim/dcim_sites_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4a4455870899cff3dcd0c8122e88975d50cadac1 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// NewDcimSitesCreateParams creates a new DcimSitesCreateParams object +// with the default values initialized. +func NewDcimSitesCreateParams() *DcimSitesCreateParams { + var () + return &DcimSitesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesCreateParamsWithTimeout creates a new DcimSitesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesCreateParamsWithTimeout(timeout time.Duration) *DcimSitesCreateParams { + var () + return &DcimSitesCreateParams{ + + timeout: timeout, + } +} + +// NewDcimSitesCreateParamsWithContext creates a new DcimSitesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesCreateParamsWithContext(ctx context.Context) *DcimSitesCreateParams { + var () + return &DcimSitesCreateParams{ + + Context: ctx, + } +} + +// NewDcimSitesCreateParamsWithHTTPClient creates a new DcimSitesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesCreateParamsWithHTTPClient(client *http.Client) *DcimSitesCreateParams { + var () + return &DcimSitesCreateParams{ + HTTPClient: client, + } +} + +/*DcimSitesCreateParams contains all the parameters to send to the API endpoint +for the dcim sites create operation typically these are written to a http.Request +*/ +type DcimSitesCreateParams struct { + + /*Data*/ + Data *models.WritableSite + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites create params +func (o *DcimSitesCreateParams) WithTimeout(timeout time.Duration) *DcimSitesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites create params +func (o *DcimSitesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites create params +func (o *DcimSitesCreateParams) WithContext(ctx context.Context) *DcimSitesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites create params +func (o *DcimSitesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites create params +func (o *DcimSitesCreateParams) WithHTTPClient(client *http.Client) *DcimSitesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites create params +func (o *DcimSitesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim sites create params +func (o *DcimSitesCreateParams) WithData(data *models.WritableSite) *DcimSitesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim sites create params +func (o *DcimSitesCreateParams) SetData(data *models.WritableSite) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesCreateParams) 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_sites_create_responses.go b/netbox/client/dcim/dcim_sites_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8abb80ed27bb849ba24f432c4f34a528a1280d2f --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// DcimSitesCreateReader is a Reader for the DcimSitesCreate structure. +type DcimSitesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewDcimSitesCreateCreated() + 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()) + } +} + +// NewDcimSitesCreateCreated creates a DcimSitesCreateCreated with default headers values +func NewDcimSitesCreateCreated() *DcimSitesCreateCreated { + return &DcimSitesCreateCreated{} +} + +/*DcimSitesCreateCreated handles this case with default header values. + +DcimSitesCreateCreated dcim sites create created +*/ +type DcimSitesCreateCreated struct { + Payload *models.WritableSite +} + +func (o *DcimSitesCreateCreated) Error() string { + return fmt.Sprintf("[POST /dcim/sites/][%d] dcimSitesCreateCreated %+v", 201, o.Payload) +} + +func (o *DcimSitesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSite) + + // 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_sites_delete_parameters.go b/netbox/client/dcim/dcim_sites_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2962d4f03e3c6cf96db75363fb88a2e9e0f320c0 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// NewDcimSitesDeleteParams creates a new DcimSitesDeleteParams object +// with the default values initialized. +func NewDcimSitesDeleteParams() *DcimSitesDeleteParams { + var () + return &DcimSitesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesDeleteParamsWithTimeout creates a new DcimSitesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesDeleteParamsWithTimeout(timeout time.Duration) *DcimSitesDeleteParams { + var () + return &DcimSitesDeleteParams{ + + timeout: timeout, + } +} + +// NewDcimSitesDeleteParamsWithContext creates a new DcimSitesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesDeleteParamsWithContext(ctx context.Context) *DcimSitesDeleteParams { + var () + return &DcimSitesDeleteParams{ + + Context: ctx, + } +} + +// NewDcimSitesDeleteParamsWithHTTPClient creates a new DcimSitesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesDeleteParamsWithHTTPClient(client *http.Client) *DcimSitesDeleteParams { + var () + return &DcimSitesDeleteParams{ + HTTPClient: client, + } +} + +/*DcimSitesDeleteParams contains all the parameters to send to the API endpoint +for the dcim sites delete operation typically these are written to a http.Request +*/ +type DcimSitesDeleteParams struct { + + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites delete params +func (o *DcimSitesDeleteParams) WithTimeout(timeout time.Duration) *DcimSitesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites delete params +func (o *DcimSitesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites delete params +func (o *DcimSitesDeleteParams) WithContext(ctx context.Context) *DcimSitesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites delete params +func (o *DcimSitesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites delete params +func (o *DcimSitesDeleteParams) WithHTTPClient(client *http.Client) *DcimSitesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites delete params +func (o *DcimSitesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim sites delete params +func (o *DcimSitesDeleteParams) WithID(id int64) *DcimSitesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites delete params +func (o *DcimSitesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesDeleteParams) 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_sites_delete_responses.go b/netbox/client/dcim/dcim_sites_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d87985826452f223fb361e1f8c9fcadb712878cc --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// DcimSitesDeleteReader is a Reader for the DcimSitesDelete structure. +type DcimSitesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewDcimSitesDeleteNoContent() + 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()) + } +} + +// NewDcimSitesDeleteNoContent creates a DcimSitesDeleteNoContent with default headers values +func NewDcimSitesDeleteNoContent() *DcimSitesDeleteNoContent { + return &DcimSitesDeleteNoContent{} +} + +/*DcimSitesDeleteNoContent handles this case with default header values. + +DcimSitesDeleteNoContent dcim sites delete no content +*/ +type DcimSitesDeleteNoContent struct { +} + +func (o *DcimSitesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /dcim/sites/{id}/][%d] dcimSitesDeleteNoContent ", 204) +} + +func (o *DcimSitesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/dcim/dcim_sites_graphs_parameters.go b/netbox/client/dcim/dcim_sites_graphs_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..342f624012ce05b3b718cb30fb2ca51215996c0a --- /dev/null +++ b/netbox/client/dcim/dcim_sites_graphs_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" +) + +// NewDcimSitesGraphsParams creates a new DcimSitesGraphsParams object +// with the default values initialized. +func NewDcimSitesGraphsParams() *DcimSitesGraphsParams { + var () + return &DcimSitesGraphsParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesGraphsParamsWithTimeout creates a new DcimSitesGraphsParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesGraphsParamsWithTimeout(timeout time.Duration) *DcimSitesGraphsParams { + var () + return &DcimSitesGraphsParams{ + + timeout: timeout, + } +} + +// NewDcimSitesGraphsParamsWithContext creates a new DcimSitesGraphsParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesGraphsParamsWithContext(ctx context.Context) *DcimSitesGraphsParams { + var () + return &DcimSitesGraphsParams{ + + Context: ctx, + } +} + +// NewDcimSitesGraphsParamsWithHTTPClient creates a new DcimSitesGraphsParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesGraphsParamsWithHTTPClient(client *http.Client) *DcimSitesGraphsParams { + var () + return &DcimSitesGraphsParams{ + HTTPClient: client, + } +} + +/*DcimSitesGraphsParams contains all the parameters to send to the API endpoint +for the dcim sites graphs operation typically these are written to a http.Request +*/ +type DcimSitesGraphsParams struct { + + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites graphs params +func (o *DcimSitesGraphsParams) WithTimeout(timeout time.Duration) *DcimSitesGraphsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites graphs params +func (o *DcimSitesGraphsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites graphs params +func (o *DcimSitesGraphsParams) WithContext(ctx context.Context) *DcimSitesGraphsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites graphs params +func (o *DcimSitesGraphsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites graphs params +func (o *DcimSitesGraphsParams) WithHTTPClient(client *http.Client) *DcimSitesGraphsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites graphs params +func (o *DcimSitesGraphsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim sites graphs params +func (o *DcimSitesGraphsParams) WithID(id int64) *DcimSitesGraphsParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites graphs params +func (o *DcimSitesGraphsParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesGraphsParams) 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_sites_graphs_responses.go b/netbox/client/dcim/dcim_sites_graphs_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..30c111765ea985504215d3aab5f68d45b5978377 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_graphs_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" +) + +// DcimSitesGraphsReader is a Reader for the DcimSitesGraphs structure. +type DcimSitesGraphsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesGraphsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesGraphsOK() + 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()) + } +} + +// NewDcimSitesGraphsOK creates a DcimSitesGraphsOK with default headers values +func NewDcimSitesGraphsOK() *DcimSitesGraphsOK { + return &DcimSitesGraphsOK{} +} + +/*DcimSitesGraphsOK handles this case with default header values. + +DcimSitesGraphsOK dcim sites graphs o k +*/ +type DcimSitesGraphsOK struct { + Payload *models.Site +} + +func (o *DcimSitesGraphsOK) Error() string { + return fmt.Sprintf("[GET /dcim/sites/{id}/graphs/][%d] dcimSitesGraphsOK %+v", 200, o.Payload) +} + +func (o *DcimSitesGraphsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Site) + + // 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_sites_list_parameters.go b/netbox/client/dcim/dcim_sites_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..97212e51a175482643dcc23d7b75bc61546cf61c --- /dev/null +++ b/netbox/client/dcim/dcim_sites_list_parameters.go @@ -0,0 +1,561 @@ +// 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" +) + +// NewDcimSitesListParams creates a new DcimSitesListParams object +// with the default values initialized. +func NewDcimSitesListParams() *DcimSitesListParams { + var () + return &DcimSitesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesListParamsWithTimeout creates a new DcimSitesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesListParamsWithTimeout(timeout time.Duration) *DcimSitesListParams { + var () + return &DcimSitesListParams{ + + timeout: timeout, + } +} + +// NewDcimSitesListParamsWithContext creates a new DcimSitesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesListParamsWithContext(ctx context.Context) *DcimSitesListParams { + var () + return &DcimSitesListParams{ + + Context: ctx, + } +} + +// NewDcimSitesListParamsWithHTTPClient creates a new DcimSitesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesListParamsWithHTTPClient(client *http.Client) *DcimSitesListParams { + var () + return &DcimSitesListParams{ + HTTPClient: client, + } +} + +/*DcimSitesListParams contains all the parameters to send to the API endpoint +for the dcim sites list operation typically these are written to a http.Request +*/ +type DcimSitesListParams struct { + + /*Asn*/ + Asn *float64 + /*ContactEmail*/ + ContactEmail *string + /*ContactName*/ + ContactName *string + /*ContactPhone*/ + ContactPhone *string + /*Facility*/ + Facility *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Region*/ + Region *string + /*RegionID*/ + RegionID *string + /*Slug*/ + Slug *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites list params +func (o *DcimSitesListParams) WithTimeout(timeout time.Duration) *DcimSitesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites list params +func (o *DcimSitesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites list params +func (o *DcimSitesListParams) WithContext(ctx context.Context) *DcimSitesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites list params +func (o *DcimSitesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites list params +func (o *DcimSitesListParams) WithHTTPClient(client *http.Client) *DcimSitesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites list params +func (o *DcimSitesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithAsn adds the asn to the dcim sites list params +func (o *DcimSitesListParams) WithAsn(asn *float64) *DcimSitesListParams { + o.SetAsn(asn) + return o +} + +// SetAsn adds the asn to the dcim sites list params +func (o *DcimSitesListParams) SetAsn(asn *float64) { + o.Asn = asn +} + +// WithContactEmail adds the contactEmail to the dcim sites list params +func (o *DcimSitesListParams) WithContactEmail(contactEmail *string) *DcimSitesListParams { + o.SetContactEmail(contactEmail) + return o +} + +// SetContactEmail adds the contactEmail to the dcim sites list params +func (o *DcimSitesListParams) SetContactEmail(contactEmail *string) { + o.ContactEmail = contactEmail +} + +// WithContactName adds the contactName to the dcim sites list params +func (o *DcimSitesListParams) WithContactName(contactName *string) *DcimSitesListParams { + o.SetContactName(contactName) + return o +} + +// SetContactName adds the contactName to the dcim sites list params +func (o *DcimSitesListParams) SetContactName(contactName *string) { + o.ContactName = contactName +} + +// WithContactPhone adds the contactPhone to the dcim sites list params +func (o *DcimSitesListParams) WithContactPhone(contactPhone *string) *DcimSitesListParams { + o.SetContactPhone(contactPhone) + return o +} + +// SetContactPhone adds the contactPhone to the dcim sites list params +func (o *DcimSitesListParams) SetContactPhone(contactPhone *string) { + o.ContactPhone = contactPhone +} + +// WithFacility adds the facility to the dcim sites list params +func (o *DcimSitesListParams) WithFacility(facility *string) *DcimSitesListParams { + o.SetFacility(facility) + return o +} + +// SetFacility adds the facility to the dcim sites list params +func (o *DcimSitesListParams) SetFacility(facility *string) { + o.Facility = facility +} + +// WithIDIn adds the iDIn to the dcim sites list params +func (o *DcimSitesListParams) WithIDIn(iDIn *float64) *DcimSitesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the dcim sites list params +func (o *DcimSitesListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the dcim sites list params +func (o *DcimSitesListParams) WithLimit(limit *int64) *DcimSitesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the dcim sites list params +func (o *DcimSitesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the dcim sites list params +func (o *DcimSitesListParams) WithName(name *string) *DcimSitesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the dcim sites list params +func (o *DcimSitesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the dcim sites list params +func (o *DcimSitesListParams) WithOffset(offset *int64) *DcimSitesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the dcim sites list params +func (o *DcimSitesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the dcim sites list params +func (o *DcimSitesListParams) WithQ(q *string) *DcimSitesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the dcim sites list params +func (o *DcimSitesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRegion adds the region to the dcim sites list params +func (o *DcimSitesListParams) WithRegion(region *string) *DcimSitesListParams { + o.SetRegion(region) + return o +} + +// SetRegion adds the region to the dcim sites list params +func (o *DcimSitesListParams) SetRegion(region *string) { + o.Region = region +} + +// WithRegionID adds the regionID to the dcim sites list params +func (o *DcimSitesListParams) WithRegionID(regionID *string) *DcimSitesListParams { + o.SetRegionID(regionID) + return o +} + +// SetRegionID adds the regionId to the dcim sites list params +func (o *DcimSitesListParams) SetRegionID(regionID *string) { + o.RegionID = regionID +} + +// WithSlug adds the slug to the dcim sites list params +func (o *DcimSitesListParams) WithSlug(slug *string) *DcimSitesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the dcim sites list params +func (o *DcimSitesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WithTenant adds the tenant to the dcim sites list params +func (o *DcimSitesListParams) WithTenant(tenant *string) *DcimSitesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the dcim sites list params +func (o *DcimSitesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the dcim sites list params +func (o *DcimSitesListParams) WithTenantID(tenantID *string) *DcimSitesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the dcim sites list params +func (o *DcimSitesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Asn != nil { + + // query param asn + var qrAsn float64 + if o.Asn != nil { + qrAsn = *o.Asn + } + qAsn := swag.FormatFloat64(qrAsn) + if qAsn != "" { + if err := r.SetQueryParam("asn", qAsn); err != nil { + return err + } + } + + } + + if o.ContactEmail != nil { + + // query param contact_email + var qrContactEmail string + if o.ContactEmail != nil { + qrContactEmail = *o.ContactEmail + } + qContactEmail := qrContactEmail + if qContactEmail != "" { + if err := r.SetQueryParam("contact_email", qContactEmail); err != nil { + return err + } + } + + } + + if o.ContactName != nil { + + // query param contact_name + var qrContactName string + if o.ContactName != nil { + qrContactName = *o.ContactName + } + qContactName := qrContactName + if qContactName != "" { + if err := r.SetQueryParam("contact_name", qContactName); err != nil { + return err + } + } + + } + + if o.ContactPhone != nil { + + // query param contact_phone + var qrContactPhone string + if o.ContactPhone != nil { + qrContactPhone = *o.ContactPhone + } + qContactPhone := qrContactPhone + if qContactPhone != "" { + if err := r.SetQueryParam("contact_phone", qContactPhone); err != nil { + return err + } + } + + } + + if o.Facility != nil { + + // query param facility + var qrFacility string + if o.Facility != nil { + qrFacility = *o.Facility + } + qFacility := qrFacility + if qFacility != "" { + if err := r.SetQueryParam("facility", qFacility); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Region != nil { + + // query param region + var qrRegion string + if o.Region != nil { + qrRegion = *o.Region + } + qRegion := qrRegion + if qRegion != "" { + if err := r.SetQueryParam("region", qRegion); err != nil { + return err + } + } + + } + + if o.RegionID != nil { + + // query param region_id + var qrRegionID string + if o.RegionID != nil { + qrRegionID = *o.RegionID + } + qRegionID := qrRegionID + if qRegionID != "" { + if err := r.SetQueryParam("region_id", qRegionID); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if o.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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/dcim/dcim_sites_list_responses.go b/netbox/client/dcim/dcim_sites_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..07607af2cb93966ac43398d373202e2039135384 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// DcimSitesListReader is a Reader for the DcimSitesList structure. +type DcimSitesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesListOK() + 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()) + } +} + +// NewDcimSitesListOK creates a DcimSitesListOK with default headers values +func NewDcimSitesListOK() *DcimSitesListOK { + return &DcimSitesListOK{} +} + +/*DcimSitesListOK handles this case with default header values. + +DcimSitesListOK dcim sites list o k +*/ +type DcimSitesListOK struct { + Payload *models.DcimSitesListOKBody +} + +func (o *DcimSitesListOK) Error() string { + return fmt.Sprintf("[GET /dcim/sites/][%d] dcimSitesListOK %+v", 200, o.Payload) +} + +func (o *DcimSitesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.DcimSitesListOKBody) + + // 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_sites_partial_update_parameters.go b/netbox/client/dcim/dcim_sites_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0806d8e10a716496bc9d791997c173f4550708e0 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// NewDcimSitesPartialUpdateParams creates a new DcimSitesPartialUpdateParams object +// with the default values initialized. +func NewDcimSitesPartialUpdateParams() *DcimSitesPartialUpdateParams { + var () + return &DcimSitesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesPartialUpdateParamsWithTimeout creates a new DcimSitesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimSitesPartialUpdateParams { + var () + return &DcimSitesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimSitesPartialUpdateParamsWithContext creates a new DcimSitesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesPartialUpdateParamsWithContext(ctx context.Context) *DcimSitesPartialUpdateParams { + var () + return &DcimSitesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewDcimSitesPartialUpdateParamsWithHTTPClient creates a new DcimSitesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimSitesPartialUpdateParams { + var () + return &DcimSitesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*DcimSitesPartialUpdateParams contains all the parameters to send to the API endpoint +for the dcim sites partial update operation typically these are written to a http.Request +*/ +type DcimSitesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableSite + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimSitesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithContext(ctx context.Context) *DcimSitesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimSitesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithData(data *models.WritableSite) *DcimSitesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetData(data *models.WritableSite) { + o.Data = data +} + +// WithID adds the id to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) WithID(id int64) *DcimSitesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites partial update params +func (o *DcimSitesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesPartialUpdateParams) 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_sites_partial_update_responses.go b/netbox/client/dcim/dcim_sites_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..285d952bfc1da61bf11d6b0a4199ee0d73cf4c26 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// DcimSitesPartialUpdateReader is a Reader for the DcimSitesPartialUpdate structure. +type DcimSitesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesPartialUpdateOK() + 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()) + } +} + +// NewDcimSitesPartialUpdateOK creates a DcimSitesPartialUpdateOK with default headers values +func NewDcimSitesPartialUpdateOK() *DcimSitesPartialUpdateOK { + return &DcimSitesPartialUpdateOK{} +} + +/*DcimSitesPartialUpdateOK handles this case with default header values. + +DcimSitesPartialUpdateOK dcim sites partial update o k +*/ +type DcimSitesPartialUpdateOK struct { + Payload *models.WritableSite +} + +func (o *DcimSitesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /dcim/sites/{id}/][%d] dcimSitesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimSitesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSite) + + // 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_sites_read_parameters.go b/netbox/client/dcim/dcim_sites_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..66caf1a139fedcc1f9869fbce04f441b8f651ad0 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// NewDcimSitesReadParams creates a new DcimSitesReadParams object +// with the default values initialized. +func NewDcimSitesReadParams() *DcimSitesReadParams { + var () + return &DcimSitesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesReadParamsWithTimeout creates a new DcimSitesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesReadParamsWithTimeout(timeout time.Duration) *DcimSitesReadParams { + var () + return &DcimSitesReadParams{ + + timeout: timeout, + } +} + +// NewDcimSitesReadParamsWithContext creates a new DcimSitesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesReadParamsWithContext(ctx context.Context) *DcimSitesReadParams { + var () + return &DcimSitesReadParams{ + + Context: ctx, + } +} + +// NewDcimSitesReadParamsWithHTTPClient creates a new DcimSitesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesReadParamsWithHTTPClient(client *http.Client) *DcimSitesReadParams { + var () + return &DcimSitesReadParams{ + HTTPClient: client, + } +} + +/*DcimSitesReadParams contains all the parameters to send to the API endpoint +for the dcim sites read operation typically these are written to a http.Request +*/ +type DcimSitesReadParams struct { + + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites read params +func (o *DcimSitesReadParams) WithTimeout(timeout time.Duration) *DcimSitesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites read params +func (o *DcimSitesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites read params +func (o *DcimSitesReadParams) WithContext(ctx context.Context) *DcimSitesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites read params +func (o *DcimSitesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites read params +func (o *DcimSitesReadParams) WithHTTPClient(client *http.Client) *DcimSitesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites read params +func (o *DcimSitesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the dcim sites read params +func (o *DcimSitesReadParams) WithID(id int64) *DcimSitesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites read params +func (o *DcimSitesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesReadParams) 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_sites_read_responses.go b/netbox/client/dcim/dcim_sites_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..471f8350c2515d56de30ded3ffdc979d8b00b9b0 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// DcimSitesReadReader is a Reader for the DcimSitesRead structure. +type DcimSitesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesReadOK() + 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()) + } +} + +// NewDcimSitesReadOK creates a DcimSitesReadOK with default headers values +func NewDcimSitesReadOK() *DcimSitesReadOK { + return &DcimSitesReadOK{} +} + +/*DcimSitesReadOK handles this case with default header values. + +DcimSitesReadOK dcim sites read o k +*/ +type DcimSitesReadOK struct { + Payload *models.Site +} + +func (o *DcimSitesReadOK) Error() string { + return fmt.Sprintf("[GET /dcim/sites/{id}/][%d] dcimSitesReadOK %+v", 200, o.Payload) +} + +func (o *DcimSitesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Site) + + // 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_sites_update_parameters.go b/netbox/client/dcim/dcim_sites_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8d5b7a2a70226875e970b1db2274f48ab8cc4c21 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// NewDcimSitesUpdateParams creates a new DcimSitesUpdateParams object +// with the default values initialized. +func NewDcimSitesUpdateParams() *DcimSitesUpdateParams { + var () + return &DcimSitesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewDcimSitesUpdateParamsWithTimeout creates a new DcimSitesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewDcimSitesUpdateParamsWithTimeout(timeout time.Duration) *DcimSitesUpdateParams { + var () + return &DcimSitesUpdateParams{ + + timeout: timeout, + } +} + +// NewDcimSitesUpdateParamsWithContext creates a new DcimSitesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewDcimSitesUpdateParamsWithContext(ctx context.Context) *DcimSitesUpdateParams { + var () + return &DcimSitesUpdateParams{ + + Context: ctx, + } +} + +// NewDcimSitesUpdateParamsWithHTTPClient creates a new DcimSitesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewDcimSitesUpdateParamsWithHTTPClient(client *http.Client) *DcimSitesUpdateParams { + var () + return &DcimSitesUpdateParams{ + HTTPClient: client, + } +} + +/*DcimSitesUpdateParams contains all the parameters to send to the API endpoint +for the dcim sites update operation typically these are written to a http.Request +*/ +type DcimSitesUpdateParams struct { + + /*Data*/ + Data *models.WritableSite + /*ID + A unique integer value identifying this site. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the dcim sites update params +func (o *DcimSitesUpdateParams) WithTimeout(timeout time.Duration) *DcimSitesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the dcim sites update params +func (o *DcimSitesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the dcim sites update params +func (o *DcimSitesUpdateParams) WithContext(ctx context.Context) *DcimSitesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the dcim sites update params +func (o *DcimSitesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the dcim sites update params +func (o *DcimSitesUpdateParams) WithHTTPClient(client *http.Client) *DcimSitesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the dcim sites update params +func (o *DcimSitesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the dcim sites update params +func (o *DcimSitesUpdateParams) WithData(data *models.WritableSite) *DcimSitesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the dcim sites update params +func (o *DcimSitesUpdateParams) SetData(data *models.WritableSite) { + o.Data = data +} + +// WithID adds the id to the dcim sites update params +func (o *DcimSitesUpdateParams) WithID(id int64) *DcimSitesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the dcim sites update params +func (o *DcimSitesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *DcimSitesUpdateParams) 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_sites_update_responses.go b/netbox/client/dcim/dcim_sites_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f1bdb304191552bfce39663d716f0402f9f67966 --- /dev/null +++ b/netbox/client/dcim/dcim_sites_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" +) + +// DcimSitesUpdateReader is a Reader for the DcimSitesUpdate structure. +type DcimSitesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DcimSitesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewDcimSitesUpdateOK() + 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()) + } +} + +// NewDcimSitesUpdateOK creates a DcimSitesUpdateOK with default headers values +func NewDcimSitesUpdateOK() *DcimSitesUpdateOK { + return &DcimSitesUpdateOK{} +} + +/*DcimSitesUpdateOK handles this case with default header values. + +DcimSitesUpdateOK dcim sites update o k +*/ +type DcimSitesUpdateOK struct { + Payload *models.WritableSite +} + +func (o *DcimSitesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /dcim/sites/{id}/][%d] dcimSitesUpdateOK %+v", 200, o.Payload) +} + +func (o *DcimSitesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSite) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_choices_list_parameters.go b/netbox/client/extras/extras_choices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d34db5db6499031fd34df37ad2042225dc93a31e --- /dev/null +++ b/netbox/client/extras/extras_choices_list_parameters.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasChoicesListParams creates a new ExtrasChoicesListParams object +// with the default values initialized. +func NewExtrasChoicesListParams() *ExtrasChoicesListParams { + + return &ExtrasChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasChoicesListParamsWithTimeout creates a new ExtrasChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasChoicesListParamsWithTimeout(timeout time.Duration) *ExtrasChoicesListParams { + + return &ExtrasChoicesListParams{ + + timeout: timeout, + } +} + +// NewExtrasChoicesListParamsWithContext creates a new ExtrasChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasChoicesListParamsWithContext(ctx context.Context) *ExtrasChoicesListParams { + + return &ExtrasChoicesListParams{ + + Context: ctx, + } +} + +// NewExtrasChoicesListParamsWithHTTPClient creates a new ExtrasChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasChoicesListParamsWithHTTPClient(client *http.Client) *ExtrasChoicesListParams { + + return &ExtrasChoicesListParams{ + HTTPClient: client, + } +} + +/*ExtrasChoicesListParams contains all the parameters to send to the API endpoint +for the extras choices list operation typically these are written to a http.Request +*/ +type ExtrasChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras choices list params +func (o *ExtrasChoicesListParams) WithTimeout(timeout time.Duration) *ExtrasChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras choices list params +func (o *ExtrasChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras choices list params +func (o *ExtrasChoicesListParams) WithContext(ctx context.Context) *ExtrasChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras choices list params +func (o *ExtrasChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras choices list params +func (o *ExtrasChoicesListParams) WithHTTPClient(client *http.Client) *ExtrasChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras choices list params +func (o *ExtrasChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasChoicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_choices_list_responses.go b/netbox/client/extras/extras_choices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2848912b64bf292a6242dc9e2ce69eb91355e419 --- /dev/null +++ b/netbox/client/extras/extras_choices_list_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasChoicesListReader is a Reader for the ExtrasChoicesList structure. +type ExtrasChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasChoicesListOK() + 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()) + } +} + +// NewExtrasChoicesListOK creates a ExtrasChoicesListOK with default headers values +func NewExtrasChoicesListOK() *ExtrasChoicesListOK { + return &ExtrasChoicesListOK{} +} + +/*ExtrasChoicesListOK handles this case with default header values. + +ExtrasChoicesListOK extras choices list o k +*/ +type ExtrasChoicesListOK struct { +} + +func (o *ExtrasChoicesListOK) Error() string { + return fmt.Sprintf("[GET /extras/_choices/][%d] extrasChoicesListOK ", 200) +} + +func (o *ExtrasChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_choices_read_parameters.go b/netbox/client/extras/extras_choices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7dd8262822b8b8f03dd7598ab94952be4f9ff5fc --- /dev/null +++ b/netbox/client/extras/extras_choices_read_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasChoicesReadParams creates a new ExtrasChoicesReadParams object +// with the default values initialized. +func NewExtrasChoicesReadParams() *ExtrasChoicesReadParams { + var () + return &ExtrasChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasChoicesReadParamsWithTimeout creates a new ExtrasChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasChoicesReadParamsWithTimeout(timeout time.Duration) *ExtrasChoicesReadParams { + var () + return &ExtrasChoicesReadParams{ + + timeout: timeout, + } +} + +// NewExtrasChoicesReadParamsWithContext creates a new ExtrasChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasChoicesReadParamsWithContext(ctx context.Context) *ExtrasChoicesReadParams { + var () + return &ExtrasChoicesReadParams{ + + Context: ctx, + } +} + +// NewExtrasChoicesReadParamsWithHTTPClient creates a new ExtrasChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasChoicesReadParamsWithHTTPClient(client *http.Client) *ExtrasChoicesReadParams { + var () + return &ExtrasChoicesReadParams{ + HTTPClient: client, + } +} + +/*ExtrasChoicesReadParams contains all the parameters to send to the API endpoint +for the extras choices read operation typically these are written to a http.Request +*/ +type ExtrasChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras choices read params +func (o *ExtrasChoicesReadParams) WithTimeout(timeout time.Duration) *ExtrasChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras choices read params +func (o *ExtrasChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras choices read params +func (o *ExtrasChoicesReadParams) WithContext(ctx context.Context) *ExtrasChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras choices read params +func (o *ExtrasChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras choices read params +func (o *ExtrasChoicesReadParams) WithHTTPClient(client *http.Client) *ExtrasChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras choices read params +func (o *ExtrasChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras choices read params +func (o *ExtrasChoicesReadParams) WithID(id string) *ExtrasChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras choices read params +func (o *ExtrasChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasChoicesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_choices_read_responses.go b/netbox/client/extras/extras_choices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..eb7a281f0a3838b3ed9e9a3e5246df0687fc853a --- /dev/null +++ b/netbox/client/extras/extras_choices_read_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasChoicesReadReader is a Reader for the ExtrasChoicesRead structure. +type ExtrasChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasChoicesReadOK() + 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()) + } +} + +// NewExtrasChoicesReadOK creates a ExtrasChoicesReadOK with default headers values +func NewExtrasChoicesReadOK() *ExtrasChoicesReadOK { + return &ExtrasChoicesReadOK{} +} + +/*ExtrasChoicesReadOK handles this case with default header values. + +ExtrasChoicesReadOK extras choices read o k +*/ +type ExtrasChoicesReadOK struct { +} + +func (o *ExtrasChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /extras/_choices/{id}/][%d] extrasChoicesReadOK ", 200) +} + +func (o *ExtrasChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_client.go b/netbox/client/extras/extras_client.go new file mode 100644 index 0000000000000000000000000000000000000000..cbd140dc4481f387be5ed7802bc5ba6a65a41d9b --- /dev/null +++ b/netbox/client/extras/extras_client.go @@ -0,0 +1,871 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new extras API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for extras API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +ExtrasChoicesList extras choices list API +*/ +func (a *Client) ExtrasChoicesList(params *ExtrasChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras__choices_list", + Method: "GET", + PathPattern: "/extras/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasChoicesListOK), nil + +} + +/* +ExtrasChoicesRead extras choices read API +*/ +func (a *Client) ExtrasChoicesRead(params *ExtrasChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras__choices_read", + Method: "GET", + PathPattern: "/extras/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasChoicesReadOK), nil + +} + +/* +ExtrasExportTemplatesCreate extras export templates create API +*/ +func (a *Client) ExtrasExportTemplatesCreate(params *ExtrasExportTemplatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_create", + Method: "POST", + PathPattern: "/extras/export-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesCreateCreated), nil + +} + +/* +ExtrasExportTemplatesDelete extras export templates delete API +*/ +func (a *Client) ExtrasExportTemplatesDelete(params *ExtrasExportTemplatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_delete", + Method: "DELETE", + PathPattern: "/extras/export-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesDeleteNoContent), nil + +} + +/* +ExtrasExportTemplatesList extras export templates list API +*/ +func (a *Client) ExtrasExportTemplatesList(params *ExtrasExportTemplatesListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_list", + Method: "GET", + PathPattern: "/extras/export-templates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesListOK), nil + +} + +/* +ExtrasExportTemplatesPartialUpdate extras export templates partial update API +*/ +func (a *Client) ExtrasExportTemplatesPartialUpdate(params *ExtrasExportTemplatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_partial_update", + Method: "PATCH", + PathPattern: "/extras/export-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesPartialUpdateOK), nil + +} + +/* +ExtrasExportTemplatesRead extras export templates read API +*/ +func (a *Client) ExtrasExportTemplatesRead(params *ExtrasExportTemplatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_read", + Method: "GET", + PathPattern: "/extras/export-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesReadOK), nil + +} + +/* +ExtrasExportTemplatesUpdate extras export templates update API +*/ +func (a *Client) ExtrasExportTemplatesUpdate(params *ExtrasExportTemplatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasExportTemplatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasExportTemplatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_export-templates_update", + Method: "PUT", + PathPattern: "/extras/export-templates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasExportTemplatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasExportTemplatesUpdateOK), nil + +} + +/* +ExtrasGraphsCreate extras graphs create API +*/ +func (a *Client) ExtrasGraphsCreate(params *ExtrasGraphsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_create", + Method: "POST", + PathPattern: "/extras/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsCreateCreated), nil + +} + +/* +ExtrasGraphsDelete extras graphs delete API +*/ +func (a *Client) ExtrasGraphsDelete(params *ExtrasGraphsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_delete", + Method: "DELETE", + PathPattern: "/extras/graphs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsDeleteNoContent), nil + +} + +/* +ExtrasGraphsList extras graphs list API +*/ +func (a *Client) ExtrasGraphsList(params *ExtrasGraphsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_list", + Method: "GET", + PathPattern: "/extras/graphs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsListOK), nil + +} + +/* +ExtrasGraphsPartialUpdate extras graphs partial update API +*/ +func (a *Client) ExtrasGraphsPartialUpdate(params *ExtrasGraphsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_partial_update", + Method: "PATCH", + PathPattern: "/extras/graphs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsPartialUpdateOK), nil + +} + +/* +ExtrasGraphsRead extras graphs read API +*/ +func (a *Client) ExtrasGraphsRead(params *ExtrasGraphsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_read", + Method: "GET", + PathPattern: "/extras/graphs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsReadOK), nil + +} + +/* +ExtrasGraphsUpdate extras graphs update API +*/ +func (a *Client) ExtrasGraphsUpdate(params *ExtrasGraphsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasGraphsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasGraphsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_graphs_update", + Method: "PUT", + PathPattern: "/extras/graphs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasGraphsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasGraphsUpdateOK), nil + +} + +/* +ExtrasImageAttachmentsCreate extras image attachments create API +*/ +func (a *Client) ExtrasImageAttachmentsCreate(params *ExtrasImageAttachmentsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_create", + Method: "POST", + PathPattern: "/extras/image-attachments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsCreateCreated), nil + +} + +/* +ExtrasImageAttachmentsDelete extras image attachments delete API +*/ +func (a *Client) ExtrasImageAttachmentsDelete(params *ExtrasImageAttachmentsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_delete", + Method: "DELETE", + PathPattern: "/extras/image-attachments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsDeleteNoContent), nil + +} + +/* +ExtrasImageAttachmentsList extras image attachments list API +*/ +func (a *Client) ExtrasImageAttachmentsList(params *ExtrasImageAttachmentsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_list", + Method: "GET", + PathPattern: "/extras/image-attachments/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsListOK), nil + +} + +/* +ExtrasImageAttachmentsPartialUpdate extras image attachments partial update API +*/ +func (a *Client) ExtrasImageAttachmentsPartialUpdate(params *ExtrasImageAttachmentsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_partial_update", + Method: "PATCH", + PathPattern: "/extras/image-attachments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsPartialUpdateOK), nil + +} + +/* +ExtrasImageAttachmentsRead extras image attachments read API +*/ +func (a *Client) ExtrasImageAttachmentsRead(params *ExtrasImageAttachmentsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_read", + Method: "GET", + PathPattern: "/extras/image-attachments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsReadOK), nil + +} + +/* +ExtrasImageAttachmentsUpdate extras image attachments update API +*/ +func (a *Client) ExtrasImageAttachmentsUpdate(params *ExtrasImageAttachmentsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasImageAttachmentsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasImageAttachmentsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_image-attachments_update", + Method: "PUT", + PathPattern: "/extras/image-attachments/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasImageAttachmentsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasImageAttachmentsUpdateOK), nil + +} + +/* +ExtrasRecentActivityList List all UserActions to provide a log of recent activity. +*/ +func (a *Client) ExtrasRecentActivityList(params *ExtrasRecentActivityListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasRecentActivityListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasRecentActivityListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_recent-activity_list", + Method: "GET", + PathPattern: "/extras/recent-activity/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasRecentActivityListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasRecentActivityListOK), nil + +} + +/* +ExtrasRecentActivityRead List all UserActions to provide a log of recent activity. +*/ +func (a *Client) ExtrasRecentActivityRead(params *ExtrasRecentActivityReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasRecentActivityReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasRecentActivityReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_recent-activity_read", + Method: "GET", + PathPattern: "/extras/recent-activity/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasRecentActivityReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasRecentActivityReadOK), nil + +} + +/* +ExtrasTopologyMapsCreate extras topology maps create API +*/ +func (a *Client) ExtrasTopologyMapsCreate(params *ExtrasTopologyMapsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_create", + Method: "POST", + PathPattern: "/extras/topology-maps/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsCreateCreated), nil + +} + +/* +ExtrasTopologyMapsDelete extras topology maps delete API +*/ +func (a *Client) ExtrasTopologyMapsDelete(params *ExtrasTopologyMapsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_delete", + Method: "DELETE", + PathPattern: "/extras/topology-maps/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsDeleteNoContent), nil + +} + +/* +ExtrasTopologyMapsList extras topology maps list API +*/ +func (a *Client) ExtrasTopologyMapsList(params *ExtrasTopologyMapsListParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_list", + Method: "GET", + PathPattern: "/extras/topology-maps/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsListOK), nil + +} + +/* +ExtrasTopologyMapsPartialUpdate extras topology maps partial update API +*/ +func (a *Client) ExtrasTopologyMapsPartialUpdate(params *ExtrasTopologyMapsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_partial_update", + Method: "PATCH", + PathPattern: "/extras/topology-maps/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsPartialUpdateOK), nil + +} + +/* +ExtrasTopologyMapsRead extras topology maps read API +*/ +func (a *Client) ExtrasTopologyMapsRead(params *ExtrasTopologyMapsReadParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_read", + Method: "GET", + PathPattern: "/extras/topology-maps/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsReadOK), nil + +} + +/* +ExtrasTopologyMapsRender extras topology maps render API +*/ +func (a *Client) ExtrasTopologyMapsRender(params *ExtrasTopologyMapsRenderParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsRenderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsRenderParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_render", + Method: "GET", + PathPattern: "/extras/topology-maps/{id}/render/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsRenderReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsRenderOK), nil + +} + +/* +ExtrasTopologyMapsUpdate extras topology maps update API +*/ +func (a *Client) ExtrasTopologyMapsUpdate(params *ExtrasTopologyMapsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*ExtrasTopologyMapsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewExtrasTopologyMapsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "extras_topology-maps_update", + Method: "PUT", + PathPattern: "/extras/topology-maps/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ExtrasTopologyMapsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*ExtrasTopologyMapsUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/netbox/client/extras/extras_export_templates_create_parameters.go b/netbox/client/extras/extras_export_templates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..369d8f9be2b2af0b76320ccfe914e007f0cc8210 --- /dev/null +++ b/netbox/client/extras/extras_export_templates_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasExportTemplatesCreateParams creates a new ExtrasExportTemplatesCreateParams object +// with the default values initialized. +func NewExtrasExportTemplatesCreateParams() *ExtrasExportTemplatesCreateParams { + var () + return &ExtrasExportTemplatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesCreateParamsWithTimeout creates a new ExtrasExportTemplatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesCreateParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesCreateParams { + var () + return &ExtrasExportTemplatesCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesCreateParamsWithContext creates a new ExtrasExportTemplatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesCreateParamsWithContext(ctx context.Context) *ExtrasExportTemplatesCreateParams { + var () + return &ExtrasExportTemplatesCreateParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesCreateParamsWithHTTPClient creates a new ExtrasExportTemplatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesCreateParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesCreateParams { + var () + return &ExtrasExportTemplatesCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesCreateParams contains all the parameters to send to the API endpoint +for the extras export templates create operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesCreateParams struct { + + /*Data*/ + Data *models.ExportTemplate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) WithContext(ctx context.Context) *ExtrasExportTemplatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras export templates create params +func (o *ExtrasExportTemplatesCreateParams) SetData(data *models.ExportTemplate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_export_templates_create_responses.go b/netbox/client/extras/extras_export_templates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cb543ecd7a8486831e14114a548ff5bd9d23eeaa --- /dev/null +++ b/netbox/client/extras/extras_export_templates_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesCreateReader is a Reader for the ExtrasExportTemplatesCreate structure. +type ExtrasExportTemplatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasExportTemplatesCreateCreated() + 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()) + } +} + +// NewExtrasExportTemplatesCreateCreated creates a ExtrasExportTemplatesCreateCreated with default headers values +func NewExtrasExportTemplatesCreateCreated() *ExtrasExportTemplatesCreateCreated { + return &ExtrasExportTemplatesCreateCreated{} +} + +/*ExtrasExportTemplatesCreateCreated handles this case with default header values. + +ExtrasExportTemplatesCreateCreated extras export templates create created +*/ +type ExtrasExportTemplatesCreateCreated struct { + Payload *models.ExportTemplate +} + +func (o *ExtrasExportTemplatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/export-templates/][%d] extrasExportTemplatesCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasExportTemplatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExportTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_export_templates_delete_parameters.go b/netbox/client/extras/extras_export_templates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0afe029607837f314fd51f221de3f884268b6b5f --- /dev/null +++ b/netbox/client/extras/extras_export_templates_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasExportTemplatesDeleteParams creates a new ExtrasExportTemplatesDeleteParams object +// with the default values initialized. +func NewExtrasExportTemplatesDeleteParams() *ExtrasExportTemplatesDeleteParams { + var () + return &ExtrasExportTemplatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesDeleteParamsWithTimeout creates a new ExtrasExportTemplatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesDeleteParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesDeleteParams { + var () + return &ExtrasExportTemplatesDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesDeleteParamsWithContext creates a new ExtrasExportTemplatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesDeleteParamsWithContext(ctx context.Context) *ExtrasExportTemplatesDeleteParams { + var () + return &ExtrasExportTemplatesDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesDeleteParamsWithHTTPClient creates a new ExtrasExportTemplatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesDeleteParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesDeleteParams { + var () + return &ExtrasExportTemplatesDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesDeleteParams contains all the parameters to send to the API endpoint +for the extras export templates delete operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesDeleteParams struct { + + /*ID + A unique integer value identifying this export template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) WithContext(ctx context.Context) *ExtrasExportTemplatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) WithID(id int64) *ExtrasExportTemplatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras export templates delete params +func (o *ExtrasExportTemplatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_export_templates_delete_responses.go b/netbox/client/extras/extras_export_templates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7cd02eeac0a2430b507210e82dfb91ece8eeaf30 --- /dev/null +++ b/netbox/client/extras/extras_export_templates_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasExportTemplatesDeleteReader is a Reader for the ExtrasExportTemplatesDelete structure. +type ExtrasExportTemplatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasExportTemplatesDeleteNoContent() + 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()) + } +} + +// NewExtrasExportTemplatesDeleteNoContent creates a ExtrasExportTemplatesDeleteNoContent with default headers values +func NewExtrasExportTemplatesDeleteNoContent() *ExtrasExportTemplatesDeleteNoContent { + return &ExtrasExportTemplatesDeleteNoContent{} +} + +/*ExtrasExportTemplatesDeleteNoContent handles this case with default header values. + +ExtrasExportTemplatesDeleteNoContent extras export templates delete no content +*/ +type ExtrasExportTemplatesDeleteNoContent struct { +} + +func (o *ExtrasExportTemplatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/export-templates/{id}/][%d] extrasExportTemplatesDeleteNoContent ", 204) +} + +func (o *ExtrasExportTemplatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_export_templates_list_parameters.go b/netbox/client/extras/extras_export_templates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6730c84a58eb3e0e2d3be99898733ed68ffc5e05 --- /dev/null +++ b/netbox/client/extras/extras_export_templates_list_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasExportTemplatesListParams creates a new ExtrasExportTemplatesListParams object +// with the default values initialized. +func NewExtrasExportTemplatesListParams() *ExtrasExportTemplatesListParams { + var () + return &ExtrasExportTemplatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesListParamsWithTimeout creates a new ExtrasExportTemplatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesListParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesListParams { + var () + return &ExtrasExportTemplatesListParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesListParamsWithContext creates a new ExtrasExportTemplatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesListParamsWithContext(ctx context.Context) *ExtrasExportTemplatesListParams { + var () + return &ExtrasExportTemplatesListParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesListParamsWithHTTPClient creates a new ExtrasExportTemplatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesListParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesListParams { + var () + return &ExtrasExportTemplatesListParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesListParams contains all the parameters to send to the API endpoint +for the extras export templates list operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesListParams struct { + + /*ContentType*/ + ContentType *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithContext(ctx context.Context) *ExtrasExportTemplatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithContentType adds the contentType to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithContentType(contentType *string) *ExtrasExportTemplatesListParams { + o.SetContentType(contentType) + return o +} + +// SetContentType adds the contentType to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetContentType(contentType *string) { + o.ContentType = contentType +} + +// WithLimit adds the limit to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithLimit(limit *int64) *ExtrasExportTemplatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithName(name *string) *ExtrasExportTemplatesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) WithOffset(offset *int64) *ExtrasExportTemplatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras export templates list params +func (o *ExtrasExportTemplatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.ContentType != nil { + + // query param content_type + var qrContentType string + if o.ContentType != nil { + qrContentType = *o.ContentType + } + qContentType := qrContentType + if qContentType != "" { + if err := r.SetQueryParam("content_type", qContentType); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_export_templates_list_responses.go b/netbox/client/extras/extras_export_templates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9bbd538c32c0875b3ae925e5435d02dd221daa85 --- /dev/null +++ b/netbox/client/extras/extras_export_templates_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesListReader is a Reader for the ExtrasExportTemplatesList structure. +type ExtrasExportTemplatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasExportTemplatesListOK() + 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()) + } +} + +// NewExtrasExportTemplatesListOK creates a ExtrasExportTemplatesListOK with default headers values +func NewExtrasExportTemplatesListOK() *ExtrasExportTemplatesListOK { + return &ExtrasExportTemplatesListOK{} +} + +/*ExtrasExportTemplatesListOK handles this case with default header values. + +ExtrasExportTemplatesListOK extras export templates list o k +*/ +type ExtrasExportTemplatesListOK struct { + Payload *models.ExtrasExportTemplatesListOKBody +} + +func (o *ExtrasExportTemplatesListOK) Error() string { + return fmt.Sprintf("[GET /extras/export-templates/][%d] extrasExportTemplatesListOK %+v", 200, o.Payload) +} + +func (o *ExtrasExportTemplatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasExportTemplatesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_export_templates_partial_update_parameters.go b/netbox/client/extras/extras_export_templates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c6f9021de0ac36bcfdd1ae4f26f46a8fd7bd771a --- /dev/null +++ b/netbox/client/extras/extras_export_templates_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasExportTemplatesPartialUpdateParams creates a new ExtrasExportTemplatesPartialUpdateParams object +// with the default values initialized. +func NewExtrasExportTemplatesPartialUpdateParams() *ExtrasExportTemplatesPartialUpdateParams { + var () + return &ExtrasExportTemplatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesPartialUpdateParamsWithTimeout creates a new ExtrasExportTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesPartialUpdateParams { + var () + return &ExtrasExportTemplatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesPartialUpdateParamsWithContext creates a new ExtrasExportTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesPartialUpdateParamsWithContext(ctx context.Context) *ExtrasExportTemplatesPartialUpdateParams { + var () + return &ExtrasExportTemplatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesPartialUpdateParamsWithHTTPClient creates a new ExtrasExportTemplatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesPartialUpdateParams { + var () + return &ExtrasExportTemplatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras export templates partial update operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesPartialUpdateParams struct { + + /*Data*/ + Data *models.ExportTemplate + /*ID + A unique integer value identifying this export template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithContext(ctx context.Context) *ExtrasExportTemplatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetData(data *models.ExportTemplate) { + o.Data = data +} + +// WithID adds the id to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) WithID(id int64) *ExtrasExportTemplatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras export templates partial update params +func (o *ExtrasExportTemplatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_export_templates_partial_update_responses.go b/netbox/client/extras/extras_export_templates_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..266d3841a2e2ff78d020521326c96c1c205d53b2 --- /dev/null +++ b/netbox/client/extras/extras_export_templates_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesPartialUpdateReader is a Reader for the ExtrasExportTemplatesPartialUpdate structure. +type ExtrasExportTemplatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasExportTemplatesPartialUpdateOK() + 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()) + } +} + +// NewExtrasExportTemplatesPartialUpdateOK creates a ExtrasExportTemplatesPartialUpdateOK with default headers values +func NewExtrasExportTemplatesPartialUpdateOK() *ExtrasExportTemplatesPartialUpdateOK { + return &ExtrasExportTemplatesPartialUpdateOK{} +} + +/*ExtrasExportTemplatesPartialUpdateOK handles this case with default header values. + +ExtrasExportTemplatesPartialUpdateOK extras export templates partial update o k +*/ +type ExtrasExportTemplatesPartialUpdateOK struct { + Payload *models.ExportTemplate +} + +func (o *ExtrasExportTemplatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/export-templates/{id}/][%d] extrasExportTemplatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasExportTemplatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExportTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_export_templates_read_parameters.go b/netbox/client/extras/extras_export_templates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ddef6f40952498deb36226fc90cba49fe4447310 --- /dev/null +++ b/netbox/client/extras/extras_export_templates_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasExportTemplatesReadParams creates a new ExtrasExportTemplatesReadParams object +// with the default values initialized. +func NewExtrasExportTemplatesReadParams() *ExtrasExportTemplatesReadParams { + var () + return &ExtrasExportTemplatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesReadParamsWithTimeout creates a new ExtrasExportTemplatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesReadParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesReadParams { + var () + return &ExtrasExportTemplatesReadParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesReadParamsWithContext creates a new ExtrasExportTemplatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesReadParamsWithContext(ctx context.Context) *ExtrasExportTemplatesReadParams { + var () + return &ExtrasExportTemplatesReadParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesReadParamsWithHTTPClient creates a new ExtrasExportTemplatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesReadParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesReadParams { + var () + return &ExtrasExportTemplatesReadParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesReadParams contains all the parameters to send to the API endpoint +for the extras export templates read operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesReadParams struct { + + /*ID + A unique integer value identifying this export template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) WithContext(ctx context.Context) *ExtrasExportTemplatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) WithID(id int64) *ExtrasExportTemplatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras export templates read params +func (o *ExtrasExportTemplatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_export_templates_read_responses.go b/netbox/client/extras/extras_export_templates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a9ea4f33eb183549d67a65450c95920321676c84 --- /dev/null +++ b/netbox/client/extras/extras_export_templates_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesReadReader is a Reader for the ExtrasExportTemplatesRead structure. +type ExtrasExportTemplatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasExportTemplatesReadOK() + 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()) + } +} + +// NewExtrasExportTemplatesReadOK creates a ExtrasExportTemplatesReadOK with default headers values +func NewExtrasExportTemplatesReadOK() *ExtrasExportTemplatesReadOK { + return &ExtrasExportTemplatesReadOK{} +} + +/*ExtrasExportTemplatesReadOK handles this case with default header values. + +ExtrasExportTemplatesReadOK extras export templates read o k +*/ +type ExtrasExportTemplatesReadOK struct { + Payload *models.ExportTemplate +} + +func (o *ExtrasExportTemplatesReadOK) Error() string { + return fmt.Sprintf("[GET /extras/export-templates/{id}/][%d] extrasExportTemplatesReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasExportTemplatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExportTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_export_templates_update_parameters.go b/netbox/client/extras/extras_export_templates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..671c0243b3ddd045df3d530d0ecb3f5a18455514 --- /dev/null +++ b/netbox/client/extras/extras_export_templates_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasExportTemplatesUpdateParams creates a new ExtrasExportTemplatesUpdateParams object +// with the default values initialized. +func NewExtrasExportTemplatesUpdateParams() *ExtrasExportTemplatesUpdateParams { + var () + return &ExtrasExportTemplatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasExportTemplatesUpdateParamsWithTimeout creates a new ExtrasExportTemplatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasExportTemplatesUpdateParamsWithTimeout(timeout time.Duration) *ExtrasExportTemplatesUpdateParams { + var () + return &ExtrasExportTemplatesUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasExportTemplatesUpdateParamsWithContext creates a new ExtrasExportTemplatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasExportTemplatesUpdateParamsWithContext(ctx context.Context) *ExtrasExportTemplatesUpdateParams { + var () + return &ExtrasExportTemplatesUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasExportTemplatesUpdateParamsWithHTTPClient creates a new ExtrasExportTemplatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasExportTemplatesUpdateParamsWithHTTPClient(client *http.Client) *ExtrasExportTemplatesUpdateParams { + var () + return &ExtrasExportTemplatesUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasExportTemplatesUpdateParams contains all the parameters to send to the API endpoint +for the extras export templates update operation typically these are written to a http.Request +*/ +type ExtrasExportTemplatesUpdateParams struct { + + /*Data*/ + Data *models.ExportTemplate + /*ID + A unique integer value identifying this export template. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithTimeout(timeout time.Duration) *ExtrasExportTemplatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithContext(ctx context.Context) *ExtrasExportTemplatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithHTTPClient(client *http.Client) *ExtrasExportTemplatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithData(data *models.ExportTemplate) *ExtrasExportTemplatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetData(data *models.ExportTemplate) { + o.Data = data +} + +// WithID adds the id to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) WithID(id int64) *ExtrasExportTemplatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras export templates update params +func (o *ExtrasExportTemplatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasExportTemplatesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_export_templates_update_responses.go b/netbox/client/extras/extras_export_templates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f1f9fa60b3da286f1974652340322f3c3e9d029c --- /dev/null +++ b/netbox/client/extras/extras_export_templates_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasExportTemplatesUpdateReader is a Reader for the ExtrasExportTemplatesUpdate structure. +type ExtrasExportTemplatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasExportTemplatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasExportTemplatesUpdateOK() + 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()) + } +} + +// NewExtrasExportTemplatesUpdateOK creates a ExtrasExportTemplatesUpdateOK with default headers values +func NewExtrasExportTemplatesUpdateOK() *ExtrasExportTemplatesUpdateOK { + return &ExtrasExportTemplatesUpdateOK{} +} + +/*ExtrasExportTemplatesUpdateOK handles this case with default header values. + +ExtrasExportTemplatesUpdateOK extras export templates update o k +*/ +type ExtrasExportTemplatesUpdateOK struct { + Payload *models.ExportTemplate +} + +func (o *ExtrasExportTemplatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/export-templates/{id}/][%d] extrasExportTemplatesUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasExportTemplatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExportTemplate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_graphs_create_parameters.go b/netbox/client/extras/extras_graphs_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e632c77a91ce2a94dba1c93bf65c910ed24ba857 --- /dev/null +++ b/netbox/client/extras/extras_graphs_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasGraphsCreateParams creates a new ExtrasGraphsCreateParams object +// with the default values initialized. +func NewExtrasGraphsCreateParams() *ExtrasGraphsCreateParams { + var () + return &ExtrasGraphsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsCreateParamsWithTimeout creates a new ExtrasGraphsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsCreateParamsWithTimeout(timeout time.Duration) *ExtrasGraphsCreateParams { + var () + return &ExtrasGraphsCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsCreateParamsWithContext creates a new ExtrasGraphsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsCreateParamsWithContext(ctx context.Context) *ExtrasGraphsCreateParams { + var () + return &ExtrasGraphsCreateParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsCreateParamsWithHTTPClient creates a new ExtrasGraphsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsCreateParamsWithHTTPClient(client *http.Client) *ExtrasGraphsCreateParams { + var () + return &ExtrasGraphsCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsCreateParams contains all the parameters to send to the API endpoint +for the extras graphs create operation typically these are written to a http.Request +*/ +type ExtrasGraphsCreateParams struct { + + /*Data*/ + Data *models.WritableGraph + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs create params +func (o *ExtrasGraphsCreateParams) WithTimeout(timeout time.Duration) *ExtrasGraphsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs create params +func (o *ExtrasGraphsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs create params +func (o *ExtrasGraphsCreateParams) WithContext(ctx context.Context) *ExtrasGraphsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs create params +func (o *ExtrasGraphsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs create params +func (o *ExtrasGraphsCreateParams) WithHTTPClient(client *http.Client) *ExtrasGraphsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs create params +func (o *ExtrasGraphsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras graphs create params +func (o *ExtrasGraphsCreateParams) WithData(data *models.WritableGraph) *ExtrasGraphsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras graphs create params +func (o *ExtrasGraphsCreateParams) SetData(data *models.WritableGraph) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_graphs_create_responses.go b/netbox/client/extras/extras_graphs_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b81f88c319a2f7d530a5dddddddd6384d9448660 --- /dev/null +++ b/netbox/client/extras/extras_graphs_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasGraphsCreateReader is a Reader for the ExtrasGraphsCreate structure. +type ExtrasGraphsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasGraphsCreateCreated() + 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()) + } +} + +// NewExtrasGraphsCreateCreated creates a ExtrasGraphsCreateCreated with default headers values +func NewExtrasGraphsCreateCreated() *ExtrasGraphsCreateCreated { + return &ExtrasGraphsCreateCreated{} +} + +/*ExtrasGraphsCreateCreated handles this case with default header values. + +ExtrasGraphsCreateCreated extras graphs create created +*/ +type ExtrasGraphsCreateCreated struct { + Payload *models.WritableGraph +} + +func (o *ExtrasGraphsCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/graphs/][%d] extrasGraphsCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasGraphsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableGraph) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_graphs_delete_parameters.go b/netbox/client/extras/extras_graphs_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b7b5addaa5a849e27a3a6c4636846a8685a20363 --- /dev/null +++ b/netbox/client/extras/extras_graphs_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasGraphsDeleteParams creates a new ExtrasGraphsDeleteParams object +// with the default values initialized. +func NewExtrasGraphsDeleteParams() *ExtrasGraphsDeleteParams { + var () + return &ExtrasGraphsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsDeleteParamsWithTimeout creates a new ExtrasGraphsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsDeleteParamsWithTimeout(timeout time.Duration) *ExtrasGraphsDeleteParams { + var () + return &ExtrasGraphsDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsDeleteParamsWithContext creates a new ExtrasGraphsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsDeleteParamsWithContext(ctx context.Context) *ExtrasGraphsDeleteParams { + var () + return &ExtrasGraphsDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsDeleteParamsWithHTTPClient creates a new ExtrasGraphsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsDeleteParamsWithHTTPClient(client *http.Client) *ExtrasGraphsDeleteParams { + var () + return &ExtrasGraphsDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsDeleteParams contains all the parameters to send to the API endpoint +for the extras graphs delete operation typically these are written to a http.Request +*/ +type ExtrasGraphsDeleteParams struct { + + /*ID + A unique integer value identifying this graph. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) WithTimeout(timeout time.Duration) *ExtrasGraphsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) WithContext(ctx context.Context) *ExtrasGraphsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) WithHTTPClient(client *http.Client) *ExtrasGraphsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) WithID(id int64) *ExtrasGraphsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras graphs delete params +func (o *ExtrasGraphsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_graphs_delete_responses.go b/netbox/client/extras/extras_graphs_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..10316340af33f2418b3b095ad9eb10beb9493b71 --- /dev/null +++ b/netbox/client/extras/extras_graphs_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasGraphsDeleteReader is a Reader for the ExtrasGraphsDelete structure. +type ExtrasGraphsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasGraphsDeleteNoContent() + 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()) + } +} + +// NewExtrasGraphsDeleteNoContent creates a ExtrasGraphsDeleteNoContent with default headers values +func NewExtrasGraphsDeleteNoContent() *ExtrasGraphsDeleteNoContent { + return &ExtrasGraphsDeleteNoContent{} +} + +/*ExtrasGraphsDeleteNoContent handles this case with default header values. + +ExtrasGraphsDeleteNoContent extras graphs delete no content +*/ +type ExtrasGraphsDeleteNoContent struct { +} + +func (o *ExtrasGraphsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/graphs/{id}/][%d] extrasGraphsDeleteNoContent ", 204) +} + +func (o *ExtrasGraphsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_graphs_list_parameters.go b/netbox/client/extras/extras_graphs_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d6ed80d5bbd2642cb6bedda52057093d9a1598a8 --- /dev/null +++ b/netbox/client/extras/extras_graphs_list_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasGraphsListParams creates a new ExtrasGraphsListParams object +// with the default values initialized. +func NewExtrasGraphsListParams() *ExtrasGraphsListParams { + var () + return &ExtrasGraphsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsListParamsWithTimeout creates a new ExtrasGraphsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsListParamsWithTimeout(timeout time.Duration) *ExtrasGraphsListParams { + var () + return &ExtrasGraphsListParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsListParamsWithContext creates a new ExtrasGraphsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsListParamsWithContext(ctx context.Context) *ExtrasGraphsListParams { + var () + return &ExtrasGraphsListParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsListParamsWithHTTPClient creates a new ExtrasGraphsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsListParamsWithHTTPClient(client *http.Client) *ExtrasGraphsListParams { + var () + return &ExtrasGraphsListParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsListParams contains all the parameters to send to the API endpoint +for the extras graphs list operation typically these are written to a http.Request +*/ +type ExtrasGraphsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Type*/ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs list params +func (o *ExtrasGraphsListParams) WithTimeout(timeout time.Duration) *ExtrasGraphsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs list params +func (o *ExtrasGraphsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs list params +func (o *ExtrasGraphsListParams) WithContext(ctx context.Context) *ExtrasGraphsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs list params +func (o *ExtrasGraphsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs list params +func (o *ExtrasGraphsListParams) WithHTTPClient(client *http.Client) *ExtrasGraphsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs list params +func (o *ExtrasGraphsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras graphs list params +func (o *ExtrasGraphsListParams) WithLimit(limit *int64) *ExtrasGraphsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras graphs list params +func (o *ExtrasGraphsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the extras graphs list params +func (o *ExtrasGraphsListParams) WithName(name *string) *ExtrasGraphsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the extras graphs list params +func (o *ExtrasGraphsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the extras graphs list params +func (o *ExtrasGraphsListParams) WithOffset(offset *int64) *ExtrasGraphsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras graphs list params +func (o *ExtrasGraphsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithType adds the typeVar to the extras graphs list params +func (o *ExtrasGraphsListParams) WithType(typeVar *string) *ExtrasGraphsListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the extras graphs list params +func (o *ExtrasGraphsListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_graphs_list_responses.go b/netbox/client/extras/extras_graphs_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..18878ecd2203530b8841c1713bf3f770d824c7b3 --- /dev/null +++ b/netbox/client/extras/extras_graphs_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasGraphsListReader is a Reader for the ExtrasGraphsList structure. +type ExtrasGraphsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasGraphsListOK() + 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()) + } +} + +// NewExtrasGraphsListOK creates a ExtrasGraphsListOK with default headers values +func NewExtrasGraphsListOK() *ExtrasGraphsListOK { + return &ExtrasGraphsListOK{} +} + +/*ExtrasGraphsListOK handles this case with default header values. + +ExtrasGraphsListOK extras graphs list o k +*/ +type ExtrasGraphsListOK struct { + Payload *models.ExtrasGraphsListOKBody +} + +func (o *ExtrasGraphsListOK) Error() string { + return fmt.Sprintf("[GET /extras/graphs/][%d] extrasGraphsListOK %+v", 200, o.Payload) +} + +func (o *ExtrasGraphsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasGraphsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_graphs_partial_update_parameters.go b/netbox/client/extras/extras_graphs_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..efcd58380f94fcc174da5646d261c3b06ba9d843 --- /dev/null +++ b/netbox/client/extras/extras_graphs_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasGraphsPartialUpdateParams creates a new ExtrasGraphsPartialUpdateParams object +// with the default values initialized. +func NewExtrasGraphsPartialUpdateParams() *ExtrasGraphsPartialUpdateParams { + var () + return &ExtrasGraphsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsPartialUpdateParamsWithTimeout creates a new ExtrasGraphsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasGraphsPartialUpdateParams { + var () + return &ExtrasGraphsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsPartialUpdateParamsWithContext creates a new ExtrasGraphsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsPartialUpdateParamsWithContext(ctx context.Context) *ExtrasGraphsPartialUpdateParams { + var () + return &ExtrasGraphsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsPartialUpdateParamsWithHTTPClient creates a new ExtrasGraphsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasGraphsPartialUpdateParams { + var () + return &ExtrasGraphsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras graphs partial update operation typically these are written to a http.Request +*/ +type ExtrasGraphsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableGraph + /*ID + A unique integer value identifying this graph. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasGraphsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithContext(ctx context.Context) *ExtrasGraphsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasGraphsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithData(data *models.WritableGraph) *ExtrasGraphsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetData(data *models.WritableGraph) { + o.Data = data +} + +// WithID adds the id to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) WithID(id int64) *ExtrasGraphsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras graphs partial update params +func (o *ExtrasGraphsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_graphs_partial_update_responses.go b/netbox/client/extras/extras_graphs_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6e8dd93e08bd9ae2ec0e8bdb7ddeda4641fdbe7d --- /dev/null +++ b/netbox/client/extras/extras_graphs_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasGraphsPartialUpdateReader is a Reader for the ExtrasGraphsPartialUpdate structure. +type ExtrasGraphsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasGraphsPartialUpdateOK() + 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()) + } +} + +// NewExtrasGraphsPartialUpdateOK creates a ExtrasGraphsPartialUpdateOK with default headers values +func NewExtrasGraphsPartialUpdateOK() *ExtrasGraphsPartialUpdateOK { + return &ExtrasGraphsPartialUpdateOK{} +} + +/*ExtrasGraphsPartialUpdateOK handles this case with default header values. + +ExtrasGraphsPartialUpdateOK extras graphs partial update o k +*/ +type ExtrasGraphsPartialUpdateOK struct { + Payload *models.WritableGraph +} + +func (o *ExtrasGraphsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/graphs/{id}/][%d] extrasGraphsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasGraphsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableGraph) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_graphs_read_parameters.go b/netbox/client/extras/extras_graphs_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d58b318ffdde3d7fd27ddce996b9366386c7c3a8 --- /dev/null +++ b/netbox/client/extras/extras_graphs_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasGraphsReadParams creates a new ExtrasGraphsReadParams object +// with the default values initialized. +func NewExtrasGraphsReadParams() *ExtrasGraphsReadParams { + var () + return &ExtrasGraphsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsReadParamsWithTimeout creates a new ExtrasGraphsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsReadParamsWithTimeout(timeout time.Duration) *ExtrasGraphsReadParams { + var () + return &ExtrasGraphsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsReadParamsWithContext creates a new ExtrasGraphsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsReadParamsWithContext(ctx context.Context) *ExtrasGraphsReadParams { + var () + return &ExtrasGraphsReadParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsReadParamsWithHTTPClient creates a new ExtrasGraphsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsReadParamsWithHTTPClient(client *http.Client) *ExtrasGraphsReadParams { + var () + return &ExtrasGraphsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsReadParams contains all the parameters to send to the API endpoint +for the extras graphs read operation typically these are written to a http.Request +*/ +type ExtrasGraphsReadParams struct { + + /*ID + A unique integer value identifying this graph. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs read params +func (o *ExtrasGraphsReadParams) WithTimeout(timeout time.Duration) *ExtrasGraphsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs read params +func (o *ExtrasGraphsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs read params +func (o *ExtrasGraphsReadParams) WithContext(ctx context.Context) *ExtrasGraphsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs read params +func (o *ExtrasGraphsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs read params +func (o *ExtrasGraphsReadParams) WithHTTPClient(client *http.Client) *ExtrasGraphsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs read params +func (o *ExtrasGraphsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras graphs read params +func (o *ExtrasGraphsReadParams) WithID(id int64) *ExtrasGraphsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras graphs read params +func (o *ExtrasGraphsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_graphs_read_responses.go b/netbox/client/extras/extras_graphs_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8c4dc77746bc3bb1c054541a12e35497b506864d --- /dev/null +++ b/netbox/client/extras/extras_graphs_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasGraphsReadReader is a Reader for the ExtrasGraphsRead structure. +type ExtrasGraphsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasGraphsReadOK() + 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()) + } +} + +// NewExtrasGraphsReadOK creates a ExtrasGraphsReadOK with default headers values +func NewExtrasGraphsReadOK() *ExtrasGraphsReadOK { + return &ExtrasGraphsReadOK{} +} + +/*ExtrasGraphsReadOK handles this case with default header values. + +ExtrasGraphsReadOK extras graphs read o k +*/ +type ExtrasGraphsReadOK struct { + Payload *models.Graph +} + +func (o *ExtrasGraphsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/graphs/{id}/][%d] extrasGraphsReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasGraphsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Graph) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_graphs_update_parameters.go b/netbox/client/extras/extras_graphs_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6bd1975279361d166e28b2e1e1006e547a77648a --- /dev/null +++ b/netbox/client/extras/extras_graphs_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasGraphsUpdateParams creates a new ExtrasGraphsUpdateParams object +// with the default values initialized. +func NewExtrasGraphsUpdateParams() *ExtrasGraphsUpdateParams { + var () + return &ExtrasGraphsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasGraphsUpdateParamsWithTimeout creates a new ExtrasGraphsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasGraphsUpdateParamsWithTimeout(timeout time.Duration) *ExtrasGraphsUpdateParams { + var () + return &ExtrasGraphsUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasGraphsUpdateParamsWithContext creates a new ExtrasGraphsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasGraphsUpdateParamsWithContext(ctx context.Context) *ExtrasGraphsUpdateParams { + var () + return &ExtrasGraphsUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasGraphsUpdateParamsWithHTTPClient creates a new ExtrasGraphsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasGraphsUpdateParamsWithHTTPClient(client *http.Client) *ExtrasGraphsUpdateParams { + var () + return &ExtrasGraphsUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasGraphsUpdateParams contains all the parameters to send to the API endpoint +for the extras graphs update operation typically these are written to a http.Request +*/ +type ExtrasGraphsUpdateParams struct { + + /*Data*/ + Data *models.WritableGraph + /*ID + A unique integer value identifying this graph. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithTimeout(timeout time.Duration) *ExtrasGraphsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithContext(ctx context.Context) *ExtrasGraphsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithHTTPClient(client *http.Client) *ExtrasGraphsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithData(data *models.WritableGraph) *ExtrasGraphsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetData(data *models.WritableGraph) { + o.Data = data +} + +// WithID adds the id to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) WithID(id int64) *ExtrasGraphsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras graphs update params +func (o *ExtrasGraphsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasGraphsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_graphs_update_responses.go b/netbox/client/extras/extras_graphs_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f5208083c3bb11198275cab4b88e7273b3f75fba --- /dev/null +++ b/netbox/client/extras/extras_graphs_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasGraphsUpdateReader is a Reader for the ExtrasGraphsUpdate structure. +type ExtrasGraphsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasGraphsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasGraphsUpdateOK() + 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()) + } +} + +// NewExtrasGraphsUpdateOK creates a ExtrasGraphsUpdateOK with default headers values +func NewExtrasGraphsUpdateOK() *ExtrasGraphsUpdateOK { + return &ExtrasGraphsUpdateOK{} +} + +/*ExtrasGraphsUpdateOK handles this case with default header values. + +ExtrasGraphsUpdateOK extras graphs update o k +*/ +type ExtrasGraphsUpdateOK struct { + Payload *models.WritableGraph +} + +func (o *ExtrasGraphsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/graphs/{id}/][%d] extrasGraphsUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasGraphsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableGraph) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_create_parameters.go b/netbox/client/extras/extras_image_attachments_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..55355f4ff2a2ec90c1055a4df74ce7cf90bdba01 --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasImageAttachmentsCreateParams creates a new ExtrasImageAttachmentsCreateParams object +// with the default values initialized. +func NewExtrasImageAttachmentsCreateParams() *ExtrasImageAttachmentsCreateParams { + var () + return &ExtrasImageAttachmentsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsCreateParamsWithTimeout creates a new ExtrasImageAttachmentsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsCreateParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsCreateParams { + var () + return &ExtrasImageAttachmentsCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsCreateParamsWithContext creates a new ExtrasImageAttachmentsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsCreateParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsCreateParams { + var () + return &ExtrasImageAttachmentsCreateParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsCreateParamsWithHTTPClient creates a new ExtrasImageAttachmentsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsCreateParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsCreateParams { + var () + return &ExtrasImageAttachmentsCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsCreateParams contains all the parameters to send to the API endpoint +for the extras image attachments create operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsCreateParams struct { + + /*Data*/ + Data *models.WritableImageAttachment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras image attachments create params +func (o *ExtrasImageAttachmentsCreateParams) SetData(data *models.WritableImageAttachment) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_create_responses.go b/netbox/client/extras/extras_image_attachments_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..482dd51d1576aae9c1b4339d15216a60af8b1203 --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsCreateReader is a Reader for the ExtrasImageAttachmentsCreate structure. +type ExtrasImageAttachmentsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasImageAttachmentsCreateCreated() + 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()) + } +} + +// NewExtrasImageAttachmentsCreateCreated creates a ExtrasImageAttachmentsCreateCreated with default headers values +func NewExtrasImageAttachmentsCreateCreated() *ExtrasImageAttachmentsCreateCreated { + return &ExtrasImageAttachmentsCreateCreated{} +} + +/*ExtrasImageAttachmentsCreateCreated handles this case with default header values. + +ExtrasImageAttachmentsCreateCreated extras image attachments create created +*/ +type ExtrasImageAttachmentsCreateCreated struct { + Payload *models.WritableImageAttachment +} + +func (o *ExtrasImageAttachmentsCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/image-attachments/][%d] extrasImageAttachmentsCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasImageAttachmentsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableImageAttachment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_delete_parameters.go b/netbox/client/extras/extras_image_attachments_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..40d4f82d2eb99093e7a4b3717827af00843e4ca5 --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasImageAttachmentsDeleteParams creates a new ExtrasImageAttachmentsDeleteParams object +// with the default values initialized. +func NewExtrasImageAttachmentsDeleteParams() *ExtrasImageAttachmentsDeleteParams { + var () + return &ExtrasImageAttachmentsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsDeleteParamsWithTimeout creates a new ExtrasImageAttachmentsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsDeleteParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsDeleteParams { + var () + return &ExtrasImageAttachmentsDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsDeleteParamsWithContext creates a new ExtrasImageAttachmentsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsDeleteParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsDeleteParams { + var () + return &ExtrasImageAttachmentsDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsDeleteParamsWithHTTPClient creates a new ExtrasImageAttachmentsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsDeleteParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsDeleteParams { + var () + return &ExtrasImageAttachmentsDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsDeleteParams contains all the parameters to send to the API endpoint +for the extras image attachments delete operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsDeleteParams struct { + + /*ID + A unique integer value identifying this image attachment. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) WithID(id int64) *ExtrasImageAttachmentsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras image attachments delete params +func (o *ExtrasImageAttachmentsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_delete_responses.go b/netbox/client/extras/extras_image_attachments_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4f26e3baf7be8b206ade11b81b0d1ea337df079c --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasImageAttachmentsDeleteReader is a Reader for the ExtrasImageAttachmentsDelete structure. +type ExtrasImageAttachmentsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasImageAttachmentsDeleteNoContent() + 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()) + } +} + +// NewExtrasImageAttachmentsDeleteNoContent creates a ExtrasImageAttachmentsDeleteNoContent with default headers values +func NewExtrasImageAttachmentsDeleteNoContent() *ExtrasImageAttachmentsDeleteNoContent { + return &ExtrasImageAttachmentsDeleteNoContent{} +} + +/*ExtrasImageAttachmentsDeleteNoContent handles this case with default header values. + +ExtrasImageAttachmentsDeleteNoContent extras image attachments delete no content +*/ +type ExtrasImageAttachmentsDeleteNoContent struct { +} + +func (o *ExtrasImageAttachmentsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/image-attachments/{id}/][%d] extrasImageAttachmentsDeleteNoContent ", 204) +} + +func (o *ExtrasImageAttachmentsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_list_parameters.go b/netbox/client/extras/extras_image_attachments_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c4434d7d814b82b398c525234ed8705453d79edd --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_list_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasImageAttachmentsListParams creates a new ExtrasImageAttachmentsListParams object +// with the default values initialized. +func NewExtrasImageAttachmentsListParams() *ExtrasImageAttachmentsListParams { + var () + return &ExtrasImageAttachmentsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsListParamsWithTimeout creates a new ExtrasImageAttachmentsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsListParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsListParams { + var () + return &ExtrasImageAttachmentsListParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsListParamsWithContext creates a new ExtrasImageAttachmentsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsListParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsListParams { + var () + return &ExtrasImageAttachmentsListParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsListParamsWithHTTPClient creates a new ExtrasImageAttachmentsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsListParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsListParams { + var () + return &ExtrasImageAttachmentsListParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsListParams contains all the parameters to send to the API endpoint +for the extras image attachments list operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsListParams 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 extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithLimit(limit *int64) *ExtrasImageAttachmentsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) WithOffset(offset *int64) *ExtrasImageAttachmentsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras image attachments list params +func (o *ExtrasImageAttachmentsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsListParams) 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/extras/extras_image_attachments_list_responses.go b/netbox/client/extras/extras_image_attachments_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..20a9a9f9af360b91133d3ebe6c7db38f66f2e91b --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsListReader is a Reader for the ExtrasImageAttachmentsList structure. +type ExtrasImageAttachmentsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasImageAttachmentsListOK() + 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()) + } +} + +// NewExtrasImageAttachmentsListOK creates a ExtrasImageAttachmentsListOK with default headers values +func NewExtrasImageAttachmentsListOK() *ExtrasImageAttachmentsListOK { + return &ExtrasImageAttachmentsListOK{} +} + +/*ExtrasImageAttachmentsListOK handles this case with default header values. + +ExtrasImageAttachmentsListOK extras image attachments list o k +*/ +type ExtrasImageAttachmentsListOK struct { + Payload *models.ExtrasImageAttachmentsListOKBody +} + +func (o *ExtrasImageAttachmentsListOK) Error() string { + return fmt.Sprintf("[GET /extras/image-attachments/][%d] extrasImageAttachmentsListOK %+v", 200, o.Payload) +} + +func (o *ExtrasImageAttachmentsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasImageAttachmentsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_partial_update_parameters.go b/netbox/client/extras/extras_image_attachments_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..98047820b721d48102ed6aef2f7011428ac2d251 --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasImageAttachmentsPartialUpdateParams creates a new ExtrasImageAttachmentsPartialUpdateParams object +// with the default values initialized. +func NewExtrasImageAttachmentsPartialUpdateParams() *ExtrasImageAttachmentsPartialUpdateParams { + var () + return &ExtrasImageAttachmentsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsPartialUpdateParamsWithTimeout creates a new ExtrasImageAttachmentsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsPartialUpdateParams { + var () + return &ExtrasImageAttachmentsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsPartialUpdateParamsWithContext creates a new ExtrasImageAttachmentsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsPartialUpdateParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsPartialUpdateParams { + var () + return &ExtrasImageAttachmentsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsPartialUpdateParamsWithHTTPClient creates a new ExtrasImageAttachmentsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsPartialUpdateParams { + var () + return &ExtrasImageAttachmentsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras image attachments partial update operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableImageAttachment + /*ID + A unique integer value identifying this image attachment. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetData(data *models.WritableImageAttachment) { + o.Data = data +} + +// WithID adds the id to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) WithID(id int64) *ExtrasImageAttachmentsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras image attachments partial update params +func (o *ExtrasImageAttachmentsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_partial_update_responses.go b/netbox/client/extras/extras_image_attachments_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..97ba9d7b7dd3b410743582484b0d078154f18a5a --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsPartialUpdateReader is a Reader for the ExtrasImageAttachmentsPartialUpdate structure. +type ExtrasImageAttachmentsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasImageAttachmentsPartialUpdateOK() + 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()) + } +} + +// NewExtrasImageAttachmentsPartialUpdateOK creates a ExtrasImageAttachmentsPartialUpdateOK with default headers values +func NewExtrasImageAttachmentsPartialUpdateOK() *ExtrasImageAttachmentsPartialUpdateOK { + return &ExtrasImageAttachmentsPartialUpdateOK{} +} + +/*ExtrasImageAttachmentsPartialUpdateOK handles this case with default header values. + +ExtrasImageAttachmentsPartialUpdateOK extras image attachments partial update o k +*/ +type ExtrasImageAttachmentsPartialUpdateOK struct { + Payload *models.WritableImageAttachment +} + +func (o *ExtrasImageAttachmentsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/image-attachments/{id}/][%d] extrasImageAttachmentsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasImageAttachmentsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableImageAttachment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_read_parameters.go b/netbox/client/extras/extras_image_attachments_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..bdd2c7ea6c00aa9e31743df3ee3c5b18cc50cb41 --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasImageAttachmentsReadParams creates a new ExtrasImageAttachmentsReadParams object +// with the default values initialized. +func NewExtrasImageAttachmentsReadParams() *ExtrasImageAttachmentsReadParams { + var () + return &ExtrasImageAttachmentsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsReadParamsWithTimeout creates a new ExtrasImageAttachmentsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsReadParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsReadParams { + var () + return &ExtrasImageAttachmentsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsReadParamsWithContext creates a new ExtrasImageAttachmentsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsReadParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsReadParams { + var () + return &ExtrasImageAttachmentsReadParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsReadParamsWithHTTPClient creates a new ExtrasImageAttachmentsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsReadParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsReadParams { + var () + return &ExtrasImageAttachmentsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsReadParams contains all the parameters to send to the API endpoint +for the extras image attachments read operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsReadParams struct { + + /*ID + A unique integer value identifying this image attachment. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) WithID(id int64) *ExtrasImageAttachmentsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras image attachments read params +func (o *ExtrasImageAttachmentsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_read_responses.go b/netbox/client/extras/extras_image_attachments_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..22e640774638f42e8de1f37322a23d5d6e84025c --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsReadReader is a Reader for the ExtrasImageAttachmentsRead structure. +type ExtrasImageAttachmentsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasImageAttachmentsReadOK() + 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()) + } +} + +// NewExtrasImageAttachmentsReadOK creates a ExtrasImageAttachmentsReadOK with default headers values +func NewExtrasImageAttachmentsReadOK() *ExtrasImageAttachmentsReadOK { + return &ExtrasImageAttachmentsReadOK{} +} + +/*ExtrasImageAttachmentsReadOK handles this case with default header values. + +ExtrasImageAttachmentsReadOK extras image attachments read o k +*/ +type ExtrasImageAttachmentsReadOK struct { + Payload *models.ImageAttachment +} + +func (o *ExtrasImageAttachmentsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/image-attachments/{id}/][%d] extrasImageAttachmentsReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasImageAttachmentsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ImageAttachment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_update_parameters.go b/netbox/client/extras/extras_image_attachments_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..595c28699399c855c148df8cf918d69110fb537d --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasImageAttachmentsUpdateParams creates a new ExtrasImageAttachmentsUpdateParams object +// with the default values initialized. +func NewExtrasImageAttachmentsUpdateParams() *ExtrasImageAttachmentsUpdateParams { + var () + return &ExtrasImageAttachmentsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasImageAttachmentsUpdateParamsWithTimeout creates a new ExtrasImageAttachmentsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasImageAttachmentsUpdateParamsWithTimeout(timeout time.Duration) *ExtrasImageAttachmentsUpdateParams { + var () + return &ExtrasImageAttachmentsUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasImageAttachmentsUpdateParamsWithContext creates a new ExtrasImageAttachmentsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasImageAttachmentsUpdateParamsWithContext(ctx context.Context) *ExtrasImageAttachmentsUpdateParams { + var () + return &ExtrasImageAttachmentsUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasImageAttachmentsUpdateParamsWithHTTPClient creates a new ExtrasImageAttachmentsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasImageAttachmentsUpdateParamsWithHTTPClient(client *http.Client) *ExtrasImageAttachmentsUpdateParams { + var () + return &ExtrasImageAttachmentsUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasImageAttachmentsUpdateParams contains all the parameters to send to the API endpoint +for the extras image attachments update operation typically these are written to a http.Request +*/ +type ExtrasImageAttachmentsUpdateParams struct { + + /*Data*/ + Data *models.WritableImageAttachment + /*ID + A unique integer value identifying this image attachment. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithTimeout(timeout time.Duration) *ExtrasImageAttachmentsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithContext(ctx context.Context) *ExtrasImageAttachmentsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithHTTPClient(client *http.Client) *ExtrasImageAttachmentsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithData(data *models.WritableImageAttachment) *ExtrasImageAttachmentsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetData(data *models.WritableImageAttachment) { + o.Data = data +} + +// WithID adds the id to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) WithID(id int64) *ExtrasImageAttachmentsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras image attachments update params +func (o *ExtrasImageAttachmentsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasImageAttachmentsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_image_attachments_update_responses.go b/netbox/client/extras/extras_image_attachments_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5416d9311d825743190896174cb0a1fe1d55423f --- /dev/null +++ b/netbox/client/extras/extras_image_attachments_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasImageAttachmentsUpdateReader is a Reader for the ExtrasImageAttachmentsUpdate structure. +type ExtrasImageAttachmentsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasImageAttachmentsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasImageAttachmentsUpdateOK() + 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()) + } +} + +// NewExtrasImageAttachmentsUpdateOK creates a ExtrasImageAttachmentsUpdateOK with default headers values +func NewExtrasImageAttachmentsUpdateOK() *ExtrasImageAttachmentsUpdateOK { + return &ExtrasImageAttachmentsUpdateOK{} +} + +/*ExtrasImageAttachmentsUpdateOK handles this case with default header values. + +ExtrasImageAttachmentsUpdateOK extras image attachments update o k +*/ +type ExtrasImageAttachmentsUpdateOK struct { + Payload *models.WritableImageAttachment +} + +func (o *ExtrasImageAttachmentsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/image-attachments/{id}/][%d] extrasImageAttachmentsUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasImageAttachmentsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableImageAttachment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_recent_activity_list_parameters.go b/netbox/client/extras/extras_recent_activity_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2494e7a7cd851d98d466c2b9332b2d2a82f6ae90 --- /dev/null +++ b/netbox/client/extras/extras_recent_activity_list_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasRecentActivityListParams creates a new ExtrasRecentActivityListParams object +// with the default values initialized. +func NewExtrasRecentActivityListParams() *ExtrasRecentActivityListParams { + var () + return &ExtrasRecentActivityListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasRecentActivityListParamsWithTimeout creates a new ExtrasRecentActivityListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasRecentActivityListParamsWithTimeout(timeout time.Duration) *ExtrasRecentActivityListParams { + var () + return &ExtrasRecentActivityListParams{ + + timeout: timeout, + } +} + +// NewExtrasRecentActivityListParamsWithContext creates a new ExtrasRecentActivityListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasRecentActivityListParamsWithContext(ctx context.Context) *ExtrasRecentActivityListParams { + var () + return &ExtrasRecentActivityListParams{ + + Context: ctx, + } +} + +// NewExtrasRecentActivityListParamsWithHTTPClient creates a new ExtrasRecentActivityListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasRecentActivityListParamsWithHTTPClient(client *http.Client) *ExtrasRecentActivityListParams { + var () + return &ExtrasRecentActivityListParams{ + HTTPClient: client, + } +} + +/*ExtrasRecentActivityListParams contains all the parameters to send to the API endpoint +for the extras recent activity list operation typically these are written to a http.Request +*/ +type ExtrasRecentActivityListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*User*/ + User *string + /*Username*/ + Username *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithTimeout(timeout time.Duration) *ExtrasRecentActivityListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithContext(ctx context.Context) *ExtrasRecentActivityListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithHTTPClient(client *http.Client) *ExtrasRecentActivityListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithLimit(limit *int64) *ExtrasRecentActivityListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithOffset(offset *int64) *ExtrasRecentActivityListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithUser adds the user to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithUser(user *string) *ExtrasRecentActivityListParams { + o.SetUser(user) + return o +} + +// SetUser adds the user to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetUser(user *string) { + o.User = user +} + +// WithUsername adds the username to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) WithUsername(username *string) *ExtrasRecentActivityListParams { + o.SetUsername(username) + return o +} + +// SetUsername adds the username to the extras recent activity list params +func (o *ExtrasRecentActivityListParams) SetUsername(username *string) { + o.Username = username +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasRecentActivityListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.User != nil { + + // query param user + var qrUser string + if o.User != nil { + qrUser = *o.User + } + qUser := qrUser + if qUser != "" { + if err := r.SetQueryParam("user", qUser); err != nil { + return err + } + } + + } + + if o.Username != nil { + + // query param username + var qrUsername string + if o.Username != nil { + qrUsername = *o.Username + } + qUsername := qrUsername + if qUsername != "" { + if err := r.SetQueryParam("username", qUsername); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_recent_activity_list_responses.go b/netbox/client/extras/extras_recent_activity_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..afa6475c3dc992adde76456410ba4d16f3aeed84 --- /dev/null +++ b/netbox/client/extras/extras_recent_activity_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasRecentActivityListReader is a Reader for the ExtrasRecentActivityList structure. +type ExtrasRecentActivityListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasRecentActivityListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasRecentActivityListOK() + 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()) + } +} + +// NewExtrasRecentActivityListOK creates a ExtrasRecentActivityListOK with default headers values +func NewExtrasRecentActivityListOK() *ExtrasRecentActivityListOK { + return &ExtrasRecentActivityListOK{} +} + +/*ExtrasRecentActivityListOK handles this case with default header values. + +ExtrasRecentActivityListOK extras recent activity list o k +*/ +type ExtrasRecentActivityListOK struct { + Payload *models.ExtrasRecentActivityListOKBody +} + +func (o *ExtrasRecentActivityListOK) Error() string { + return fmt.Sprintf("[GET /extras/recent-activity/][%d] extrasRecentActivityListOK %+v", 200, o.Payload) +} + +func (o *ExtrasRecentActivityListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasRecentActivityListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_recent_activity_read_parameters.go b/netbox/client/extras/extras_recent_activity_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..17a67e1cdfe9fd0c07dec080751076d7178951b6 --- /dev/null +++ b/netbox/client/extras/extras_recent_activity_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasRecentActivityReadParams creates a new ExtrasRecentActivityReadParams object +// with the default values initialized. +func NewExtrasRecentActivityReadParams() *ExtrasRecentActivityReadParams { + var () + return &ExtrasRecentActivityReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasRecentActivityReadParamsWithTimeout creates a new ExtrasRecentActivityReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasRecentActivityReadParamsWithTimeout(timeout time.Duration) *ExtrasRecentActivityReadParams { + var () + return &ExtrasRecentActivityReadParams{ + + timeout: timeout, + } +} + +// NewExtrasRecentActivityReadParamsWithContext creates a new ExtrasRecentActivityReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasRecentActivityReadParamsWithContext(ctx context.Context) *ExtrasRecentActivityReadParams { + var () + return &ExtrasRecentActivityReadParams{ + + Context: ctx, + } +} + +// NewExtrasRecentActivityReadParamsWithHTTPClient creates a new ExtrasRecentActivityReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasRecentActivityReadParamsWithHTTPClient(client *http.Client) *ExtrasRecentActivityReadParams { + var () + return &ExtrasRecentActivityReadParams{ + HTTPClient: client, + } +} + +/*ExtrasRecentActivityReadParams contains all the parameters to send to the API endpoint +for the extras recent activity read operation typically these are written to a http.Request +*/ +type ExtrasRecentActivityReadParams struct { + + /*ID + A unique integer value identifying this user action. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) WithTimeout(timeout time.Duration) *ExtrasRecentActivityReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) WithContext(ctx context.Context) *ExtrasRecentActivityReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) WithHTTPClient(client *http.Client) *ExtrasRecentActivityReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) WithID(id int64) *ExtrasRecentActivityReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras recent activity read params +func (o *ExtrasRecentActivityReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasRecentActivityReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_recent_activity_read_responses.go b/netbox/client/extras/extras_recent_activity_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8fa0fa3504f128c38421094f7624998e88d3fbcc --- /dev/null +++ b/netbox/client/extras/extras_recent_activity_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasRecentActivityReadReader is a Reader for the ExtrasRecentActivityRead structure. +type ExtrasRecentActivityReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasRecentActivityReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasRecentActivityReadOK() + 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()) + } +} + +// NewExtrasRecentActivityReadOK creates a ExtrasRecentActivityReadOK with default headers values +func NewExtrasRecentActivityReadOK() *ExtrasRecentActivityReadOK { + return &ExtrasRecentActivityReadOK{} +} + +/*ExtrasRecentActivityReadOK handles this case with default header values. + +ExtrasRecentActivityReadOK extras recent activity read o k +*/ +type ExtrasRecentActivityReadOK struct { + Payload *models.UserAction +} + +func (o *ExtrasRecentActivityReadOK) Error() string { + return fmt.Sprintf("[GET /extras/recent-activity/{id}/][%d] extrasRecentActivityReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasRecentActivityReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.UserAction) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_create_parameters.go b/netbox/client/extras/extras_topology_maps_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..16ecffc5cf3ae426c3a26d75461c3ab9ef584cdb --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasTopologyMapsCreateParams creates a new ExtrasTopologyMapsCreateParams object +// with the default values initialized. +func NewExtrasTopologyMapsCreateParams() *ExtrasTopologyMapsCreateParams { + var () + return &ExtrasTopologyMapsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsCreateParamsWithTimeout creates a new ExtrasTopologyMapsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsCreateParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsCreateParams { + var () + return &ExtrasTopologyMapsCreateParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsCreateParamsWithContext creates a new ExtrasTopologyMapsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsCreateParamsWithContext(ctx context.Context) *ExtrasTopologyMapsCreateParams { + var () + return &ExtrasTopologyMapsCreateParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsCreateParamsWithHTTPClient creates a new ExtrasTopologyMapsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsCreateParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsCreateParams { + var () + return &ExtrasTopologyMapsCreateParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsCreateParams contains all the parameters to send to the API endpoint +for the extras topology maps create operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsCreateParams struct { + + /*Data*/ + Data *models.WritableTopologyMap + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) WithContext(ctx context.Context) *ExtrasTopologyMapsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) WithData(data *models.WritableTopologyMap) *ExtrasTopologyMapsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras topology maps create params +func (o *ExtrasTopologyMapsCreateParams) SetData(data *models.WritableTopologyMap) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_create_responses.go b/netbox/client/extras/extras_topology_maps_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f6fb6a2929f7e41379da0728ca7d9df759fa3637 --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsCreateReader is a Reader for the ExtrasTopologyMapsCreate structure. +type ExtrasTopologyMapsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewExtrasTopologyMapsCreateCreated() + 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()) + } +} + +// NewExtrasTopologyMapsCreateCreated creates a ExtrasTopologyMapsCreateCreated with default headers values +func NewExtrasTopologyMapsCreateCreated() *ExtrasTopologyMapsCreateCreated { + return &ExtrasTopologyMapsCreateCreated{} +} + +/*ExtrasTopologyMapsCreateCreated handles this case with default header values. + +ExtrasTopologyMapsCreateCreated extras topology maps create created +*/ +type ExtrasTopologyMapsCreateCreated struct { + Payload *models.WritableTopologyMap +} + +func (o *ExtrasTopologyMapsCreateCreated) Error() string { + return fmt.Sprintf("[POST /extras/topology-maps/][%d] extrasTopologyMapsCreateCreated %+v", 201, o.Payload) +} + +func (o *ExtrasTopologyMapsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_delete_parameters.go b/netbox/client/extras/extras_topology_maps_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..22923d26afcf58aee2bf096d6ff5512f9bc604de --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTopologyMapsDeleteParams creates a new ExtrasTopologyMapsDeleteParams object +// with the default values initialized. +func NewExtrasTopologyMapsDeleteParams() *ExtrasTopologyMapsDeleteParams { + var () + return &ExtrasTopologyMapsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsDeleteParamsWithTimeout creates a new ExtrasTopologyMapsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsDeleteParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsDeleteParams { + var () + return &ExtrasTopologyMapsDeleteParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsDeleteParamsWithContext creates a new ExtrasTopologyMapsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsDeleteParamsWithContext(ctx context.Context) *ExtrasTopologyMapsDeleteParams { + var () + return &ExtrasTopologyMapsDeleteParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsDeleteParamsWithHTTPClient creates a new ExtrasTopologyMapsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsDeleteParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsDeleteParams { + var () + return &ExtrasTopologyMapsDeleteParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsDeleteParams contains all the parameters to send to the API endpoint +for the extras topology maps delete operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsDeleteParams struct { + + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) WithContext(ctx context.Context) *ExtrasTopologyMapsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) WithID(id int64) *ExtrasTopologyMapsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps delete params +func (o *ExtrasTopologyMapsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_delete_responses.go b/netbox/client/extras/extras_topology_maps_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1f94a584eb6b8c4f7a7621866b503a0298321c8a --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// ExtrasTopologyMapsDeleteReader is a Reader for the ExtrasTopologyMapsDelete structure. +type ExtrasTopologyMapsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewExtrasTopologyMapsDeleteNoContent() + 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()) + } +} + +// NewExtrasTopologyMapsDeleteNoContent creates a ExtrasTopologyMapsDeleteNoContent with default headers values +func NewExtrasTopologyMapsDeleteNoContent() *ExtrasTopologyMapsDeleteNoContent { + return &ExtrasTopologyMapsDeleteNoContent{} +} + +/*ExtrasTopologyMapsDeleteNoContent handles this case with default header values. + +ExtrasTopologyMapsDeleteNoContent extras topology maps delete no content +*/ +type ExtrasTopologyMapsDeleteNoContent struct { +} + +func (o *ExtrasTopologyMapsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /extras/topology-maps/{id}/][%d] extrasTopologyMapsDeleteNoContent ", 204) +} + +func (o *ExtrasTopologyMapsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_list_parameters.go b/netbox/client/extras/extras_topology_maps_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5d98e1d06fd0a9c3d39157160e55400113da7a92 --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_list_parameters.go @@ -0,0 +1,297 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTopologyMapsListParams creates a new ExtrasTopologyMapsListParams object +// with the default values initialized. +func NewExtrasTopologyMapsListParams() *ExtrasTopologyMapsListParams { + var () + return &ExtrasTopologyMapsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsListParamsWithTimeout creates a new ExtrasTopologyMapsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsListParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsListParams { + var () + return &ExtrasTopologyMapsListParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsListParamsWithContext creates a new ExtrasTopologyMapsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsListParamsWithContext(ctx context.Context) *ExtrasTopologyMapsListParams { + var () + return &ExtrasTopologyMapsListParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsListParamsWithHTTPClient creates a new ExtrasTopologyMapsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsListParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsListParams { + var () + return &ExtrasTopologyMapsListParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsListParams contains all the parameters to send to the API endpoint +for the extras topology maps list operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithContext(ctx context.Context) *ExtrasTopologyMapsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithLimit(limit *int64) *ExtrasTopologyMapsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithName(name *string) *ExtrasTopologyMapsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithOffset(offset *int64) *ExtrasTopologyMapsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithSite(site *string) *ExtrasTopologyMapsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithSiteID(siteID *string) *ExtrasTopologyMapsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSlug adds the slug to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) WithSlug(slug *string) *ExtrasTopologyMapsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the extras topology maps list params +func (o *ExtrasTopologyMapsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_list_responses.go b/netbox/client/extras/extras_topology_maps_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4016876a252ae7ab34007c88e902acc5540c096b --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsListReader is a Reader for the ExtrasTopologyMapsList structure. +type ExtrasTopologyMapsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsListOK() + 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()) + } +} + +// NewExtrasTopologyMapsListOK creates a ExtrasTopologyMapsListOK with default headers values +func NewExtrasTopologyMapsListOK() *ExtrasTopologyMapsListOK { + return &ExtrasTopologyMapsListOK{} +} + +/*ExtrasTopologyMapsListOK handles this case with default header values. + +ExtrasTopologyMapsListOK extras topology maps list o k +*/ +type ExtrasTopologyMapsListOK struct { + Payload *models.ExtrasTopologyMapsListOKBody +} + +func (o *ExtrasTopologyMapsListOK) Error() string { + return fmt.Sprintf("[GET /extras/topology-maps/][%d] extrasTopologyMapsListOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ExtrasTopologyMapsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_partial_update_parameters.go b/netbox/client/extras/extras_topology_maps_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..22854ef6980b73178fc68d88b6483c667589200b --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasTopologyMapsPartialUpdateParams creates a new ExtrasTopologyMapsPartialUpdateParams object +// with the default values initialized. +func NewExtrasTopologyMapsPartialUpdateParams() *ExtrasTopologyMapsPartialUpdateParams { + var () + return &ExtrasTopologyMapsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsPartialUpdateParamsWithTimeout creates a new ExtrasTopologyMapsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsPartialUpdateParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsPartialUpdateParams { + var () + return &ExtrasTopologyMapsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsPartialUpdateParamsWithContext creates a new ExtrasTopologyMapsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsPartialUpdateParamsWithContext(ctx context.Context) *ExtrasTopologyMapsPartialUpdateParams { + var () + return &ExtrasTopologyMapsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsPartialUpdateParamsWithHTTPClient creates a new ExtrasTopologyMapsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsPartialUpdateParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsPartialUpdateParams { + var () + return &ExtrasTopologyMapsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsPartialUpdateParams contains all the parameters to send to the API endpoint +for the extras topology maps partial update operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableTopologyMap + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithContext(ctx context.Context) *ExtrasTopologyMapsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithData(data *models.WritableTopologyMap) *ExtrasTopologyMapsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetData(data *models.WritableTopologyMap) { + o.Data = data +} + +// WithID adds the id to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) WithID(id int64) *ExtrasTopologyMapsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps partial update params +func (o *ExtrasTopologyMapsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_partial_update_responses.go b/netbox/client/extras/extras_topology_maps_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..42f32c44b0dd841cc25ddb1e5e7ca293671c5e3d --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsPartialUpdateReader is a Reader for the ExtrasTopologyMapsPartialUpdate structure. +type ExtrasTopologyMapsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsPartialUpdateOK() + 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()) + } +} + +// NewExtrasTopologyMapsPartialUpdateOK creates a ExtrasTopologyMapsPartialUpdateOK with default headers values +func NewExtrasTopologyMapsPartialUpdateOK() *ExtrasTopologyMapsPartialUpdateOK { + return &ExtrasTopologyMapsPartialUpdateOK{} +} + +/*ExtrasTopologyMapsPartialUpdateOK handles this case with default header values. + +ExtrasTopologyMapsPartialUpdateOK extras topology maps partial update o k +*/ +type ExtrasTopologyMapsPartialUpdateOK struct { + Payload *models.WritableTopologyMap +} + +func (o *ExtrasTopologyMapsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /extras/topology-maps/{id}/][%d] extrasTopologyMapsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_read_parameters.go b/netbox/client/extras/extras_topology_maps_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..190ec9c47114344d47e9a67d4aaa580c12e7e608 --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTopologyMapsReadParams creates a new ExtrasTopologyMapsReadParams object +// with the default values initialized. +func NewExtrasTopologyMapsReadParams() *ExtrasTopologyMapsReadParams { + var () + return &ExtrasTopologyMapsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsReadParamsWithTimeout creates a new ExtrasTopologyMapsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsReadParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsReadParams { + var () + return &ExtrasTopologyMapsReadParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsReadParamsWithContext creates a new ExtrasTopologyMapsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsReadParamsWithContext(ctx context.Context) *ExtrasTopologyMapsReadParams { + var () + return &ExtrasTopologyMapsReadParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsReadParamsWithHTTPClient creates a new ExtrasTopologyMapsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsReadParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsReadParams { + var () + return &ExtrasTopologyMapsReadParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsReadParams contains all the parameters to send to the API endpoint +for the extras topology maps read operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsReadParams struct { + + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) WithContext(ctx context.Context) *ExtrasTopologyMapsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) WithID(id int64) *ExtrasTopologyMapsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps read params +func (o *ExtrasTopologyMapsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_read_responses.go b/netbox/client/extras/extras_topology_maps_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8d62e05328348a9d9630e19603f345fc37867294 --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsReadReader is a Reader for the ExtrasTopologyMapsRead structure. +type ExtrasTopologyMapsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsReadOK() + 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()) + } +} + +// NewExtrasTopologyMapsReadOK creates a ExtrasTopologyMapsReadOK with default headers values +func NewExtrasTopologyMapsReadOK() *ExtrasTopologyMapsReadOK { + return &ExtrasTopologyMapsReadOK{} +} + +/*ExtrasTopologyMapsReadOK handles this case with default header values. + +ExtrasTopologyMapsReadOK extras topology maps read o k +*/ +type ExtrasTopologyMapsReadOK struct { + Payload *models.TopologyMap +} + +func (o *ExtrasTopologyMapsReadOK) Error() string { + return fmt.Sprintf("[GET /extras/topology-maps/{id}/][%d] extrasTopologyMapsReadOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_render_parameters.go b/netbox/client/extras/extras_topology_maps_render_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..40e517e2027e35dc49e6dc7bab1b141ce5e67df3 --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_render_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewExtrasTopologyMapsRenderParams creates a new ExtrasTopologyMapsRenderParams object +// with the default values initialized. +func NewExtrasTopologyMapsRenderParams() *ExtrasTopologyMapsRenderParams { + var () + return &ExtrasTopologyMapsRenderParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsRenderParamsWithTimeout creates a new ExtrasTopologyMapsRenderParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsRenderParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsRenderParams { + var () + return &ExtrasTopologyMapsRenderParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsRenderParamsWithContext creates a new ExtrasTopologyMapsRenderParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsRenderParamsWithContext(ctx context.Context) *ExtrasTopologyMapsRenderParams { + var () + return &ExtrasTopologyMapsRenderParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsRenderParamsWithHTTPClient creates a new ExtrasTopologyMapsRenderParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsRenderParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsRenderParams { + var () + return &ExtrasTopologyMapsRenderParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsRenderParams contains all the parameters to send to the API endpoint +for the extras topology maps render operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsRenderParams struct { + + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsRenderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) WithContext(ctx context.Context) *ExtrasTopologyMapsRenderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsRenderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) WithID(id int64) *ExtrasTopologyMapsRenderParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps render params +func (o *ExtrasTopologyMapsRenderParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsRenderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_render_responses.go b/netbox/client/extras/extras_topology_maps_render_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ae46fddaaac02555dbd9a8c222ad42fa90ff835d --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_render_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsRenderReader is a Reader for the ExtrasTopologyMapsRender structure. +type ExtrasTopologyMapsRenderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsRenderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsRenderOK() + 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()) + } +} + +// NewExtrasTopologyMapsRenderOK creates a ExtrasTopologyMapsRenderOK with default headers values +func NewExtrasTopologyMapsRenderOK() *ExtrasTopologyMapsRenderOK { + return &ExtrasTopologyMapsRenderOK{} +} + +/*ExtrasTopologyMapsRenderOK handles this case with default header values. + +ExtrasTopologyMapsRenderOK extras topology maps render o k +*/ +type ExtrasTopologyMapsRenderOK struct { + Payload *models.TopologyMap +} + +func (o *ExtrasTopologyMapsRenderOK) Error() string { + return fmt.Sprintf("[GET /extras/topology-maps/{id}/render/][%d] extrasTopologyMapsRenderOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsRenderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TopologyMap) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_update_parameters.go b/netbox/client/extras/extras_topology_maps_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..591783723557667fe1e2ce8ce3bba2f7dbbaed7f --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + "time" + + "golang.org/x/net/context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/swag" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewExtrasTopologyMapsUpdateParams creates a new ExtrasTopologyMapsUpdateParams object +// with the default values initialized. +func NewExtrasTopologyMapsUpdateParams() *ExtrasTopologyMapsUpdateParams { + var () + return &ExtrasTopologyMapsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewExtrasTopologyMapsUpdateParamsWithTimeout creates a new ExtrasTopologyMapsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewExtrasTopologyMapsUpdateParamsWithTimeout(timeout time.Duration) *ExtrasTopologyMapsUpdateParams { + var () + return &ExtrasTopologyMapsUpdateParams{ + + timeout: timeout, + } +} + +// NewExtrasTopologyMapsUpdateParamsWithContext creates a new ExtrasTopologyMapsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewExtrasTopologyMapsUpdateParamsWithContext(ctx context.Context) *ExtrasTopologyMapsUpdateParams { + var () + return &ExtrasTopologyMapsUpdateParams{ + + Context: ctx, + } +} + +// NewExtrasTopologyMapsUpdateParamsWithHTTPClient creates a new ExtrasTopologyMapsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewExtrasTopologyMapsUpdateParamsWithHTTPClient(client *http.Client) *ExtrasTopologyMapsUpdateParams { + var () + return &ExtrasTopologyMapsUpdateParams{ + HTTPClient: client, + } +} + +/*ExtrasTopologyMapsUpdateParams contains all the parameters to send to the API endpoint +for the extras topology maps update operation typically these are written to a http.Request +*/ +type ExtrasTopologyMapsUpdateParams struct { + + /*Data*/ + Data *models.WritableTopologyMap + /*ID + A unique integer value identifying this topology map. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithTimeout(timeout time.Duration) *ExtrasTopologyMapsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithContext(ctx context.Context) *ExtrasTopologyMapsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithHTTPClient(client *http.Client) *ExtrasTopologyMapsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithData(data *models.WritableTopologyMap) *ExtrasTopologyMapsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetData(data *models.WritableTopologyMap) { + o.Data = data +} + +// WithID adds the id to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) WithID(id int64) *ExtrasTopologyMapsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the extras topology maps update params +func (o *ExtrasTopologyMapsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *ExtrasTopologyMapsUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/extras/extras_topology_maps_update_responses.go b/netbox/client/extras/extras_topology_maps_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b6b9713f6546921242657578ac5a2197972da1ac --- /dev/null +++ b/netbox/client/extras/extras_topology_maps_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package extras + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "io" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// ExtrasTopologyMapsUpdateReader is a Reader for the ExtrasTopologyMapsUpdate structure. +type ExtrasTopologyMapsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ExtrasTopologyMapsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewExtrasTopologyMapsUpdateOK() + 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()) + } +} + +// NewExtrasTopologyMapsUpdateOK creates a ExtrasTopologyMapsUpdateOK with default headers values +func NewExtrasTopologyMapsUpdateOK() *ExtrasTopologyMapsUpdateOK { + return &ExtrasTopologyMapsUpdateOK{} +} + +/*ExtrasTopologyMapsUpdateOK handles this case with default header values. + +ExtrasTopologyMapsUpdateOK extras topology maps update o k +*/ +type ExtrasTopologyMapsUpdateOK struct { + Payload *models.WritableTopologyMap +} + +func (o *ExtrasTopologyMapsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /extras/topology-maps/{id}/][%d] extrasTopologyMapsUpdateOK %+v", 200, o.Payload) +} + +func (o *ExtrasTopologyMapsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTopologyMap) + + // 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 new file mode 100644 index 0000000000000000000000000000000000000000..9d0205f424a0a1d2e83223e2177f45623bff80e6 --- /dev/null +++ b/netbox/client/ipam/ip_am_client.go @@ -0,0 +1,1716 @@ +// 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 ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new ipam API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for ipam API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +IPAMChoicesList ipam choices list API +*/ +func (a *Client) IPAMChoicesList(params *IPAMChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam__choices_list", + Method: "GET", + PathPattern: "/ipam/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMChoicesListOK), nil + +} + +/* +IPAMChoicesRead ipam choices read API +*/ +func (a *Client) IPAMChoicesRead(params *IPAMChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam__choices_read", + Method: "GET", + PathPattern: "/ipam/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMChoicesReadOK), nil + +} + +/* +IPAMAggregatesCreate ipam aggregates create API +*/ +func (a *Client) IPAMAggregatesCreate(params *IPAMAggregatesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_create", + Method: "POST", + PathPattern: "/ipam/aggregates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesCreateCreated), nil + +} + +/* +IPAMAggregatesDelete ipam aggregates delete API +*/ +func (a *Client) IPAMAggregatesDelete(params *IPAMAggregatesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_delete", + Method: "DELETE", + PathPattern: "/ipam/aggregates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesDeleteNoContent), nil + +} + +/* +IPAMAggregatesList ipam aggregates list API +*/ +func (a *Client) IPAMAggregatesList(params *IPAMAggregatesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_list", + Method: "GET", + PathPattern: "/ipam/aggregates/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesListOK), nil + +} + +/* +IPAMAggregatesPartialUpdate ipam aggregates partial update API +*/ +func (a *Client) IPAMAggregatesPartialUpdate(params *IPAMAggregatesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_partial_update", + Method: "PATCH", + PathPattern: "/ipam/aggregates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesPartialUpdateOK), nil + +} + +/* +IPAMAggregatesRead ipam aggregates read API +*/ +func (a *Client) IPAMAggregatesRead(params *IPAMAggregatesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_read", + Method: "GET", + PathPattern: "/ipam/aggregates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesReadOK), nil + +} + +/* +IPAMAggregatesUpdate ipam aggregates update API +*/ +func (a *Client) IPAMAggregatesUpdate(params *IPAMAggregatesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMAggregatesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMAggregatesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_aggregates_update", + Method: "PUT", + PathPattern: "/ipam/aggregates/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMAggregatesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMAggregatesUpdateOK), nil + +} + +/* +IPAMIPAddressesCreate ipam ip addresses create API +*/ +func (a *Client) IPAMIPAddressesCreate(params *IPAMIPAddressesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_ip-addresses_create", + Method: "POST", + PathPattern: "/ipam/ip-addresses/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMIPAddressesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesCreateCreated), nil + +} + +/* +IPAMIPAddressesDelete ipam ip addresses delete API +*/ +func (a *Client) IPAMIPAddressesDelete(params *IPAMIPAddressesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_ip-addresses_delete", + Method: "DELETE", + PathPattern: "/ipam/ip-addresses/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMIPAddressesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesDeleteNoContent), nil + +} + +/* +IPAMIPAddressesList ipam ip addresses list API +*/ +func (a *Client) IPAMIPAddressesList(params *IPAMIPAddressesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_ip-addresses_list", + Method: "GET", + PathPattern: "/ipam/ip-addresses/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMIPAddressesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesListOK), nil + +} + +/* +IPAMIPAddressesPartialUpdate ipam ip addresses partial update API +*/ +func (a *Client) IPAMIPAddressesPartialUpdate(params *IPAMIPAddressesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_ip-addresses_partial_update", + Method: "PATCH", + PathPattern: "/ipam/ip-addresses/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMIPAddressesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesPartialUpdateOK), nil + +} + +/* +IPAMIPAddressesRead ipam ip addresses read API +*/ +func (a *Client) IPAMIPAddressesRead(params *IPAMIPAddressesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_ip-addresses_read", + Method: "GET", + PathPattern: "/ipam/ip-addresses/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMIPAddressesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesReadOK), nil + +} + +/* +IPAMIPAddressesUpdate ipam ip addresses update API +*/ +func (a *Client) IPAMIPAddressesUpdate(params *IPAMIPAddressesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMIPAddressesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMIPAddressesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_ip-addresses_update", + Method: "PUT", + PathPattern: "/ipam/ip-addresses/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMIPAddressesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMIPAddressesUpdateOK), nil + +} + +/* +IPAMPrefixesAvailableIpsCreate A convenience method for returning available IP addresses within a prefix. By default, the number of IPs +returned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be passed, +however results will not be paginated. +*/ +func (a *Client) IPAMPrefixesAvailableIpsCreate(params *IPAMPrefixesAvailableIpsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesAvailableIpsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesAvailableIpsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_available-ips_create", + Method: "POST", + PathPattern: "/ipam/prefixes/{id}/available-ips/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesAvailableIpsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesAvailableIpsCreateCreated), nil + +} + +/* +IPAMPrefixesAvailableIpsRead A convenience method for returning available IP addresses within a prefix. By default, the number of IPs +returned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be passed, +however results will not be paginated. +*/ +func (a *Client) IPAMPrefixesAvailableIpsRead(params *IPAMPrefixesAvailableIpsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesAvailableIpsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesAvailableIpsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_available-ips_read", + Method: "GET", + PathPattern: "/ipam/prefixes/{id}/available-ips/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesAvailableIpsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesAvailableIpsReadOK), nil + +} + +/* +IPAMPrefixesCreate ipam prefixes create API +*/ +func (a *Client) IPAMPrefixesCreate(params *IPAMPrefixesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_create", + Method: "POST", + PathPattern: "/ipam/prefixes/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesCreateCreated), nil + +} + +/* +IPAMPrefixesDelete ipam prefixes delete API +*/ +func (a *Client) IPAMPrefixesDelete(params *IPAMPrefixesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_delete", + Method: "DELETE", + PathPattern: "/ipam/prefixes/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesDeleteNoContent), nil + +} + +/* +IPAMPrefixesList ipam prefixes list API +*/ +func (a *Client) IPAMPrefixesList(params *IPAMPrefixesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_list", + Method: "GET", + PathPattern: "/ipam/prefixes/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesListOK), nil + +} + +/* +IPAMPrefixesPartialUpdate ipam prefixes partial update API +*/ +func (a *Client) IPAMPrefixesPartialUpdate(params *IPAMPrefixesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_partial_update", + Method: "PATCH", + PathPattern: "/ipam/prefixes/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesPartialUpdateOK), nil + +} + +/* +IPAMPrefixesRead ipam prefixes read API +*/ +func (a *Client) IPAMPrefixesRead(params *IPAMPrefixesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_read", + Method: "GET", + PathPattern: "/ipam/prefixes/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesReadOK), nil + +} + +/* +IPAMPrefixesUpdate ipam prefixes update API +*/ +func (a *Client) IPAMPrefixesUpdate(params *IPAMPrefixesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMPrefixesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMPrefixesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_prefixes_update", + Method: "PUT", + PathPattern: "/ipam/prefixes/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMPrefixesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMPrefixesUpdateOK), nil + +} + +/* +IPAMRirsCreate ipam rirs create API +*/ +func (a *Client) IPAMRirsCreate(params *IPAMRirsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_create", + Method: "POST", + PathPattern: "/ipam/rirs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsCreateCreated), nil + +} + +/* +IPAMRirsDelete ipam rirs delete API +*/ +func (a *Client) IPAMRirsDelete(params *IPAMRirsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_delete", + Method: "DELETE", + PathPattern: "/ipam/rirs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsDeleteNoContent), nil + +} + +/* +IPAMRirsList ipam rirs list API +*/ +func (a *Client) IPAMRirsList(params *IPAMRirsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_list", + Method: "GET", + PathPattern: "/ipam/rirs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsListOK), nil + +} + +/* +IPAMRirsPartialUpdate ipam rirs partial update API +*/ +func (a *Client) IPAMRirsPartialUpdate(params *IPAMRirsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_partial_update", + Method: "PATCH", + PathPattern: "/ipam/rirs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsPartialUpdateOK), nil + +} + +/* +IPAMRirsRead ipam rirs read API +*/ +func (a *Client) IPAMRirsRead(params *IPAMRirsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_read", + Method: "GET", + PathPattern: "/ipam/rirs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsReadOK), nil + +} + +/* +IPAMRirsUpdate ipam rirs update API +*/ +func (a *Client) IPAMRirsUpdate(params *IPAMRirsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRirsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRirsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_rirs_update", + Method: "PUT", + PathPattern: "/ipam/rirs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRirsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRirsUpdateOK), nil + +} + +/* +IPAMRolesCreate ipam roles create API +*/ +func (a *Client) IPAMRolesCreate(params *IPAMRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_create", + Method: "POST", + PathPattern: "/ipam/roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesCreateCreated), nil + +} + +/* +IPAMRolesDelete ipam roles delete API +*/ +func (a *Client) IPAMRolesDelete(params *IPAMRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_delete", + Method: "DELETE", + PathPattern: "/ipam/roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesDeleteNoContent), nil + +} + +/* +IPAMRolesList ipam roles list API +*/ +func (a *Client) IPAMRolesList(params *IPAMRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_list", + Method: "GET", + PathPattern: "/ipam/roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesListOK), nil + +} + +/* +IPAMRolesPartialUpdate ipam roles partial update API +*/ +func (a *Client) IPAMRolesPartialUpdate(params *IPAMRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_partial_update", + Method: "PATCH", + PathPattern: "/ipam/roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesPartialUpdateOK), nil + +} + +/* +IPAMRolesRead ipam roles read API +*/ +func (a *Client) IPAMRolesRead(params *IPAMRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_read", + Method: "GET", + PathPattern: "/ipam/roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesReadOK), nil + +} + +/* +IPAMRolesUpdate ipam roles update API +*/ +func (a *Client) IPAMRolesUpdate(params *IPAMRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMRolesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_roles_update", + Method: "PUT", + PathPattern: "/ipam/roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMRolesUpdateOK), nil + +} + +/* +IPAMServicesCreate ipam services create API +*/ +func (a *Client) IPAMServicesCreate(params *IPAMServicesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_create", + Method: "POST", + PathPattern: "/ipam/services/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesCreateCreated), nil + +} + +/* +IPAMServicesDelete ipam services delete API +*/ +func (a *Client) IPAMServicesDelete(params *IPAMServicesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_delete", + Method: "DELETE", + PathPattern: "/ipam/services/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesDeleteNoContent), nil + +} + +/* +IPAMServicesList ipam services list API +*/ +func (a *Client) IPAMServicesList(params *IPAMServicesListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_list", + Method: "GET", + PathPattern: "/ipam/services/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesListOK), nil + +} + +/* +IPAMServicesPartialUpdate ipam services partial update API +*/ +func (a *Client) IPAMServicesPartialUpdate(params *IPAMServicesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_partial_update", + Method: "PATCH", + PathPattern: "/ipam/services/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesPartialUpdateOK), nil + +} + +/* +IPAMServicesRead ipam services read API +*/ +func (a *Client) IPAMServicesRead(params *IPAMServicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_read", + Method: "GET", + PathPattern: "/ipam/services/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesReadOK), nil + +} + +/* +IPAMServicesUpdate ipam services update API +*/ +func (a *Client) IPAMServicesUpdate(params *IPAMServicesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMServicesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMServicesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_services_update", + Method: "PUT", + PathPattern: "/ipam/services/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMServicesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMServicesUpdateOK), nil + +} + +/* +IPAMVlanGroupsCreate ipam vlan groups create API +*/ +func (a *Client) IPAMVlanGroupsCreate(params *IPAMVlanGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_create", + Method: "POST", + PathPattern: "/ipam/vlan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsCreateCreated), nil + +} + +/* +IPAMVlanGroupsDelete ipam vlan groups delete API +*/ +func (a *Client) IPAMVlanGroupsDelete(params *IPAMVlanGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_delete", + Method: "DELETE", + PathPattern: "/ipam/vlan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsDeleteNoContent), nil + +} + +/* +IPAMVlanGroupsList ipam vlan groups list API +*/ +func (a *Client) IPAMVlanGroupsList(params *IPAMVlanGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_list", + Method: "GET", + PathPattern: "/ipam/vlan-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsListOK), nil + +} + +/* +IPAMVlanGroupsPartialUpdate ipam vlan groups partial update API +*/ +func (a *Client) IPAMVlanGroupsPartialUpdate(params *IPAMVlanGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_partial_update", + Method: "PATCH", + PathPattern: "/ipam/vlan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsPartialUpdateOK), nil + +} + +/* +IPAMVlanGroupsRead ipam vlan groups read API +*/ +func (a *Client) IPAMVlanGroupsRead(params *IPAMVlanGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_read", + Method: "GET", + PathPattern: "/ipam/vlan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsReadOK), nil + +} + +/* +IPAMVlanGroupsUpdate ipam vlan groups update API +*/ +func (a *Client) IPAMVlanGroupsUpdate(params *IPAMVlanGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlanGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlanGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlan-groups_update", + Method: "PUT", + PathPattern: "/ipam/vlan-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlanGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlanGroupsUpdateOK), nil + +} + +/* +IPAMVlansCreate ipam vlans create API +*/ +func (a *Client) IPAMVlansCreate(params *IPAMVlansCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_create", + Method: "POST", + PathPattern: "/ipam/vlans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansCreateCreated), nil + +} + +/* +IPAMVlansDelete ipam vlans delete API +*/ +func (a *Client) IPAMVlansDelete(params *IPAMVlansDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_delete", + Method: "DELETE", + PathPattern: "/ipam/vlans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansDeleteNoContent), nil + +} + +/* +IPAMVlansList ipam vlans list API +*/ +func (a *Client) IPAMVlansList(params *IPAMVlansListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_list", + Method: "GET", + PathPattern: "/ipam/vlans/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansListOK), nil + +} + +/* +IPAMVlansPartialUpdate ipam vlans partial update API +*/ +func (a *Client) IPAMVlansPartialUpdate(params *IPAMVlansPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_partial_update", + Method: "PATCH", + PathPattern: "/ipam/vlans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansPartialUpdateOK), nil + +} + +/* +IPAMVlansRead ipam vlans read API +*/ +func (a *Client) IPAMVlansRead(params *IPAMVlansReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_read", + Method: "GET", + PathPattern: "/ipam/vlans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansReadOK), nil + +} + +/* +IPAMVlansUpdate ipam vlans update API +*/ +func (a *Client) IPAMVlansUpdate(params *IPAMVlansUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVlansUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVlansUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vlans_update", + Method: "PUT", + PathPattern: "/ipam/vlans/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVlansUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVlansUpdateOK), nil + +} + +/* +IPAMVrfsCreate ipam vrfs create API +*/ +func (a *Client) IPAMVrfsCreate(params *IPAMVrfsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_create", + Method: "POST", + PathPattern: "/ipam/vrfs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsCreateCreated), nil + +} + +/* +IPAMVrfsDelete ipam vrfs delete API +*/ +func (a *Client) IPAMVrfsDelete(params *IPAMVrfsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_delete", + Method: "DELETE", + PathPattern: "/ipam/vrfs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsDeleteNoContent), nil + +} + +/* +IPAMVrfsList ipam vrfs list API +*/ +func (a *Client) IPAMVrfsList(params *IPAMVrfsListParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_list", + Method: "GET", + PathPattern: "/ipam/vrfs/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsListOK), nil + +} + +/* +IPAMVrfsPartialUpdate ipam vrfs partial update API +*/ +func (a *Client) IPAMVrfsPartialUpdate(params *IPAMVrfsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_partial_update", + Method: "PATCH", + PathPattern: "/ipam/vrfs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsPartialUpdateOK), nil + +} + +/* +IPAMVrfsRead ipam vrfs read API +*/ +func (a *Client) IPAMVrfsRead(params *IPAMVrfsReadParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_read", + Method: "GET", + PathPattern: "/ipam/vrfs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsReadOK), nil + +} + +/* +IPAMVrfsUpdate ipam vrfs update API +*/ +func (a *Client) IPAMVrfsUpdate(params *IPAMVrfsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*IPAMVrfsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewIPAMVrfsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "ipam_vrfs_update", + Method: "PUT", + PathPattern: "/ipam/vrfs/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &IPAMVrfsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*IPAMVrfsUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/netbox/client/ipam/ip_amaggregates_create_parameters.go b/netbox/client/ipam/ip_amaggregates_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..39808c30266cb183970cc08e364b5eadf6c7e764 --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMAggregatesCreateParams creates a new IPAMAggregatesCreateParams object +// with the default values initialized. +func NewIPAMAggregatesCreateParams() *IPAMAggregatesCreateParams { + var () + return &IPAMAggregatesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesCreateParamsWithTimeout creates a new IPAMAggregatesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesCreateParamsWithTimeout(timeout time.Duration) *IPAMAggregatesCreateParams { + var () + return &IPAMAggregatesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesCreateParamsWithContext creates a new IPAMAggregatesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesCreateParamsWithContext(ctx context.Context) *IPAMAggregatesCreateParams { + var () + return &IPAMAggregatesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesCreateParamsWithHTTPClient creates a new IPAMAggregatesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesCreateParamsWithHTTPClient(client *http.Client) *IPAMAggregatesCreateParams { + var () + return &IPAMAggregatesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesCreateParams contains all the parameters to send to the API endpoint +for the ipam aggregates create operation typically these are written to a http.Request +*/ +type IPAMAggregatesCreateParams struct { + + /*Data*/ + Data *models.WritableAggregate + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) WithTimeout(timeout time.Duration) *IPAMAggregatesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) WithContext(ctx context.Context) *IPAMAggregatesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) WithHTTPClient(client *http.Client) *IPAMAggregatesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) WithData(data *models.WritableAggregate) *IPAMAggregatesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam aggregates create params +func (o *IPAMAggregatesCreateParams) SetData(data *models.WritableAggregate) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesCreateParams) 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/ipam/ip_amaggregates_create_responses.go b/netbox/client/ipam/ip_amaggregates_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6fdc592b3e2a91ed220e652d2a8c09cfc8fbbba1 --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_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" +) + +// IPAMAggregatesCreateReader is a Reader for the IPAMAggregatesCreate structure. +type IPAMAggregatesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMAggregatesCreateCreated() + 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()) + } +} + +// NewIPAMAggregatesCreateCreated creates a IPAMAggregatesCreateCreated with default headers values +func NewIPAMAggregatesCreateCreated() *IPAMAggregatesCreateCreated { + return &IPAMAggregatesCreateCreated{} +} + +/*IPAMAggregatesCreateCreated handles this case with default header values. + +IPAMAggregatesCreateCreated ipam aggregates create created +*/ +type IPAMAggregatesCreateCreated struct { + Payload *models.WritableAggregate +} + +func (o *IPAMAggregatesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/aggregates/][%d] ipamAggregatesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMAggregatesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableAggregate) + + // 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_amaggregates_delete_parameters.go b/netbox/client/ipam/ip_amaggregates_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0b70512f61b74d9d64bcebb3a761d624486276fd --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_delete_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" +) + +// NewIPAMAggregatesDeleteParams creates a new IPAMAggregatesDeleteParams object +// with the default values initialized. +func NewIPAMAggregatesDeleteParams() *IPAMAggregatesDeleteParams { + var () + return &IPAMAggregatesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesDeleteParamsWithTimeout creates a new IPAMAggregatesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesDeleteParamsWithTimeout(timeout time.Duration) *IPAMAggregatesDeleteParams { + var () + return &IPAMAggregatesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesDeleteParamsWithContext creates a new IPAMAggregatesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesDeleteParamsWithContext(ctx context.Context) *IPAMAggregatesDeleteParams { + var () + return &IPAMAggregatesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesDeleteParamsWithHTTPClient creates a new IPAMAggregatesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesDeleteParamsWithHTTPClient(client *http.Client) *IPAMAggregatesDeleteParams { + var () + return &IPAMAggregatesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesDeleteParams contains all the parameters to send to the API endpoint +for the ipam aggregates delete operation typically these are written to a http.Request +*/ +type IPAMAggregatesDeleteParams struct { + + /*ID + A unique integer value identifying this aggregate. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) WithTimeout(timeout time.Duration) *IPAMAggregatesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) WithContext(ctx context.Context) *IPAMAggregatesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) WithHTTPClient(client *http.Client) *IPAMAggregatesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) WithID(id int64) *IPAMAggregatesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam aggregates delete params +func (o *IPAMAggregatesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesDeleteParams) 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_amaggregates_delete_responses.go b/netbox/client/ipam/ip_amaggregates_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..136309476490c003a7cecad4c3a96a19e69441a9 --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMAggregatesDeleteReader is a Reader for the IPAMAggregatesDelete structure. +type IPAMAggregatesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMAggregatesDeleteNoContent() + 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()) + } +} + +// NewIPAMAggregatesDeleteNoContent creates a IPAMAggregatesDeleteNoContent with default headers values +func NewIPAMAggregatesDeleteNoContent() *IPAMAggregatesDeleteNoContent { + return &IPAMAggregatesDeleteNoContent{} +} + +/*IPAMAggregatesDeleteNoContent handles this case with default header values. + +IPAMAggregatesDeleteNoContent ipam aggregates delete no content +*/ +type IPAMAggregatesDeleteNoContent struct { +} + +func (o *IPAMAggregatesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/aggregates/{id}/][%d] ipamAggregatesDeleteNoContent ", 204) +} + +func (o *IPAMAggregatesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amaggregates_list_parameters.go b/netbox/client/ipam/ip_amaggregates_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..bc7bbb3653822cf7227b1868073cc630602a12fc --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_list_parameters.go @@ -0,0 +1,358 @@ +// 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" +) + +// NewIPAMAggregatesListParams creates a new IPAMAggregatesListParams object +// with the default values initialized. +func NewIPAMAggregatesListParams() *IPAMAggregatesListParams { + var () + return &IPAMAggregatesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesListParamsWithTimeout creates a new IPAMAggregatesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesListParamsWithTimeout(timeout time.Duration) *IPAMAggregatesListParams { + var () + return &IPAMAggregatesListParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesListParamsWithContext creates a new IPAMAggregatesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesListParamsWithContext(ctx context.Context) *IPAMAggregatesListParams { + var () + return &IPAMAggregatesListParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesListParamsWithHTTPClient creates a new IPAMAggregatesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesListParamsWithHTTPClient(client *http.Client) *IPAMAggregatesListParams { + var () + return &IPAMAggregatesListParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesListParams contains all the parameters to send to the API endpoint +for the ipam aggregates list operation typically these are written to a http.Request +*/ +type IPAMAggregatesListParams struct { + + /*DateAdded*/ + DateAdded *string + /*Family*/ + Family *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Rir*/ + Rir *string + /*RirID*/ + RirID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithTimeout(timeout time.Duration) *IPAMAggregatesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithContext(ctx context.Context) *IPAMAggregatesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithHTTPClient(client *http.Client) *IPAMAggregatesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDateAdded adds the dateAdded to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithDateAdded(dateAdded *string) *IPAMAggregatesListParams { + o.SetDateAdded(dateAdded) + return o +} + +// SetDateAdded adds the dateAdded to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetDateAdded(dateAdded *string) { + o.DateAdded = dateAdded +} + +// WithFamily adds the family to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithFamily(family *string) *IPAMAggregatesListParams { + o.SetFamily(family) + return o +} + +// SetFamily adds the family to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetFamily(family *string) { + o.Family = family +} + +// WithIDIn adds the iDIn to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithIDIn(iDIn *float64) *IPAMAggregatesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithLimit(limit *int64) *IPAMAggregatesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithOffset(offset *int64) *IPAMAggregatesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithQ(q *string) *IPAMAggregatesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRir adds the rir to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithRir(rir *string) *IPAMAggregatesListParams { + o.SetRir(rir) + return o +} + +// SetRir adds the rir to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetRir(rir *string) { + o.Rir = rir +} + +// WithRirID adds the rirID to the ipam aggregates list params +func (o *IPAMAggregatesListParams) WithRirID(rirID *string) *IPAMAggregatesListParams { + o.SetRirID(rirID) + return o +} + +// SetRirID adds the rirId to the ipam aggregates list params +func (o *IPAMAggregatesListParams) SetRirID(rirID *string) { + o.RirID = rirID +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.DateAdded != nil { + + // query param date_added + var qrDateAdded string + if o.DateAdded != nil { + qrDateAdded = *o.DateAdded + } + qDateAdded := qrDateAdded + if qDateAdded != "" { + if err := r.SetQueryParam("date_added", qDateAdded); err != nil { + return err + } + } + + } + + if o.Family != nil { + + // query param family + var qrFamily string + if o.Family != nil { + qrFamily = *o.Family + } + qFamily := qrFamily + if qFamily != "" { + if err := r.SetQueryParam("family", qFamily); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Rir != nil { + + // query param rir + var qrRir string + if o.Rir != nil { + qrRir = *o.Rir + } + qRir := qrRir + if qRir != "" { + if err := r.SetQueryParam("rir", qRir); err != nil { + return err + } + } + + } + + if o.RirID != nil { + + // query param rir_id + var qrRirID string + if o.RirID != nil { + qrRirID = *o.RirID + } + qRirID := qrRirID + if qRirID != "" { + if err := r.SetQueryParam("rir_id", qRirID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amaggregates_list_responses.go b/netbox/client/ipam/ip_amaggregates_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fc9576c2a193a76031741ca204596bf19d2862b3 --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_list_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" +) + +// IPAMAggregatesListReader is a Reader for the IPAMAggregatesList structure. +type IPAMAggregatesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMAggregatesListOK creates a IPAMAggregatesListOK with default headers values +func NewIPAMAggregatesListOK() *IPAMAggregatesListOK { + return &IPAMAggregatesListOK{} +} + +/*IPAMAggregatesListOK handles this case with default header values. + +IPAMAggregatesListOK ipam aggregates list o k +*/ +type IPAMAggregatesListOK struct { + Payload *models.IPAMAggregatesListOKBody +} + +func (o *IPAMAggregatesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/aggregates/][%d] ipamAggregatesListOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMAggregatesListOKBody) + + // 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_amaggregates_partial_update_parameters.go b/netbox/client/ipam/ip_amaggregates_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f7aea66f33082fe53454f35a6ddb6476b47100ab --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_partial_update_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" +) + +// NewIPAMAggregatesPartialUpdateParams creates a new IPAMAggregatesPartialUpdateParams object +// with the default values initialized. +func NewIPAMAggregatesPartialUpdateParams() *IPAMAggregatesPartialUpdateParams { + var () + return &IPAMAggregatesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesPartialUpdateParamsWithTimeout creates a new IPAMAggregatesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMAggregatesPartialUpdateParams { + var () + return &IPAMAggregatesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesPartialUpdateParamsWithContext creates a new IPAMAggregatesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesPartialUpdateParamsWithContext(ctx context.Context) *IPAMAggregatesPartialUpdateParams { + var () + return &IPAMAggregatesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesPartialUpdateParamsWithHTTPClient creates a new IPAMAggregatesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMAggregatesPartialUpdateParams { + var () + return &IPAMAggregatesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam aggregates partial update operation typically these are written to a http.Request +*/ +type IPAMAggregatesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableAggregate + /*ID + A unique integer value identifying this aggregate. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMAggregatesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithContext(ctx context.Context) *IPAMAggregatesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMAggregatesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithData(data *models.WritableAggregate) *IPAMAggregatesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetData(data *models.WritableAggregate) { + o.Data = data +} + +// WithID adds the id to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) WithID(id int64) *IPAMAggregatesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam aggregates partial update params +func (o *IPAMAggregatesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amaggregates_partial_update_responses.go b/netbox/client/ipam/ip_amaggregates_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..54a97076fbd9f5587362eb2a09e683b63d69969d --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_partial_update_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" +) + +// IPAMAggregatesPartialUpdateReader is a Reader for the IPAMAggregatesPartialUpdate structure. +type IPAMAggregatesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesPartialUpdateOK() + 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()) + } +} + +// NewIPAMAggregatesPartialUpdateOK creates a IPAMAggregatesPartialUpdateOK with default headers values +func NewIPAMAggregatesPartialUpdateOK() *IPAMAggregatesPartialUpdateOK { + return &IPAMAggregatesPartialUpdateOK{} +} + +/*IPAMAggregatesPartialUpdateOK handles this case with default header values. + +IPAMAggregatesPartialUpdateOK ipam aggregates partial update o k +*/ +type IPAMAggregatesPartialUpdateOK struct { + Payload *models.WritableAggregate +} + +func (o *IPAMAggregatesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/aggregates/{id}/][%d] ipamAggregatesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableAggregate) + + // 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_amaggregates_read_parameters.go b/netbox/client/ipam/ip_amaggregates_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c809c1c81c171c29b642c8c7fcdc688f31a73ce5 --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_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" +) + +// NewIPAMAggregatesReadParams creates a new IPAMAggregatesReadParams object +// with the default values initialized. +func NewIPAMAggregatesReadParams() *IPAMAggregatesReadParams { + var () + return &IPAMAggregatesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesReadParamsWithTimeout creates a new IPAMAggregatesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesReadParamsWithTimeout(timeout time.Duration) *IPAMAggregatesReadParams { + var () + return &IPAMAggregatesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesReadParamsWithContext creates a new IPAMAggregatesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesReadParamsWithContext(ctx context.Context) *IPAMAggregatesReadParams { + var () + return &IPAMAggregatesReadParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesReadParamsWithHTTPClient creates a new IPAMAggregatesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesReadParamsWithHTTPClient(client *http.Client) *IPAMAggregatesReadParams { + var () + return &IPAMAggregatesReadParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesReadParams contains all the parameters to send to the API endpoint +for the ipam aggregates read operation typically these are written to a http.Request +*/ +type IPAMAggregatesReadParams struct { + + /*ID + A unique integer value identifying this aggregate. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) WithTimeout(timeout time.Duration) *IPAMAggregatesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) WithContext(ctx context.Context) *IPAMAggregatesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) WithHTTPClient(client *http.Client) *IPAMAggregatesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) WithID(id int64) *IPAMAggregatesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam aggregates read params +func (o *IPAMAggregatesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesReadParams) 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_amaggregates_read_responses.go b/netbox/client/ipam/ip_amaggregates_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ee9d5301be00f84f20677ff3f6588da1194de74a --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_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" +) + +// IPAMAggregatesReadReader is a Reader for the IPAMAggregatesRead structure. +type IPAMAggregatesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesReadOK() + 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()) + } +} + +// NewIPAMAggregatesReadOK creates a IPAMAggregatesReadOK with default headers values +func NewIPAMAggregatesReadOK() *IPAMAggregatesReadOK { + return &IPAMAggregatesReadOK{} +} + +/*IPAMAggregatesReadOK handles this case with default header values. + +IPAMAggregatesReadOK ipam aggregates read o k +*/ +type IPAMAggregatesReadOK struct { + Payload *models.Aggregate +} + +func (o *IPAMAggregatesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/aggregates/{id}/][%d] ipamAggregatesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Aggregate) + + // 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_amaggregates_update_parameters.go b/netbox/client/ipam/ip_amaggregates_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..81760e4ca3a20e6b906389280cf2d520790fb596 --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_update_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" +) + +// NewIPAMAggregatesUpdateParams creates a new IPAMAggregatesUpdateParams object +// with the default values initialized. +func NewIPAMAggregatesUpdateParams() *IPAMAggregatesUpdateParams { + var () + return &IPAMAggregatesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMAggregatesUpdateParamsWithTimeout creates a new IPAMAggregatesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMAggregatesUpdateParamsWithTimeout(timeout time.Duration) *IPAMAggregatesUpdateParams { + var () + return &IPAMAggregatesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMAggregatesUpdateParamsWithContext creates a new IPAMAggregatesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMAggregatesUpdateParamsWithContext(ctx context.Context) *IPAMAggregatesUpdateParams { + var () + return &IPAMAggregatesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMAggregatesUpdateParamsWithHTTPClient creates a new IPAMAggregatesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMAggregatesUpdateParamsWithHTTPClient(client *http.Client) *IPAMAggregatesUpdateParams { + var () + return &IPAMAggregatesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMAggregatesUpdateParams contains all the parameters to send to the API endpoint +for the ipam aggregates update operation typically these are written to a http.Request +*/ +type IPAMAggregatesUpdateParams struct { + + /*Data*/ + Data *models.WritableAggregate + /*ID + A unique integer value identifying this aggregate. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithTimeout(timeout time.Duration) *IPAMAggregatesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithContext(ctx context.Context) *IPAMAggregatesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithHTTPClient(client *http.Client) *IPAMAggregatesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithData(data *models.WritableAggregate) *IPAMAggregatesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetData(data *models.WritableAggregate) { + o.Data = data +} + +// WithID adds the id to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) WithID(id int64) *IPAMAggregatesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam aggregates update params +func (o *IPAMAggregatesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMAggregatesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amaggregates_update_responses.go b/netbox/client/ipam/ip_amaggregates_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3d5293123aa56fdd6cf957bee0aeb7b1524066ab --- /dev/null +++ b/netbox/client/ipam/ip_amaggregates_update_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" +) + +// IPAMAggregatesUpdateReader is a Reader for the IPAMAggregatesUpdate structure. +type IPAMAggregatesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMAggregatesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMAggregatesUpdateOK() + 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()) + } +} + +// NewIPAMAggregatesUpdateOK creates a IPAMAggregatesUpdateOK with default headers values +func NewIPAMAggregatesUpdateOK() *IPAMAggregatesUpdateOK { + return &IPAMAggregatesUpdateOK{} +} + +/*IPAMAggregatesUpdateOK handles this case with default header values. + +IPAMAggregatesUpdateOK ipam aggregates update o k +*/ +type IPAMAggregatesUpdateOK struct { + Payload *models.WritableAggregate +} + +func (o *IPAMAggregatesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/aggregates/{id}/][%d] ipamAggregatesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMAggregatesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableAggregate) + + // 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_amchoices_list_parameters.go b/netbox/client/ipam/ip_amchoices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..cbe5053d46fc9f4b7bfd41f9f98a0b39b58458ac --- /dev/null +++ b/netbox/client/ipam/ip_amchoices_list_parameters.go @@ -0,0 +1,114 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMChoicesListParams creates a new IPAMChoicesListParams object +// with the default values initialized. +func NewIPAMChoicesListParams() *IPAMChoicesListParams { + + return &IPAMChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMChoicesListParamsWithTimeout creates a new IPAMChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMChoicesListParamsWithTimeout(timeout time.Duration) *IPAMChoicesListParams { + + return &IPAMChoicesListParams{ + + timeout: timeout, + } +} + +// NewIPAMChoicesListParamsWithContext creates a new IPAMChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMChoicesListParamsWithContext(ctx context.Context) *IPAMChoicesListParams { + + return &IPAMChoicesListParams{ + + Context: ctx, + } +} + +// NewIPAMChoicesListParamsWithHTTPClient creates a new IPAMChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMChoicesListParamsWithHTTPClient(client *http.Client) *IPAMChoicesListParams { + + return &IPAMChoicesListParams{ + HTTPClient: client, + } +} + +/*IPAMChoicesListParams contains all the parameters to send to the API endpoint +for the ipam choices list operation typically these are written to a http.Request +*/ +type IPAMChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam choices list params +func (o *IPAMChoicesListParams) WithTimeout(timeout time.Duration) *IPAMChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam choices list params +func (o *IPAMChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam choices list params +func (o *IPAMChoicesListParams) WithContext(ctx context.Context) *IPAMChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam choices list params +func (o *IPAMChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam choices list params +func (o *IPAMChoicesListParams) WithHTTPClient(client *http.Client) *IPAMChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam choices list params +func (o *IPAMChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMChoicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amchoices_list_responses.go b/netbox/client/ipam/ip_amchoices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..df838f9b40b3505f65cc3e2aa6e041bbd3120672 --- /dev/null +++ b/netbox/client/ipam/ip_amchoices_list_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMChoicesListReader is a Reader for the IPAMChoicesList structure. +type IPAMChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMChoicesListOK() + 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()) + } +} + +// NewIPAMChoicesListOK creates a IPAMChoicesListOK with default headers values +func NewIPAMChoicesListOK() *IPAMChoicesListOK { + return &IPAMChoicesListOK{} +} + +/*IPAMChoicesListOK handles this case with default header values. + +IPAMChoicesListOK ipam choices list o k +*/ +type IPAMChoicesListOK struct { +} + +func (o *IPAMChoicesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/_choices/][%d] ipamChoicesListOK ", 200) +} + +func (o *IPAMChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amchoices_read_parameters.go b/netbox/client/ipam/ip_amchoices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a9d43496babaf0a1f60a43579d179facbacab19b --- /dev/null +++ b/netbox/client/ipam/ip_amchoices_read_parameters.go @@ -0,0 +1,134 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" +) + +// NewIPAMChoicesReadParams creates a new IPAMChoicesReadParams object +// with the default values initialized. +func NewIPAMChoicesReadParams() *IPAMChoicesReadParams { + var () + return &IPAMChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMChoicesReadParamsWithTimeout creates a new IPAMChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMChoicesReadParamsWithTimeout(timeout time.Duration) *IPAMChoicesReadParams { + var () + return &IPAMChoicesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMChoicesReadParamsWithContext creates a new IPAMChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMChoicesReadParamsWithContext(ctx context.Context) *IPAMChoicesReadParams { + var () + return &IPAMChoicesReadParams{ + + Context: ctx, + } +} + +// NewIPAMChoicesReadParamsWithHTTPClient creates a new IPAMChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMChoicesReadParamsWithHTTPClient(client *http.Client) *IPAMChoicesReadParams { + var () + return &IPAMChoicesReadParams{ + HTTPClient: client, + } +} + +/*IPAMChoicesReadParams contains all the parameters to send to the API endpoint +for the ipam choices read operation typically these are written to a http.Request +*/ +type IPAMChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam choices read params +func (o *IPAMChoicesReadParams) WithTimeout(timeout time.Duration) *IPAMChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam choices read params +func (o *IPAMChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam choices read params +func (o *IPAMChoicesReadParams) WithContext(ctx context.Context) *IPAMChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam choices read params +func (o *IPAMChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam choices read params +func (o *IPAMChoicesReadParams) WithHTTPClient(client *http.Client) *IPAMChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam choices read params +func (o *IPAMChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam choices read params +func (o *IPAMChoicesReadParams) WithID(id string) *IPAMChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam choices read params +func (o *IPAMChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMChoicesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amchoices_read_responses.go b/netbox/client/ipam/ip_amchoices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a960fb05056da8eaf1a6669dbbfabaade807aa86 --- /dev/null +++ b/netbox/client/ipam/ip_amchoices_read_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMChoicesReadReader is a Reader for the IPAMChoicesRead structure. +type IPAMChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMChoicesReadOK() + 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()) + } +} + +// NewIPAMChoicesReadOK creates a IPAMChoicesReadOK with default headers values +func NewIPAMChoicesReadOK() *IPAMChoicesReadOK { + return &IPAMChoicesReadOK{} +} + +/*IPAMChoicesReadOK handles this case with default header values. + +IPAMChoicesReadOK ipam choices read o k +*/ +type IPAMChoicesReadOK struct { +} + +func (o *IPAMChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/_choices/{id}/][%d] ipamChoicesReadOK ", 200) +} + +func (o *IPAMChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amip_addresses_create_parameters.go b/netbox/client/ipam/ip_amip_addresses_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2e00a14540a90f143e7ad96d00d9f817e14d9f4d --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMIPAddressesCreateParams creates a new IPAMIPAddressesCreateParams object +// with the default values initialized. +func NewIPAMIPAddressesCreateParams() *IPAMIPAddressesCreateParams { + var () + return &IPAMIPAddressesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesCreateParamsWithTimeout creates a new IPAMIPAddressesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesCreateParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesCreateParams { + var () + return &IPAMIPAddressesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesCreateParamsWithContext creates a new IPAMIPAddressesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesCreateParamsWithContext(ctx context.Context) *IPAMIPAddressesCreateParams { + var () + return &IPAMIPAddressesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesCreateParamsWithHTTPClient creates a new IPAMIPAddressesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesCreateParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesCreateParams { + var () + return &IPAMIPAddressesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesCreateParams contains all the parameters to send to the API endpoint +for the ipam ip addresses create operation typically these are written to a http.Request +*/ +type IPAMIPAddressesCreateParams struct { + + /*Data*/ + Data *models.WritableIPAddress + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) WithContext(ctx context.Context) *IPAMIPAddressesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) WithData(data *models.WritableIPAddress) *IPAMIPAddressesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam ip addresses create params +func (o *IPAMIPAddressesCreateParams) SetData(data *models.WritableIPAddress) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesCreateParams) 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/ipam/ip_amip_addresses_create_responses.go b/netbox/client/ipam/ip_amip_addresses_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a0c57230789e85bbc6c108183f3ff5ef30908792 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_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" +) + +// IPAMIPAddressesCreateReader is a Reader for the IPAMIPAddressesCreate structure. +type IPAMIPAddressesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMIPAddressesCreateCreated() + 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()) + } +} + +// NewIPAMIPAddressesCreateCreated creates a IPAMIPAddressesCreateCreated with default headers values +func NewIPAMIPAddressesCreateCreated() *IPAMIPAddressesCreateCreated { + return &IPAMIPAddressesCreateCreated{} +} + +/*IPAMIPAddressesCreateCreated handles this case with default header values. + +IPAMIPAddressesCreateCreated ipam Ip addresses create created +*/ +type IPAMIPAddressesCreateCreated struct { + Payload *models.WritableIPAddress +} + +func (o *IPAMIPAddressesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/ip-addresses/][%d] ipamIpAddressesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMIPAddressesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableIPAddress) + + // 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_amip_addresses_delete_parameters.go b/netbox/client/ipam/ip_amip_addresses_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..68f8997f1920c5e054583a028703e383fc763234 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_delete_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" +) + +// NewIPAMIPAddressesDeleteParams creates a new IPAMIPAddressesDeleteParams object +// with the default values initialized. +func NewIPAMIPAddressesDeleteParams() *IPAMIPAddressesDeleteParams { + var () + return &IPAMIPAddressesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesDeleteParamsWithTimeout creates a new IPAMIPAddressesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesDeleteParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesDeleteParams { + var () + return &IPAMIPAddressesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesDeleteParamsWithContext creates a new IPAMIPAddressesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesDeleteParamsWithContext(ctx context.Context) *IPAMIPAddressesDeleteParams { + var () + return &IPAMIPAddressesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesDeleteParamsWithHTTPClient creates a new IPAMIPAddressesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesDeleteParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesDeleteParams { + var () + return &IPAMIPAddressesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesDeleteParams contains all the parameters to send to the API endpoint +for the ipam ip addresses delete operation typically these are written to a http.Request +*/ +type IPAMIPAddressesDeleteParams struct { + + /*ID + A unique integer value identifying this IP address. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) WithContext(ctx context.Context) *IPAMIPAddressesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) WithID(id int64) *IPAMIPAddressesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam ip addresses delete params +func (o *IPAMIPAddressesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amip_addresses_delete_responses.go b/netbox/client/ipam/ip_amip_addresses_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a8b5474b047c37470ce321e1c58bf0cc70f7251d --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMIPAddressesDeleteReader is a Reader for the IPAMIPAddressesDelete structure. +type IPAMIPAddressesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMIPAddressesDeleteNoContent() + 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()) + } +} + +// NewIPAMIPAddressesDeleteNoContent creates a IPAMIPAddressesDeleteNoContent with default headers values +func NewIPAMIPAddressesDeleteNoContent() *IPAMIPAddressesDeleteNoContent { + return &IPAMIPAddressesDeleteNoContent{} +} + +/*IPAMIPAddressesDeleteNoContent handles this case with default header values. + +IPAMIPAddressesDeleteNoContent ipam Ip addresses delete no content +*/ +type IPAMIPAddressesDeleteNoContent struct { +} + +func (o *IPAMIPAddressesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/ip-addresses/{id}/][%d] ipamIpAddressesDeleteNoContent ", 204) +} + +func (o *IPAMIPAddressesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amip_addresses_list_parameters.go b/netbox/client/ipam/ip_amip_addresses_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b6872a821aee95bda3c059a2b71194a265fc8748 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_list_parameters.go @@ -0,0 +1,648 @@ +// 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" +) + +// NewIPAMIPAddressesListParams creates a new IPAMIPAddressesListParams object +// with the default values initialized. +func NewIPAMIPAddressesListParams() *IPAMIPAddressesListParams { + var () + return &IPAMIPAddressesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesListParamsWithTimeout creates a new IPAMIPAddressesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesListParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesListParams { + var () + return &IPAMIPAddressesListParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesListParamsWithContext creates a new IPAMIPAddressesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesListParamsWithContext(ctx context.Context) *IPAMIPAddressesListParams { + var () + return &IPAMIPAddressesListParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesListParamsWithHTTPClient creates a new IPAMIPAddressesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesListParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesListParams { + var () + return &IPAMIPAddressesListParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesListParams contains all the parameters to send to the API endpoint +for the ipam ip addresses list operation typically these are written to a http.Request +*/ +type IPAMIPAddressesListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Family*/ + Family *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*InterfaceID*/ + InterfaceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MaskLength*/ + MaskLength *float64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Parent*/ + Parent *string + /*Q*/ + Q *string + /*Role*/ + Role *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*VirtualMachine*/ + VirtualMachine *string + /*VirtualMachineID*/ + VirtualMachineID *string + /*Vrf*/ + Vrf *string + /*VrfID*/ + VrfID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithContext(ctx context.Context) *IPAMIPAddressesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithDevice(device *string) *IPAMIPAddressesListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithDeviceID(deviceID *string) *IPAMIPAddressesListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithFamily adds the family to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithFamily(family *string) *IPAMIPAddressesListParams { + o.SetFamily(family) + return o +} + +// SetFamily adds the family to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetFamily(family *string) { + o.Family = family +} + +// WithIDIn adds the iDIn to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithIDIn(iDIn *float64) *IPAMIPAddressesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithInterfaceID adds the interfaceID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithInterfaceID(interfaceID *string) *IPAMIPAddressesListParams { + o.SetInterfaceID(interfaceID) + return o +} + +// SetInterfaceID adds the interfaceId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetInterfaceID(interfaceID *string) { + o.InterfaceID = interfaceID +} + +// WithLimit adds the limit to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithLimit(limit *int64) *IPAMIPAddressesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMaskLength adds the maskLength to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithMaskLength(maskLength *float64) *IPAMIPAddressesListParams { + o.SetMaskLength(maskLength) + return o +} + +// SetMaskLength adds the maskLength to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetMaskLength(maskLength *float64) { + o.MaskLength = maskLength +} + +// WithOffset adds the offset to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithOffset(offset *int64) *IPAMIPAddressesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithParent adds the parent to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithParent(parent *string) *IPAMIPAddressesListParams { + o.SetParent(parent) + return o +} + +// SetParent adds the parent to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetParent(parent *string) { + o.Parent = parent +} + +// WithQ adds the q to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithQ(q *string) *IPAMIPAddressesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithRole(role *string) *IPAMIPAddressesListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetRole(role *string) { + o.Role = role +} + +// WithStatus adds the status to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithStatus(status *string) *IPAMIPAddressesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTenant(tenant *string) *IPAMIPAddressesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithTenantID(tenantID *string) *IPAMIPAddressesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithVirtualMachine adds the virtualMachine to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithVirtualMachine(virtualMachine *string) *IPAMIPAddressesListParams { + o.SetVirtualMachine(virtualMachine) + return o +} + +// SetVirtualMachine adds the virtualMachine to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetVirtualMachine(virtualMachine *string) { + o.VirtualMachine = virtualMachine +} + +// WithVirtualMachineID adds the virtualMachineID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithVirtualMachineID(virtualMachineID *string) *IPAMIPAddressesListParams { + o.SetVirtualMachineID(virtualMachineID) + return o +} + +// SetVirtualMachineID adds the virtualMachineId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetVirtualMachineID(virtualMachineID *string) { + o.VirtualMachineID = virtualMachineID +} + +// WithVrf adds the vrf to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithVrf(vrf *string) *IPAMIPAddressesListParams { + o.SetVrf(vrf) + return o +} + +// SetVrf adds the vrf to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetVrf(vrf *string) { + o.Vrf = vrf +} + +// WithVrfID adds the vrfID to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) WithVrfID(vrfID *string) *IPAMIPAddressesListParams { + o.SetVrfID(vrfID) + return o +} + +// SetVrfID adds the vrfId to the ipam ip addresses list params +func (o *IPAMIPAddressesListParams) SetVrfID(vrfID *string) { + o.VrfID = vrfID +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Family != nil { + + // query param family + var qrFamily string + if o.Family != nil { + qrFamily = *o.Family + } + qFamily := qrFamily + if qFamily != "" { + if err := r.SetQueryParam("family", qFamily); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.InterfaceID != nil { + + // query param interface_id + var qrInterfaceID string + if o.InterfaceID != nil { + qrInterfaceID = *o.InterfaceID + } + qInterfaceID := qrInterfaceID + if qInterfaceID != "" { + if err := r.SetQueryParam("interface_id", qInterfaceID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.MaskLength != nil { + + // query param mask_length + var qrMaskLength float64 + if o.MaskLength != nil { + qrMaskLength = *o.MaskLength + } + qMaskLength := swag.FormatFloat64(qrMaskLength) + if qMaskLength != "" { + if err := r.SetQueryParam("mask_length", qMaskLength); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.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 + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Role != nil { + + // query param role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + + } + + if o.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 + 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.VirtualMachine != nil { + + // query param virtual_machine + var qrVirtualMachine string + if o.VirtualMachine != nil { + qrVirtualMachine = *o.VirtualMachine + } + qVirtualMachine := qrVirtualMachine + if qVirtualMachine != "" { + if err := r.SetQueryParam("virtual_machine", qVirtualMachine); err != nil { + return err + } + } + + } + + if o.VirtualMachineID != nil { + + // query param virtual_machine_id + var qrVirtualMachineID string + if o.VirtualMachineID != nil { + qrVirtualMachineID = *o.VirtualMachineID + } + qVirtualMachineID := qrVirtualMachineID + if qVirtualMachineID != "" { + if err := r.SetQueryParam("virtual_machine_id", qVirtualMachineID); err != nil { + return err + } + } + + } + + if o.Vrf != nil { + + // query param vrf + var qrVrf string + if o.Vrf != nil { + qrVrf = *o.Vrf + } + qVrf := qrVrf + if qVrf != "" { + if err := r.SetQueryParam("vrf", qVrf); err != nil { + return err + } + } + + } + + if o.VrfID != nil { + + // query param vrf_id + var qrVrfID string + if o.VrfID != nil { + qrVrfID = *o.VrfID + } + qVrfID := qrVrfID + if qVrfID != "" { + if err := r.SetQueryParam("vrf_id", qVrfID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amip_addresses_list_responses.go b/netbox/client/ipam/ip_amip_addresses_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c1bedf1daa214a166b1469623109496f7e990ee0 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_list_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" +) + +// IPAMIPAddressesListReader is a Reader for the IPAMIPAddressesList structure. +type IPAMIPAddressesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMIPAddressesListOK creates a IPAMIPAddressesListOK with default headers values +func NewIPAMIPAddressesListOK() *IPAMIPAddressesListOK { + return &IPAMIPAddressesListOK{} +} + +/*IPAMIPAddressesListOK handles this case with default header values. + +IPAMIPAddressesListOK ipam Ip addresses list o k +*/ +type IPAMIPAddressesListOK struct { + Payload *models.IPAMIPAddressesListOKBody +} + +func (o *IPAMIPAddressesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/ip-addresses/][%d] ipamIpAddressesListOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMIPAddressesListOKBody) + + // 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_amip_addresses_partial_update_parameters.go b/netbox/client/ipam/ip_amip_addresses_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a0e9a5585425ad253f453d99a97b1bb25bf82614 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_partial_update_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" +) + +// NewIPAMIPAddressesPartialUpdateParams creates a new IPAMIPAddressesPartialUpdateParams object +// with the default values initialized. +func NewIPAMIPAddressesPartialUpdateParams() *IPAMIPAddressesPartialUpdateParams { + var () + return &IPAMIPAddressesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesPartialUpdateParamsWithTimeout creates a new IPAMIPAddressesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesPartialUpdateParams { + var () + return &IPAMIPAddressesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesPartialUpdateParamsWithContext creates a new IPAMIPAddressesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesPartialUpdateParamsWithContext(ctx context.Context) *IPAMIPAddressesPartialUpdateParams { + var () + return &IPAMIPAddressesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesPartialUpdateParamsWithHTTPClient creates a new IPAMIPAddressesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesPartialUpdateParams { + var () + return &IPAMIPAddressesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam ip addresses partial update operation typically these are written to a http.Request +*/ +type IPAMIPAddressesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableIPAddress + /*ID + A unique integer value identifying this IP address. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithContext(ctx context.Context) *IPAMIPAddressesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithData(data *models.WritableIPAddress) *IPAMIPAddressesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetData(data *models.WritableIPAddress) { + o.Data = data +} + +// WithID adds the id to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) WithID(id int64) *IPAMIPAddressesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam ip addresses partial update params +func (o *IPAMIPAddressesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesPartialUpdateParams) 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_amip_addresses_partial_update_responses.go b/netbox/client/ipam/ip_amip_addresses_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7950750786bc7ee09de5eb3d68438c1110c7ff48 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_partial_update_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" +) + +// IPAMIPAddressesPartialUpdateReader is a Reader for the IPAMIPAddressesPartialUpdate structure. +type IPAMIPAddressesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesPartialUpdateOK() + 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()) + } +} + +// NewIPAMIPAddressesPartialUpdateOK creates a IPAMIPAddressesPartialUpdateOK with default headers values +func NewIPAMIPAddressesPartialUpdateOK() *IPAMIPAddressesPartialUpdateOK { + return &IPAMIPAddressesPartialUpdateOK{} +} + +/*IPAMIPAddressesPartialUpdateOK handles this case with default header values. + +IPAMIPAddressesPartialUpdateOK ipam Ip addresses partial update o k +*/ +type IPAMIPAddressesPartialUpdateOK struct { + Payload *models.WritableIPAddress +} + +func (o *IPAMIPAddressesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/ip-addresses/{id}/][%d] ipamIpAddressesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableIPAddress) + + // 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_amip_addresses_read_parameters.go b/netbox/client/ipam/ip_amip_addresses_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ec6b87f9b68dd67db7ff325a287e3373dd05c254 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_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" +) + +// NewIPAMIPAddressesReadParams creates a new IPAMIPAddressesReadParams object +// with the default values initialized. +func NewIPAMIPAddressesReadParams() *IPAMIPAddressesReadParams { + var () + return &IPAMIPAddressesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesReadParamsWithTimeout creates a new IPAMIPAddressesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesReadParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesReadParams { + var () + return &IPAMIPAddressesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesReadParamsWithContext creates a new IPAMIPAddressesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesReadParamsWithContext(ctx context.Context) *IPAMIPAddressesReadParams { + var () + return &IPAMIPAddressesReadParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesReadParamsWithHTTPClient creates a new IPAMIPAddressesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesReadParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesReadParams { + var () + return &IPAMIPAddressesReadParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesReadParams contains all the parameters to send to the API endpoint +for the ipam ip addresses read operation typically these are written to a http.Request +*/ +type IPAMIPAddressesReadParams struct { + + /*ID + A unique integer value identifying this IP address. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) WithContext(ctx context.Context) *IPAMIPAddressesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) WithID(id int64) *IPAMIPAddressesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam ip addresses read params +func (o *IPAMIPAddressesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amip_addresses_read_responses.go b/netbox/client/ipam/ip_amip_addresses_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..084e17f92a9ba825b4b607667741c34b15f83b1e --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_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" +) + +// IPAMIPAddressesReadReader is a Reader for the IPAMIPAddressesRead structure. +type IPAMIPAddressesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesReadOK() + 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()) + } +} + +// NewIPAMIPAddressesReadOK creates a IPAMIPAddressesReadOK with default headers values +func NewIPAMIPAddressesReadOK() *IPAMIPAddressesReadOK { + return &IPAMIPAddressesReadOK{} +} + +/*IPAMIPAddressesReadOK handles this case with default header values. + +IPAMIPAddressesReadOK ipam Ip addresses read o k +*/ +type IPAMIPAddressesReadOK struct { + Payload *models.IPAddress +} + +func (o *IPAMIPAddressesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/ip-addresses/{id}/][%d] ipamIpAddressesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAddress) + + // 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_amip_addresses_update_parameters.go b/netbox/client/ipam/ip_amip_addresses_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6546044bdc0fac229af3639f4126acc8ac04aa97 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_update_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" +) + +// NewIPAMIPAddressesUpdateParams creates a new IPAMIPAddressesUpdateParams object +// with the default values initialized. +func NewIPAMIPAddressesUpdateParams() *IPAMIPAddressesUpdateParams { + var () + return &IPAMIPAddressesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMIPAddressesUpdateParamsWithTimeout creates a new IPAMIPAddressesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMIPAddressesUpdateParamsWithTimeout(timeout time.Duration) *IPAMIPAddressesUpdateParams { + var () + return &IPAMIPAddressesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMIPAddressesUpdateParamsWithContext creates a new IPAMIPAddressesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMIPAddressesUpdateParamsWithContext(ctx context.Context) *IPAMIPAddressesUpdateParams { + var () + return &IPAMIPAddressesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMIPAddressesUpdateParamsWithHTTPClient creates a new IPAMIPAddressesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMIPAddressesUpdateParamsWithHTTPClient(client *http.Client) *IPAMIPAddressesUpdateParams { + var () + return &IPAMIPAddressesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMIPAddressesUpdateParams contains all the parameters to send to the API endpoint +for the ipam ip addresses update operation typically these are written to a http.Request +*/ +type IPAMIPAddressesUpdateParams struct { + + /*Data*/ + Data *models.WritableIPAddress + /*ID + A unique integer value identifying this IP address. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithTimeout(timeout time.Duration) *IPAMIPAddressesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithContext(ctx context.Context) *IPAMIPAddressesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithHTTPClient(client *http.Client) *IPAMIPAddressesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithData(data *models.WritableIPAddress) *IPAMIPAddressesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetData(data *models.WritableIPAddress) { + o.Data = data +} + +// WithID adds the id to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) WithID(id int64) *IPAMIPAddressesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam ip addresses update params +func (o *IPAMIPAddressesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMIPAddressesUpdateParams) 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_amip_addresses_update_responses.go b/netbox/client/ipam/ip_amip_addresses_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cc36d4ca0962dffe9a73170a3b3aa8eb773dc0e5 --- /dev/null +++ b/netbox/client/ipam/ip_amip_addresses_update_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" +) + +// IPAMIPAddressesUpdateReader is a Reader for the IPAMIPAddressesUpdate structure. +type IPAMIPAddressesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMIPAddressesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMIPAddressesUpdateOK() + 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()) + } +} + +// NewIPAMIPAddressesUpdateOK creates a IPAMIPAddressesUpdateOK with default headers values +func NewIPAMIPAddressesUpdateOK() *IPAMIPAddressesUpdateOK { + return &IPAMIPAddressesUpdateOK{} +} + +/*IPAMIPAddressesUpdateOK handles this case with default header values. + +IPAMIPAddressesUpdateOK ipam Ip addresses update o k +*/ +type IPAMIPAddressesUpdateOK struct { + Payload *models.WritableIPAddress +} + +func (o *IPAMIPAddressesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/ip-addresses/{id}/][%d] ipamIpAddressesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMIPAddressesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableIPAddress) + + // 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_ips_create_parameters.go b/netbox/client/ipam/ip_amprefixes_available_ips_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..52047065183db235365c14f589e62e708e2f1afa --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_available_ips_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" +) + +// NewIPAMPrefixesAvailableIpsCreateParams creates a new IPAMPrefixesAvailableIpsCreateParams object +// with the default values initialized. +func NewIPAMPrefixesAvailableIpsCreateParams() *IPAMPrefixesAvailableIpsCreateParams { + var () + return &IPAMPrefixesAvailableIpsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesAvailableIpsCreateParamsWithTimeout creates a new IPAMPrefixesAvailableIpsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesAvailableIpsCreateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesAvailableIpsCreateParams { + var () + return &IPAMPrefixesAvailableIpsCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesAvailableIpsCreateParamsWithContext creates a new IPAMPrefixesAvailableIpsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesAvailableIpsCreateParamsWithContext(ctx context.Context) *IPAMPrefixesAvailableIpsCreateParams { + var () + return &IPAMPrefixesAvailableIpsCreateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesAvailableIpsCreateParamsWithHTTPClient creates a new IPAMPrefixesAvailableIpsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesAvailableIpsCreateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesAvailableIpsCreateParams { + var () + return &IPAMPrefixesAvailableIpsCreateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesAvailableIpsCreateParams contains all the parameters to send to the API endpoint +for the ipam prefixes available ips create operation typically these are written to a http.Request +*/ +type IPAMPrefixesAvailableIpsCreateParams 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 ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesAvailableIpsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithContext(ctx context.Context) *IPAMPrefixesAvailableIpsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesAvailableIpsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithData(data *models.Prefix) *IPAMPrefixesAvailableIpsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetData(data *models.Prefix) { + o.Data = data +} + +// WithID adds the id to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) WithID(id int64) *IPAMPrefixesAvailableIpsCreateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes available ips create params +func (o *IPAMPrefixesAvailableIpsCreateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesAvailableIpsCreateParams) 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_ips_create_responses.go b/netbox/client/ipam/ip_amprefixes_available_ips_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..de7ae8a31883745a51c2b35740ddab774b79c9f0 --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_available_ips_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" +) + +// IPAMPrefixesAvailableIpsCreateReader is a Reader for the IPAMPrefixesAvailableIpsCreate structure. +type IPAMPrefixesAvailableIpsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesAvailableIpsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMPrefixesAvailableIpsCreateCreated() + 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()) + } +} + +// NewIPAMPrefixesAvailableIpsCreateCreated creates a IPAMPrefixesAvailableIpsCreateCreated with default headers values +func NewIPAMPrefixesAvailableIpsCreateCreated() *IPAMPrefixesAvailableIpsCreateCreated { + return &IPAMPrefixesAvailableIpsCreateCreated{} +} + +/*IPAMPrefixesAvailableIpsCreateCreated handles this case with default header values. + +IPAMPrefixesAvailableIpsCreateCreated ipam prefixes available ips create created +*/ +type IPAMPrefixesAvailableIpsCreateCreated struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesAvailableIpsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/prefixes/{id}/available-ips/][%d] ipamPrefixesAvailableIpsCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMPrefixesAvailableIpsCreateCreated) 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_ips_read_parameters.go b/netbox/client/ipam/ip_amprefixes_available_ips_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2486f268e106047ad20fbb23bf6ba8b1330ab3f0 --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_available_ips_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" +) + +// NewIPAMPrefixesAvailableIpsReadParams creates a new IPAMPrefixesAvailableIpsReadParams object +// with the default values initialized. +func NewIPAMPrefixesAvailableIpsReadParams() *IPAMPrefixesAvailableIpsReadParams { + var () + return &IPAMPrefixesAvailableIpsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesAvailableIpsReadParamsWithTimeout creates a new IPAMPrefixesAvailableIpsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesAvailableIpsReadParamsWithTimeout(timeout time.Duration) *IPAMPrefixesAvailableIpsReadParams { + var () + return &IPAMPrefixesAvailableIpsReadParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesAvailableIpsReadParamsWithContext creates a new IPAMPrefixesAvailableIpsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesAvailableIpsReadParamsWithContext(ctx context.Context) *IPAMPrefixesAvailableIpsReadParams { + var () + return &IPAMPrefixesAvailableIpsReadParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesAvailableIpsReadParamsWithHTTPClient creates a new IPAMPrefixesAvailableIpsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesAvailableIpsReadParamsWithHTTPClient(client *http.Client) *IPAMPrefixesAvailableIpsReadParams { + var () + return &IPAMPrefixesAvailableIpsReadParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesAvailableIpsReadParams contains all the parameters to send to the API endpoint +for the ipam prefixes available ips read operation typically these are written to a http.Request +*/ +type IPAMPrefixesAvailableIpsReadParams 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 ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) WithTimeout(timeout time.Duration) *IPAMPrefixesAvailableIpsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) WithContext(ctx context.Context) *IPAMPrefixesAvailableIpsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) WithHTTPClient(client *http.Client) *IPAMPrefixesAvailableIpsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) WithID(id int64) *IPAMPrefixesAvailableIpsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes available ips read params +func (o *IPAMPrefixesAvailableIpsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesAvailableIpsReadParams) 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_ips_read_responses.go b/netbox/client/ipam/ip_amprefixes_available_ips_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3b763eb3f5518540f83023845dbf67648a97cfcf --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_available_ips_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" +) + +// IPAMPrefixesAvailableIpsReadReader is a Reader for the IPAMPrefixesAvailableIpsRead structure. +type IPAMPrefixesAvailableIpsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesAvailableIpsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesAvailableIpsReadOK() + 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()) + } +} + +// NewIPAMPrefixesAvailableIpsReadOK creates a IPAMPrefixesAvailableIpsReadOK with default headers values +func NewIPAMPrefixesAvailableIpsReadOK() *IPAMPrefixesAvailableIpsReadOK { + return &IPAMPrefixesAvailableIpsReadOK{} +} + +/*IPAMPrefixesAvailableIpsReadOK handles this case with default header values. + +IPAMPrefixesAvailableIpsReadOK ipam prefixes available ips read o k +*/ +type IPAMPrefixesAvailableIpsReadOK struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesAvailableIpsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/{id}/available-ips/][%d] ipamPrefixesAvailableIpsReadOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesAvailableIpsReadOK) 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_create_parameters.go b/netbox/client/ipam/ip_amprefixes_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d8791d57c52958216d3e1bfc6c3bfc98fdecd51a --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMPrefixesCreateParams creates a new IPAMPrefixesCreateParams object +// with the default values initialized. +func NewIPAMPrefixesCreateParams() *IPAMPrefixesCreateParams { + var () + return &IPAMPrefixesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesCreateParamsWithTimeout creates a new IPAMPrefixesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesCreateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesCreateParams { + var () + return &IPAMPrefixesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesCreateParamsWithContext creates a new IPAMPrefixesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesCreateParamsWithContext(ctx context.Context) *IPAMPrefixesCreateParams { + var () + return &IPAMPrefixesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesCreateParamsWithHTTPClient creates a new IPAMPrefixesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesCreateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesCreateParams { + var () + return &IPAMPrefixesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesCreateParams contains all the parameters to send to the API endpoint +for the ipam prefixes create operation typically these are written to a http.Request +*/ +type IPAMPrefixesCreateParams struct { + + /*Data*/ + Data *models.WritablePrefix + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) WithContext(ctx context.Context) *IPAMPrefixesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) WithData(data *models.WritablePrefix) *IPAMPrefixesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes create params +func (o *IPAMPrefixesCreateParams) SetData(data *models.WritablePrefix) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesCreateParams) 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/ipam/ip_amprefixes_create_responses.go b/netbox/client/ipam/ip_amprefixes_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..63da09f7e5c95c207b952c6f4671b762c99f134d --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_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" +) + +// IPAMPrefixesCreateReader is a Reader for the IPAMPrefixesCreate structure. +type IPAMPrefixesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMPrefixesCreateCreated() + 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()) + } +} + +// NewIPAMPrefixesCreateCreated creates a IPAMPrefixesCreateCreated with default headers values +func NewIPAMPrefixesCreateCreated() *IPAMPrefixesCreateCreated { + return &IPAMPrefixesCreateCreated{} +} + +/*IPAMPrefixesCreateCreated handles this case with default header values. + +IPAMPrefixesCreateCreated ipam prefixes create created +*/ +type IPAMPrefixesCreateCreated struct { + Payload *models.WritablePrefix +} + +func (o *IPAMPrefixesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/prefixes/][%d] ipamPrefixesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMPrefixesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePrefix) + + // 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_delete_parameters.go b/netbox/client/ipam/ip_amprefixes_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4b01d0f2bfb622b8a538152a4ef4cf60e2cb120b --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_delete_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" +) + +// NewIPAMPrefixesDeleteParams creates a new IPAMPrefixesDeleteParams object +// with the default values initialized. +func NewIPAMPrefixesDeleteParams() *IPAMPrefixesDeleteParams { + var () + return &IPAMPrefixesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesDeleteParamsWithTimeout creates a new IPAMPrefixesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesDeleteParamsWithTimeout(timeout time.Duration) *IPAMPrefixesDeleteParams { + var () + return &IPAMPrefixesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesDeleteParamsWithContext creates a new IPAMPrefixesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesDeleteParamsWithContext(ctx context.Context) *IPAMPrefixesDeleteParams { + var () + return &IPAMPrefixesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesDeleteParamsWithHTTPClient creates a new IPAMPrefixesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesDeleteParamsWithHTTPClient(client *http.Client) *IPAMPrefixesDeleteParams { + var () + return &IPAMPrefixesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesDeleteParams contains all the parameters to send to the API endpoint +for the ipam prefixes delete operation typically these are written to a http.Request +*/ +type IPAMPrefixesDeleteParams 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 delete params +func (o *IPAMPrefixesDeleteParams) WithTimeout(timeout time.Duration) *IPAMPrefixesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) WithContext(ctx context.Context) *IPAMPrefixesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) WithHTTPClient(client *http.Client) *IPAMPrefixesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) WithID(id int64) *IPAMPrefixesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes delete params +func (o *IPAMPrefixesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesDeleteParams) 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_delete_responses.go b/netbox/client/ipam/ip_amprefixes_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5c3dc28d6442a76d045ad182dc042f58aa7538cc --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMPrefixesDeleteReader is a Reader for the IPAMPrefixesDelete structure. +type IPAMPrefixesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMPrefixesDeleteNoContent() + 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()) + } +} + +// NewIPAMPrefixesDeleteNoContent creates a IPAMPrefixesDeleteNoContent with default headers values +func NewIPAMPrefixesDeleteNoContent() *IPAMPrefixesDeleteNoContent { + return &IPAMPrefixesDeleteNoContent{} +} + +/*IPAMPrefixesDeleteNoContent handles this case with default header values. + +IPAMPrefixesDeleteNoContent ipam prefixes delete no content +*/ +type IPAMPrefixesDeleteNoContent struct { +} + +func (o *IPAMPrefixesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/prefixes/{id}/][%d] ipamPrefixesDeleteNoContent ", 204) +} + +func (o *IPAMPrefixesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amprefixes_list_parameters.go b/netbox/client/ipam/ip_amprefixes_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3fe8d0ec04b155f3485d360ec4402b81c8de245c --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_list_parameters.go @@ -0,0 +1,764 @@ +// 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" +) + +// NewIPAMPrefixesListParams creates a new IPAMPrefixesListParams object +// with the default values initialized. +func NewIPAMPrefixesListParams() *IPAMPrefixesListParams { + var () + return &IPAMPrefixesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesListParamsWithTimeout creates a new IPAMPrefixesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesListParamsWithTimeout(timeout time.Duration) *IPAMPrefixesListParams { + var () + return &IPAMPrefixesListParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesListParamsWithContext creates a new IPAMPrefixesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesListParamsWithContext(ctx context.Context) *IPAMPrefixesListParams { + var () + return &IPAMPrefixesListParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesListParamsWithHTTPClient creates a new IPAMPrefixesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesListParamsWithHTTPClient(client *http.Client) *IPAMPrefixesListParams { + var () + return &IPAMPrefixesListParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesListParams contains all the parameters to send to the API endpoint +for the ipam prefixes list operation typically these are written to a http.Request +*/ +type IPAMPrefixesListParams struct { + + /*Contains*/ + Contains *string + /*Family*/ + Family *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*IsPool*/ + IsPool *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MaskLength*/ + MaskLength *float64 + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Parent*/ + Parent *string + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*VlanID*/ + VlanID *string + /*VlanVid*/ + VlanVid *float64 + /*Vrf*/ + Vrf *string + /*VrfID*/ + VrfID *string + /*Within*/ + Within *string + /*WithinInclude*/ + WithinInclude *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTimeout(timeout time.Duration) *IPAMPrefixesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithContext(ctx context.Context) *IPAMPrefixesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithHTTPClient(client *http.Client) *IPAMPrefixesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithContains adds the contains to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithContains(contains *string) *IPAMPrefixesListParams { + o.SetContains(contains) + return o +} + +// SetContains adds the contains to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetContains(contains *string) { + o.Contains = contains +} + +// WithFamily adds the family to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithFamily(family *string) *IPAMPrefixesListParams { + o.SetFamily(family) + return o +} + +// SetFamily adds the family to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetFamily(family *string) { + o.Family = family +} + +// WithIDIn adds the iDIn to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithIDIn(iDIn *float64) *IPAMPrefixesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithIsPool adds the isPool to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithIsPool(isPool *string) *IPAMPrefixesListParams { + o.SetIsPool(isPool) + return o +} + +// SetIsPool adds the isPool to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetIsPool(isPool *string) { + o.IsPool = isPool +} + +// WithLimit adds the limit to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithLimit(limit *int64) *IPAMPrefixesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMaskLength adds the maskLength to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithMaskLength(maskLength *float64) *IPAMPrefixesListParams { + o.SetMaskLength(maskLength) + return o +} + +// SetMaskLength adds the maskLength to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetMaskLength(maskLength *float64) { + o.MaskLength = maskLength +} + +// WithOffset adds the offset to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithOffset(offset *int64) *IPAMPrefixesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam prefixes list params +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) + return o +} + +// SetQ adds the q to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithRole(role *string) *IPAMPrefixesListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithRoleID(roleID *string) *IPAMPrefixesListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSite adds the site to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithSite(site *string) *IPAMPrefixesListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithSiteID(siteID *string) *IPAMPrefixesListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithStatus(status *string) *IPAMPrefixesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTenant(tenant *string) *IPAMPrefixesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithTenantID(tenantID *string) *IPAMPrefixesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithVlanID adds the vlanID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithVlanID(vlanID *string) *IPAMPrefixesListParams { + o.SetVlanID(vlanID) + return o +} + +// SetVlanID adds the vlanId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetVlanID(vlanID *string) { + o.VlanID = vlanID +} + +// WithVlanVid adds the vlanVid to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithVlanVid(vlanVid *float64) *IPAMPrefixesListParams { + o.SetVlanVid(vlanVid) + return o +} + +// SetVlanVid adds the vlanVid to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetVlanVid(vlanVid *float64) { + o.VlanVid = vlanVid +} + +// WithVrf adds the vrf to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithVrf(vrf *string) *IPAMPrefixesListParams { + o.SetVrf(vrf) + return o +} + +// SetVrf adds the vrf to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetVrf(vrf *string) { + o.Vrf = vrf +} + +// WithVrfID adds the vrfID to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithVrfID(vrfID *string) *IPAMPrefixesListParams { + o.SetVrfID(vrfID) + return o +} + +// SetVrfID adds the vrfId to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetVrfID(vrfID *string) { + o.VrfID = vrfID +} + +// WithWithin adds the within to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithWithin(within *string) *IPAMPrefixesListParams { + o.SetWithin(within) + return o +} + +// SetWithin adds the within to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetWithin(within *string) { + o.Within = within +} + +// WithWithinInclude adds the withinInclude to the ipam prefixes list params +func (o *IPAMPrefixesListParams) WithWithinInclude(withinInclude *string) *IPAMPrefixesListParams { + o.SetWithinInclude(withinInclude) + return o +} + +// SetWithinInclude adds the withinInclude to the ipam prefixes list params +func (o *IPAMPrefixesListParams) SetWithinInclude(withinInclude *string) { + o.WithinInclude = withinInclude +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Contains != nil { + + // query param contains + var qrContains string + if o.Contains != nil { + qrContains = *o.Contains + } + qContains := qrContains + if qContains != "" { + if err := r.SetQueryParam("contains", qContains); err != nil { + return err + } + } + + } + + if o.Family != nil { + + // query param family + var qrFamily string + if o.Family != nil { + qrFamily = *o.Family + } + qFamily := qrFamily + if qFamily != "" { + if err := r.SetQueryParam("family", qFamily); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.IsPool != nil { + + // query param is_pool + var qrIsPool string + if o.IsPool != nil { + qrIsPool = *o.IsPool + } + qIsPool := qrIsPool + if qIsPool != "" { + if err := r.SetQueryParam("is_pool", qIsPool); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.MaskLength != nil { + + // query param mask_length + var qrMaskLength float64 + if o.MaskLength != nil { + qrMaskLength = *o.MaskLength + } + qMaskLength := swag.FormatFloat64(qrMaskLength) + if qMaskLength != "" { + if err := r.SetQueryParam("mask_length", qMaskLength); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.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 + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Role != nil { + + // query param role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + + } + + if o.RoleID != nil { + + // query param role_id + var qrRoleID string + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + if err := r.SetQueryParam("role_id", qRoleID); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.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 + 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.VlanID != nil { + + // query param vlan_id + var qrVlanID string + if o.VlanID != nil { + qrVlanID = *o.VlanID + } + qVlanID := qrVlanID + if qVlanID != "" { + if err := r.SetQueryParam("vlan_id", qVlanID); err != nil { + return err + } + } + + } + + if o.VlanVid != nil { + + // query param vlan_vid + var qrVlanVid float64 + if o.VlanVid != nil { + qrVlanVid = *o.VlanVid + } + qVlanVid := swag.FormatFloat64(qrVlanVid) + if qVlanVid != "" { + if err := r.SetQueryParam("vlan_vid", qVlanVid); err != nil { + return err + } + } + + } + + if o.Vrf != nil { + + // query param vrf + var qrVrf string + if o.Vrf != nil { + qrVrf = *o.Vrf + } + qVrf := qrVrf + if qVrf != "" { + if err := r.SetQueryParam("vrf", qVrf); err != nil { + return err + } + } + + } + + if o.VrfID != nil { + + // query param vrf_id + var qrVrfID string + if o.VrfID != nil { + qrVrfID = *o.VrfID + } + qVrfID := qrVrfID + if qVrfID != "" { + if err := r.SetQueryParam("vrf_id", qVrfID); err != nil { + return err + } + } + + } + + if o.Within != nil { + + // query param within + var qrWithin string + if o.Within != nil { + qrWithin = *o.Within + } + qWithin := qrWithin + if qWithin != "" { + if err := r.SetQueryParam("within", qWithin); err != nil { + return err + } + } + + } + + if o.WithinInclude != nil { + + // query param within_include + var qrWithinInclude string + if o.WithinInclude != nil { + qrWithinInclude = *o.WithinInclude + } + qWithinInclude := qrWithinInclude + if qWithinInclude != "" { + if err := r.SetQueryParam("within_include", qWithinInclude); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amprefixes_list_responses.go b/netbox/client/ipam/ip_amprefixes_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d6cb778d94d62c3fbda21035c4d4a3d3f99a04e9 --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_list_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" +) + +// IPAMPrefixesListReader is a Reader for the IPAMPrefixesList structure. +type IPAMPrefixesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMPrefixesListOK creates a IPAMPrefixesListOK with default headers values +func NewIPAMPrefixesListOK() *IPAMPrefixesListOK { + return &IPAMPrefixesListOK{} +} + +/*IPAMPrefixesListOK handles this case with default header values. + +IPAMPrefixesListOK ipam prefixes list o k +*/ +type IPAMPrefixesListOK struct { + Payload *models.IPAMPrefixesListOKBody +} + +func (o *IPAMPrefixesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/][%d] ipamPrefixesListOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMPrefixesListOKBody) + + // 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_partial_update_parameters.go b/netbox/client/ipam/ip_amprefixes_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3d5bdd84a7476c4bfab20726e58860b98459913c --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_partial_update_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" +) + +// NewIPAMPrefixesPartialUpdateParams creates a new IPAMPrefixesPartialUpdateParams object +// with the default values initialized. +func NewIPAMPrefixesPartialUpdateParams() *IPAMPrefixesPartialUpdateParams { + var () + return &IPAMPrefixesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesPartialUpdateParamsWithTimeout creates a new IPAMPrefixesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesPartialUpdateParams { + var () + return &IPAMPrefixesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesPartialUpdateParamsWithContext creates a new IPAMPrefixesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesPartialUpdateParamsWithContext(ctx context.Context) *IPAMPrefixesPartialUpdateParams { + var () + return &IPAMPrefixesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesPartialUpdateParamsWithHTTPClient creates a new IPAMPrefixesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesPartialUpdateParams { + var () + return &IPAMPrefixesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam prefixes partial update operation typically these are written to a http.Request +*/ +type IPAMPrefixesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritablePrefix + /*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 partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithContext(ctx context.Context) *IPAMPrefixesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithData(data *models.WritablePrefix) *IPAMPrefixesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetData(data *models.WritablePrefix) { + o.Data = data +} + +// WithID adds the id to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) WithID(id int64) *IPAMPrefixesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes partial update params +func (o *IPAMPrefixesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesPartialUpdateParams) 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_partial_update_responses.go b/netbox/client/ipam/ip_amprefixes_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4882da313930e1192126e088f0e9507075ec6cff --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_partial_update_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" +) + +// IPAMPrefixesPartialUpdateReader is a Reader for the IPAMPrefixesPartialUpdate structure. +type IPAMPrefixesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesPartialUpdateOK() + 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()) + } +} + +// NewIPAMPrefixesPartialUpdateOK creates a IPAMPrefixesPartialUpdateOK with default headers values +func NewIPAMPrefixesPartialUpdateOK() *IPAMPrefixesPartialUpdateOK { + return &IPAMPrefixesPartialUpdateOK{} +} + +/*IPAMPrefixesPartialUpdateOK handles this case with default header values. + +IPAMPrefixesPartialUpdateOK ipam prefixes partial update o k +*/ +type IPAMPrefixesPartialUpdateOK struct { + Payload *models.WritablePrefix +} + +func (o *IPAMPrefixesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/prefixes/{id}/][%d] ipamPrefixesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePrefix) + + // 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_read_parameters.go b/netbox/client/ipam/ip_amprefixes_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..cdf72364369a13833409bcf41ea52d694a69673e --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_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" +) + +// NewIPAMPrefixesReadParams creates a new IPAMPrefixesReadParams object +// with the default values initialized. +func NewIPAMPrefixesReadParams() *IPAMPrefixesReadParams { + var () + return &IPAMPrefixesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesReadParamsWithTimeout creates a new IPAMPrefixesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesReadParamsWithTimeout(timeout time.Duration) *IPAMPrefixesReadParams { + var () + return &IPAMPrefixesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesReadParamsWithContext creates a new IPAMPrefixesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesReadParamsWithContext(ctx context.Context) *IPAMPrefixesReadParams { + var () + return &IPAMPrefixesReadParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesReadParamsWithHTTPClient creates a new IPAMPrefixesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesReadParamsWithHTTPClient(client *http.Client) *IPAMPrefixesReadParams { + var () + return &IPAMPrefixesReadParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesReadParams contains all the parameters to send to the API endpoint +for the ipam prefixes read operation typically these are written to a http.Request +*/ +type IPAMPrefixesReadParams 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 read params +func (o *IPAMPrefixesReadParams) WithTimeout(timeout time.Duration) *IPAMPrefixesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) WithContext(ctx context.Context) *IPAMPrefixesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) WithHTTPClient(client *http.Client) *IPAMPrefixesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) WithID(id int64) *IPAMPrefixesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes read params +func (o *IPAMPrefixesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesReadParams) 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_read_responses.go b/netbox/client/ipam/ip_amprefixes_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a3e0f739ea9669bd013ca7f41e6b582a8065d4a1 --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_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" +) + +// IPAMPrefixesReadReader is a Reader for the IPAMPrefixesRead structure. +type IPAMPrefixesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesReadOK() + 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()) + } +} + +// NewIPAMPrefixesReadOK creates a IPAMPrefixesReadOK with default headers values +func NewIPAMPrefixesReadOK() *IPAMPrefixesReadOK { + return &IPAMPrefixesReadOK{} +} + +/*IPAMPrefixesReadOK handles this case with default header values. + +IPAMPrefixesReadOK ipam prefixes read o k +*/ +type IPAMPrefixesReadOK struct { + Payload *models.Prefix +} + +func (o *IPAMPrefixesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/prefixes/{id}/][%d] ipamPrefixesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesReadOK) 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_update_parameters.go b/netbox/client/ipam/ip_amprefixes_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d85c1dc743a570c147dc9809d71af61bebdf7101 --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_update_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" +) + +// NewIPAMPrefixesUpdateParams creates a new IPAMPrefixesUpdateParams object +// with the default values initialized. +func NewIPAMPrefixesUpdateParams() *IPAMPrefixesUpdateParams { + var () + return &IPAMPrefixesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMPrefixesUpdateParamsWithTimeout creates a new IPAMPrefixesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMPrefixesUpdateParamsWithTimeout(timeout time.Duration) *IPAMPrefixesUpdateParams { + var () + return &IPAMPrefixesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMPrefixesUpdateParamsWithContext creates a new IPAMPrefixesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMPrefixesUpdateParamsWithContext(ctx context.Context) *IPAMPrefixesUpdateParams { + var () + return &IPAMPrefixesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMPrefixesUpdateParamsWithHTTPClient creates a new IPAMPrefixesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMPrefixesUpdateParamsWithHTTPClient(client *http.Client) *IPAMPrefixesUpdateParams { + var () + return &IPAMPrefixesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMPrefixesUpdateParams contains all the parameters to send to the API endpoint +for the ipam prefixes update operation typically these are written to a http.Request +*/ +type IPAMPrefixesUpdateParams struct { + + /*Data*/ + Data *models.WritablePrefix + /*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 update params +func (o *IPAMPrefixesUpdateParams) WithTimeout(timeout time.Duration) *IPAMPrefixesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithContext(ctx context.Context) *IPAMPrefixesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithHTTPClient(client *http.Client) *IPAMPrefixesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithData(data *models.WritablePrefix) *IPAMPrefixesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetData(data *models.WritablePrefix) { + o.Data = data +} + +// WithID adds the id to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) WithID(id int64) *IPAMPrefixesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam prefixes update params +func (o *IPAMPrefixesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMPrefixesUpdateParams) 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_update_responses.go b/netbox/client/ipam/ip_amprefixes_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e0cefff9293163a57c2474cca16fc7e8b77b364a --- /dev/null +++ b/netbox/client/ipam/ip_amprefixes_update_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" +) + +// IPAMPrefixesUpdateReader is a Reader for the IPAMPrefixesUpdate structure. +type IPAMPrefixesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMPrefixesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMPrefixesUpdateOK() + 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()) + } +} + +// NewIPAMPrefixesUpdateOK creates a IPAMPrefixesUpdateOK with default headers values +func NewIPAMPrefixesUpdateOK() *IPAMPrefixesUpdateOK { + return &IPAMPrefixesUpdateOK{} +} + +/*IPAMPrefixesUpdateOK handles this case with default header values. + +IPAMPrefixesUpdateOK ipam prefixes update o k +*/ +type IPAMPrefixesUpdateOK struct { + Payload *models.WritablePrefix +} + +func (o *IPAMPrefixesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/prefixes/{id}/][%d] ipamPrefixesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMPrefixesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritablePrefix) + + // 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_amrirs_create_parameters.go b/netbox/client/ipam/ip_amrirs_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..31b3b6823445de3c6eb7b5bf5922bec36670c5f6 --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMRirsCreateParams creates a new IPAMRirsCreateParams object +// with the default values initialized. +func NewIPAMRirsCreateParams() *IPAMRirsCreateParams { + var () + return &IPAMRirsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsCreateParamsWithTimeout creates a new IPAMRirsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsCreateParamsWithTimeout(timeout time.Duration) *IPAMRirsCreateParams { + var () + return &IPAMRirsCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsCreateParamsWithContext creates a new IPAMRirsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsCreateParamsWithContext(ctx context.Context) *IPAMRirsCreateParams { + var () + return &IPAMRirsCreateParams{ + + Context: ctx, + } +} + +// NewIPAMRirsCreateParamsWithHTTPClient creates a new IPAMRirsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsCreateParamsWithHTTPClient(client *http.Client) *IPAMRirsCreateParams { + var () + return &IPAMRirsCreateParams{ + HTTPClient: client, + } +} + +/*IPAMRirsCreateParams contains all the parameters to send to the API endpoint +for the ipam rirs create operation typically these are written to a http.Request +*/ +type IPAMRirsCreateParams struct { + + /*Data*/ + Data *models.RIR + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs create params +func (o *IPAMRirsCreateParams) WithTimeout(timeout time.Duration) *IPAMRirsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs create params +func (o *IPAMRirsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs create params +func (o *IPAMRirsCreateParams) WithContext(ctx context.Context) *IPAMRirsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs create params +func (o *IPAMRirsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs create params +func (o *IPAMRirsCreateParams) WithHTTPClient(client *http.Client) *IPAMRirsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs create params +func (o *IPAMRirsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam rirs create params +func (o *IPAMRirsCreateParams) WithData(data *models.RIR) *IPAMRirsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam rirs create params +func (o *IPAMRirsCreateParams) SetData(data *models.RIR) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsCreateParams) 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/ipam/ip_amrirs_create_responses.go b/netbox/client/ipam/ip_amrirs_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..13879caec9623d3110a496c80f0d9e88e5a368e7 --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_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" +) + +// IPAMRirsCreateReader is a Reader for the IPAMRirsCreate structure. +type IPAMRirsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMRirsCreateCreated() + 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()) + } +} + +// NewIPAMRirsCreateCreated creates a IPAMRirsCreateCreated with default headers values +func NewIPAMRirsCreateCreated() *IPAMRirsCreateCreated { + return &IPAMRirsCreateCreated{} +} + +/*IPAMRirsCreateCreated handles this case with default header values. + +IPAMRirsCreateCreated ipam rirs create created +*/ +type IPAMRirsCreateCreated struct { + Payload *models.RIR +} + +func (o *IPAMRirsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/rirs/][%d] ipamRirsCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMRirsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RIR) + + // 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_amrirs_delete_parameters.go b/netbox/client/ipam/ip_amrirs_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2484edc81174d9f2cd5f843030c9eb1513b30d7f --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_delete_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" +) + +// NewIPAMRirsDeleteParams creates a new IPAMRirsDeleteParams object +// with the default values initialized. +func NewIPAMRirsDeleteParams() *IPAMRirsDeleteParams { + var () + return &IPAMRirsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsDeleteParamsWithTimeout creates a new IPAMRirsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsDeleteParamsWithTimeout(timeout time.Duration) *IPAMRirsDeleteParams { + var () + return &IPAMRirsDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsDeleteParamsWithContext creates a new IPAMRirsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsDeleteParamsWithContext(ctx context.Context) *IPAMRirsDeleteParams { + var () + return &IPAMRirsDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMRirsDeleteParamsWithHTTPClient creates a new IPAMRirsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsDeleteParamsWithHTTPClient(client *http.Client) *IPAMRirsDeleteParams { + var () + return &IPAMRirsDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMRirsDeleteParams contains all the parameters to send to the API endpoint +for the ipam rirs delete operation typically these are written to a http.Request +*/ +type IPAMRirsDeleteParams struct { + + /*ID + A unique integer value identifying this RIR. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) WithTimeout(timeout time.Duration) *IPAMRirsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) WithContext(ctx context.Context) *IPAMRirsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) WithHTTPClient(client *http.Client) *IPAMRirsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) WithID(id int64) *IPAMRirsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam rirs delete params +func (o *IPAMRirsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amrirs_delete_responses.go b/netbox/client/ipam/ip_amrirs_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4aa898c2636a8b40238ca225bd7b5877a651c48c --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMRirsDeleteReader is a Reader for the IPAMRirsDelete structure. +type IPAMRirsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMRirsDeleteNoContent() + 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()) + } +} + +// NewIPAMRirsDeleteNoContent creates a IPAMRirsDeleteNoContent with default headers values +func NewIPAMRirsDeleteNoContent() *IPAMRirsDeleteNoContent { + return &IPAMRirsDeleteNoContent{} +} + +/*IPAMRirsDeleteNoContent handles this case with default header values. + +IPAMRirsDeleteNoContent ipam rirs delete no content +*/ +type IPAMRirsDeleteNoContent struct { +} + +func (o *IPAMRirsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/rirs/{id}/][%d] ipamRirsDeleteNoContent ", 204) +} + +func (o *IPAMRirsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amrirs_list_parameters.go b/netbox/client/ipam/ip_amrirs_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..def548674e6e7ec1662a6c68c04cd38f13437c38 --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_list_parameters.go @@ -0,0 +1,300 @@ +// 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" +) + +// NewIPAMRirsListParams creates a new IPAMRirsListParams object +// with the default values initialized. +func NewIPAMRirsListParams() *IPAMRirsListParams { + var () + return &IPAMRirsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsListParamsWithTimeout creates a new IPAMRirsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsListParamsWithTimeout(timeout time.Duration) *IPAMRirsListParams { + var () + return &IPAMRirsListParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsListParamsWithContext creates a new IPAMRirsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsListParamsWithContext(ctx context.Context) *IPAMRirsListParams { + var () + return &IPAMRirsListParams{ + + Context: ctx, + } +} + +// NewIPAMRirsListParamsWithHTTPClient creates a new IPAMRirsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsListParamsWithHTTPClient(client *http.Client) *IPAMRirsListParams { + var () + return &IPAMRirsListParams{ + HTTPClient: client, + } +} + +/*IPAMRirsListParams contains all the parameters to send to the API endpoint +for the ipam rirs list operation typically these are written to a http.Request +*/ +type IPAMRirsListParams struct { + + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*IsPrivate*/ + IsPrivate *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs list params +func (o *IPAMRirsListParams) WithTimeout(timeout time.Duration) *IPAMRirsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs list params +func (o *IPAMRirsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs list params +func (o *IPAMRirsListParams) WithContext(ctx context.Context) *IPAMRirsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs list params +func (o *IPAMRirsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs list params +func (o *IPAMRirsListParams) WithHTTPClient(client *http.Client) *IPAMRirsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs list params +func (o *IPAMRirsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIDIn adds the iDIn to the ipam rirs list params +func (o *IPAMRirsListParams) WithIDIn(iDIn *float64) *IPAMRirsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam rirs list params +func (o *IPAMRirsListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithIsPrivate adds the isPrivate to the ipam rirs list params +func (o *IPAMRirsListParams) WithIsPrivate(isPrivate *string) *IPAMRirsListParams { + o.SetIsPrivate(isPrivate) + return o +} + +// SetIsPrivate adds the isPrivate to the ipam rirs list params +func (o *IPAMRirsListParams) SetIsPrivate(isPrivate *string) { + o.IsPrivate = isPrivate +} + +// WithLimit adds the limit to the ipam rirs list params +func (o *IPAMRirsListParams) WithLimit(limit *int64) *IPAMRirsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam rirs list params +func (o *IPAMRirsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam rirs list params +func (o *IPAMRirsListParams) WithName(name *string) *IPAMRirsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam rirs list params +func (o *IPAMRirsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam rirs list params +func (o *IPAMRirsListParams) WithOffset(offset *int64) *IPAMRirsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam rirs list params +func (o *IPAMRirsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the ipam rirs list params +func (o *IPAMRirsListParams) WithSlug(slug *string) *IPAMRirsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the ipam rirs list params +func (o *IPAMRirsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.IsPrivate != nil { + + // query param is_private + var qrIsPrivate string + if o.IsPrivate != nil { + qrIsPrivate = *o.IsPrivate + } + qIsPrivate := qrIsPrivate + if qIsPrivate != "" { + if err := r.SetQueryParam("is_private", qIsPrivate); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amrirs_list_responses.go b/netbox/client/ipam/ip_amrirs_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1b2881fc7688c9278eaac99d50d963112cfda543 --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_list_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" +) + +// IPAMRirsListReader is a Reader for the IPAMRirsList structure. +type IPAMRirsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRirsListOK creates a IPAMRirsListOK with default headers values +func NewIPAMRirsListOK() *IPAMRirsListOK { + return &IPAMRirsListOK{} +} + +/*IPAMRirsListOK handles this case with default header values. + +IPAMRirsListOK ipam rirs list o k +*/ +type IPAMRirsListOK struct { + Payload *models.IPAMRirsListOKBody +} + +func (o *IPAMRirsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/rirs/][%d] ipamRirsListOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMRirsListOKBody) + + // 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_amrirs_partial_update_parameters.go b/netbox/client/ipam/ip_amrirs_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..2f834c86d3cb6eab8d033a75e93ab519c1a9463f --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_partial_update_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" +) + +// NewIPAMRirsPartialUpdateParams creates a new IPAMRirsPartialUpdateParams object +// with the default values initialized. +func NewIPAMRirsPartialUpdateParams() *IPAMRirsPartialUpdateParams { + var () + return &IPAMRirsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsPartialUpdateParamsWithTimeout creates a new IPAMRirsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMRirsPartialUpdateParams { + var () + return &IPAMRirsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsPartialUpdateParamsWithContext creates a new IPAMRirsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsPartialUpdateParamsWithContext(ctx context.Context) *IPAMRirsPartialUpdateParams { + var () + return &IPAMRirsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMRirsPartialUpdateParamsWithHTTPClient creates a new IPAMRirsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMRirsPartialUpdateParams { + var () + return &IPAMRirsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMRirsPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam rirs partial update operation typically these are written to a http.Request +*/ +type IPAMRirsPartialUpdateParams struct { + + /*Data*/ + Data *models.RIR + /*ID + A unique integer value identifying this RIR. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMRirsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithContext(ctx context.Context) *IPAMRirsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMRirsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithData(data *models.RIR) *IPAMRirsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetData(data *models.RIR) { + o.Data = data +} + +// WithID adds the id to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) WithID(id int64) *IPAMRirsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam rirs partial update params +func (o *IPAMRirsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsPartialUpdateParams) 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_amrirs_partial_update_responses.go b/netbox/client/ipam/ip_amrirs_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..edc385d20cd3e6ead377a45adbc61683ffd0c07d --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_partial_update_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" +) + +// IPAMRirsPartialUpdateReader is a Reader for the IPAMRirsPartialUpdate structure. +type IPAMRirsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsPartialUpdateOK() + 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()) + } +} + +// NewIPAMRirsPartialUpdateOK creates a IPAMRirsPartialUpdateOK with default headers values +func NewIPAMRirsPartialUpdateOK() *IPAMRirsPartialUpdateOK { + return &IPAMRirsPartialUpdateOK{} +} + +/*IPAMRirsPartialUpdateOK handles this case with default header values. + +IPAMRirsPartialUpdateOK ipam rirs partial update o k +*/ +type IPAMRirsPartialUpdateOK struct { + Payload *models.RIR +} + +func (o *IPAMRirsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/rirs/{id}/][%d] ipamRirsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RIR) + + // 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_amrirs_read_parameters.go b/netbox/client/ipam/ip_amrirs_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..246e2c672de0f91e076c6a3a9e97a719087f14a1 --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_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" +) + +// NewIPAMRirsReadParams creates a new IPAMRirsReadParams object +// with the default values initialized. +func NewIPAMRirsReadParams() *IPAMRirsReadParams { + var () + return &IPAMRirsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsReadParamsWithTimeout creates a new IPAMRirsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsReadParamsWithTimeout(timeout time.Duration) *IPAMRirsReadParams { + var () + return &IPAMRirsReadParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsReadParamsWithContext creates a new IPAMRirsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsReadParamsWithContext(ctx context.Context) *IPAMRirsReadParams { + var () + return &IPAMRirsReadParams{ + + Context: ctx, + } +} + +// NewIPAMRirsReadParamsWithHTTPClient creates a new IPAMRirsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsReadParamsWithHTTPClient(client *http.Client) *IPAMRirsReadParams { + var () + return &IPAMRirsReadParams{ + HTTPClient: client, + } +} + +/*IPAMRirsReadParams contains all the parameters to send to the API endpoint +for the ipam rirs read operation typically these are written to a http.Request +*/ +type IPAMRirsReadParams struct { + + /*ID + A unique integer value identifying this RIR. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs read params +func (o *IPAMRirsReadParams) WithTimeout(timeout time.Duration) *IPAMRirsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs read params +func (o *IPAMRirsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs read params +func (o *IPAMRirsReadParams) WithContext(ctx context.Context) *IPAMRirsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs read params +func (o *IPAMRirsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs read params +func (o *IPAMRirsReadParams) WithHTTPClient(client *http.Client) *IPAMRirsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs read params +func (o *IPAMRirsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam rirs read params +func (o *IPAMRirsReadParams) WithID(id int64) *IPAMRirsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam rirs read params +func (o *IPAMRirsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amrirs_read_responses.go b/netbox/client/ipam/ip_amrirs_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5c462234336dc446362ea4803ade4c3747e17926 --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_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" +) + +// IPAMRirsReadReader is a Reader for the IPAMRirsRead structure. +type IPAMRirsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsReadOK() + 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()) + } +} + +// NewIPAMRirsReadOK creates a IPAMRirsReadOK with default headers values +func NewIPAMRirsReadOK() *IPAMRirsReadOK { + return &IPAMRirsReadOK{} +} + +/*IPAMRirsReadOK handles this case with default header values. + +IPAMRirsReadOK ipam rirs read o k +*/ +type IPAMRirsReadOK struct { + Payload *models.RIR +} + +func (o *IPAMRirsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/rirs/{id}/][%d] ipamRirsReadOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RIR) + + // 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_amrirs_update_parameters.go b/netbox/client/ipam/ip_amrirs_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..aed729df4baf0483ed0af3677092d4219b596d6c --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_update_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" +) + +// NewIPAMRirsUpdateParams creates a new IPAMRirsUpdateParams object +// with the default values initialized. +func NewIPAMRirsUpdateParams() *IPAMRirsUpdateParams { + var () + return &IPAMRirsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRirsUpdateParamsWithTimeout creates a new IPAMRirsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRirsUpdateParamsWithTimeout(timeout time.Duration) *IPAMRirsUpdateParams { + var () + return &IPAMRirsUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMRirsUpdateParamsWithContext creates a new IPAMRirsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRirsUpdateParamsWithContext(ctx context.Context) *IPAMRirsUpdateParams { + var () + return &IPAMRirsUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMRirsUpdateParamsWithHTTPClient creates a new IPAMRirsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRirsUpdateParamsWithHTTPClient(client *http.Client) *IPAMRirsUpdateParams { + var () + return &IPAMRirsUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMRirsUpdateParams contains all the parameters to send to the API endpoint +for the ipam rirs update operation typically these are written to a http.Request +*/ +type IPAMRirsUpdateParams struct { + + /*Data*/ + Data *models.RIR + /*ID + A unique integer value identifying this RIR. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithTimeout(timeout time.Duration) *IPAMRirsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithContext(ctx context.Context) *IPAMRirsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithHTTPClient(client *http.Client) *IPAMRirsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithData(data *models.RIR) *IPAMRirsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetData(data *models.RIR) { + o.Data = data +} + +// WithID adds the id to the ipam rirs update params +func (o *IPAMRirsUpdateParams) WithID(id int64) *IPAMRirsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam rirs update params +func (o *IPAMRirsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRirsUpdateParams) 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_amrirs_update_responses.go b/netbox/client/ipam/ip_amrirs_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..86f22a45a8239ca9bc6d862415a3a84fe64ad56d --- /dev/null +++ b/netbox/client/ipam/ip_amrirs_update_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" +) + +// IPAMRirsUpdateReader is a Reader for the IPAMRirsUpdate structure. +type IPAMRirsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRirsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRirsUpdateOK() + 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()) + } +} + +// NewIPAMRirsUpdateOK creates a IPAMRirsUpdateOK with default headers values +func NewIPAMRirsUpdateOK() *IPAMRirsUpdateOK { + return &IPAMRirsUpdateOK{} +} + +/*IPAMRirsUpdateOK handles this case with default header values. + +IPAMRirsUpdateOK ipam rirs update o k +*/ +type IPAMRirsUpdateOK struct { + Payload *models.RIR +} + +func (o *IPAMRirsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/rirs/{id}/][%d] ipamRirsUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMRirsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.RIR) + + // 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_amroles_create_parameters.go b/netbox/client/ipam/ip_amroles_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c41f44f13b0fe0c651f3bae1bb96fe2fa4a472fa --- /dev/null +++ b/netbox/client/ipam/ip_amroles_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMRolesCreateParams creates a new IPAMRolesCreateParams object +// with the default values initialized. +func NewIPAMRolesCreateParams() *IPAMRolesCreateParams { + var () + return &IPAMRolesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesCreateParamsWithTimeout creates a new IPAMRolesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesCreateParamsWithTimeout(timeout time.Duration) *IPAMRolesCreateParams { + var () + return &IPAMRolesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesCreateParamsWithContext creates a new IPAMRolesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesCreateParamsWithContext(ctx context.Context) *IPAMRolesCreateParams { + var () + return &IPAMRolesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMRolesCreateParamsWithHTTPClient creates a new IPAMRolesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesCreateParamsWithHTTPClient(client *http.Client) *IPAMRolesCreateParams { + var () + return &IPAMRolesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMRolesCreateParams contains all the parameters to send to the API endpoint +for the ipam roles create operation typically these are written to a http.Request +*/ +type IPAMRolesCreateParams struct { + + /*Data*/ + Data *models.Role + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles create params +func (o *IPAMRolesCreateParams) WithTimeout(timeout time.Duration) *IPAMRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles create params +func (o *IPAMRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles create params +func (o *IPAMRolesCreateParams) WithContext(ctx context.Context) *IPAMRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles create params +func (o *IPAMRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles create params +func (o *IPAMRolesCreateParams) WithHTTPClient(client *http.Client) *IPAMRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles create params +func (o *IPAMRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam roles create params +func (o *IPAMRolesCreateParams) WithData(data *models.Role) *IPAMRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam roles create params +func (o *IPAMRolesCreateParams) SetData(data *models.Role) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesCreateParams) 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/ipam/ip_amroles_create_responses.go b/netbox/client/ipam/ip_amroles_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bcbd5d1a344e818624f7dd41b230816bea92630c --- /dev/null +++ b/netbox/client/ipam/ip_amroles_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" +) + +// IPAMRolesCreateReader is a Reader for the IPAMRolesCreate structure. +type IPAMRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMRolesCreateCreated() + 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()) + } +} + +// NewIPAMRolesCreateCreated creates a IPAMRolesCreateCreated with default headers values +func NewIPAMRolesCreateCreated() *IPAMRolesCreateCreated { + return &IPAMRolesCreateCreated{} +} + +/*IPAMRolesCreateCreated handles this case with default header values. + +IPAMRolesCreateCreated ipam roles create created +*/ +type IPAMRolesCreateCreated struct { + Payload *models.Role +} + +func (o *IPAMRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/roles/][%d] ipamRolesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Role) + + // 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_amroles_delete_parameters.go b/netbox/client/ipam/ip_amroles_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..41835c8ac232c2332f75c7625b0069a6dfb86409 --- /dev/null +++ b/netbox/client/ipam/ip_amroles_delete_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" +) + +// NewIPAMRolesDeleteParams creates a new IPAMRolesDeleteParams object +// with the default values initialized. +func NewIPAMRolesDeleteParams() *IPAMRolesDeleteParams { + var () + return &IPAMRolesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesDeleteParamsWithTimeout creates a new IPAMRolesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesDeleteParamsWithTimeout(timeout time.Duration) *IPAMRolesDeleteParams { + var () + return &IPAMRolesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesDeleteParamsWithContext creates a new IPAMRolesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesDeleteParamsWithContext(ctx context.Context) *IPAMRolesDeleteParams { + var () + return &IPAMRolesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMRolesDeleteParamsWithHTTPClient creates a new IPAMRolesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesDeleteParamsWithHTTPClient(client *http.Client) *IPAMRolesDeleteParams { + var () + return &IPAMRolesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMRolesDeleteParams contains all the parameters to send to the API endpoint +for the ipam roles delete operation typically these are written to a http.Request +*/ +type IPAMRolesDeleteParams struct { + + /*ID + A unique integer value identifying this role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles delete params +func (o *IPAMRolesDeleteParams) WithTimeout(timeout time.Duration) *IPAMRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles delete params +func (o *IPAMRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles delete params +func (o *IPAMRolesDeleteParams) WithContext(ctx context.Context) *IPAMRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles delete params +func (o *IPAMRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles delete params +func (o *IPAMRolesDeleteParams) WithHTTPClient(client *http.Client) *IPAMRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles delete params +func (o *IPAMRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam roles delete params +func (o *IPAMRolesDeleteParams) WithID(id int64) *IPAMRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles delete params +func (o *IPAMRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesDeleteParams) 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_amroles_delete_responses.go b/netbox/client/ipam/ip_amroles_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..636c3e0ca6b5b7dc0fff9a34a8ddd7f99645f43f --- /dev/null +++ b/netbox/client/ipam/ip_amroles_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMRolesDeleteReader is a Reader for the IPAMRolesDelete structure. +type IPAMRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMRolesDeleteNoContent() + 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()) + } +} + +// NewIPAMRolesDeleteNoContent creates a IPAMRolesDeleteNoContent with default headers values +func NewIPAMRolesDeleteNoContent() *IPAMRolesDeleteNoContent { + return &IPAMRolesDeleteNoContent{} +} + +/*IPAMRolesDeleteNoContent handles this case with default header values. + +IPAMRolesDeleteNoContent ipam roles delete no content +*/ +type IPAMRolesDeleteNoContent struct { +} + +func (o *IPAMRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/roles/{id}/][%d] ipamRolesDeleteNoContent ", 204) +} + +func (o *IPAMRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amroles_list_parameters.go b/netbox/client/ipam/ip_amroles_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d3179d4dcbca0a2b80368d6e4dad9c40595e8c2b --- /dev/null +++ b/netbox/client/ipam/ip_amroles_list_parameters.go @@ -0,0 +1,239 @@ +// 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" +) + +// NewIPAMRolesListParams creates a new IPAMRolesListParams object +// with the default values initialized. +func NewIPAMRolesListParams() *IPAMRolesListParams { + var () + return &IPAMRolesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesListParamsWithTimeout creates a new IPAMRolesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesListParamsWithTimeout(timeout time.Duration) *IPAMRolesListParams { + var () + return &IPAMRolesListParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesListParamsWithContext creates a new IPAMRolesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesListParamsWithContext(ctx context.Context) *IPAMRolesListParams { + var () + return &IPAMRolesListParams{ + + Context: ctx, + } +} + +// NewIPAMRolesListParamsWithHTTPClient creates a new IPAMRolesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesListParamsWithHTTPClient(client *http.Client) *IPAMRolesListParams { + var () + return &IPAMRolesListParams{ + HTTPClient: client, + } +} + +/*IPAMRolesListParams contains all the parameters to send to the API endpoint +for the ipam roles list operation typically these are written to a http.Request +*/ +type IPAMRolesListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles list params +func (o *IPAMRolesListParams) WithTimeout(timeout time.Duration) *IPAMRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles list params +func (o *IPAMRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles list params +func (o *IPAMRolesListParams) WithContext(ctx context.Context) *IPAMRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles list params +func (o *IPAMRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles list params +func (o *IPAMRolesListParams) WithHTTPClient(client *http.Client) *IPAMRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles list params +func (o *IPAMRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the ipam roles list params +func (o *IPAMRolesListParams) WithLimit(limit *int64) *IPAMRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam roles list params +func (o *IPAMRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam roles list params +func (o *IPAMRolesListParams) WithName(name *string) *IPAMRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam roles list params +func (o *IPAMRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam roles list params +func (o *IPAMRolesListParams) WithOffset(offset *int64) *IPAMRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam roles list params +func (o *IPAMRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the ipam roles list params +func (o *IPAMRolesListParams) WithSlug(slug *string) *IPAMRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the ipam roles list params +func (o *IPAMRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amroles_list_responses.go b/netbox/client/ipam/ip_amroles_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3df1dff479807e992a69c4f7026cfbdbb2892adc --- /dev/null +++ b/netbox/client/ipam/ip_amroles_list_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" +) + +// IPAMRolesListReader is a Reader for the IPAMRolesList structure. +type IPAMRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMRolesListOK creates a IPAMRolesListOK with default headers values +func NewIPAMRolesListOK() *IPAMRolesListOK { + return &IPAMRolesListOK{} +} + +/*IPAMRolesListOK handles this case with default header values. + +IPAMRolesListOK ipam roles list o k +*/ +type IPAMRolesListOK struct { + Payload *models.IPAMRolesListOKBody +} + +func (o *IPAMRolesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/roles/][%d] ipamRolesListOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMRolesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amroles_partial_update_parameters.go b/netbox/client/ipam/ip_amroles_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8b835bd96525f2f6b653ef499068e742dbb5a9f3 --- /dev/null +++ b/netbox/client/ipam/ip_amroles_partial_update_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" +) + +// NewIPAMRolesPartialUpdateParams creates a new IPAMRolesPartialUpdateParams object +// with the default values initialized. +func NewIPAMRolesPartialUpdateParams() *IPAMRolesPartialUpdateParams { + var () + return &IPAMRolesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesPartialUpdateParamsWithTimeout creates a new IPAMRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMRolesPartialUpdateParams { + var () + return &IPAMRolesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesPartialUpdateParamsWithContext creates a new IPAMRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesPartialUpdateParamsWithContext(ctx context.Context) *IPAMRolesPartialUpdateParams { + var () + return &IPAMRolesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMRolesPartialUpdateParamsWithHTTPClient creates a new IPAMRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMRolesPartialUpdateParams { + var () + return &IPAMRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMRolesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam roles partial update operation typically these are written to a http.Request +*/ +type IPAMRolesPartialUpdateParams struct { + + /*Data*/ + Data *models.Role + /*ID + A unique integer value identifying this role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithContext(ctx context.Context) *IPAMRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithData(data *models.Role) *IPAMRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetData(data *models.Role) { + o.Data = data +} + +// WithID adds the id to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) WithID(id int64) *IPAMRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles partial update params +func (o *IPAMRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesPartialUpdateParams) 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_amroles_partial_update_responses.go b/netbox/client/ipam/ip_amroles_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5c72fc34e8600f013c3cfef29df8a57df6b67fb8 --- /dev/null +++ b/netbox/client/ipam/ip_amroles_partial_update_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" +) + +// IPAMRolesPartialUpdateReader is a Reader for the IPAMRolesPartialUpdate structure. +type IPAMRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesPartialUpdateOK() + 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()) + } +} + +// NewIPAMRolesPartialUpdateOK creates a IPAMRolesPartialUpdateOK with default headers values +func NewIPAMRolesPartialUpdateOK() *IPAMRolesPartialUpdateOK { + return &IPAMRolesPartialUpdateOK{} +} + +/*IPAMRolesPartialUpdateOK handles this case with default header values. + +IPAMRolesPartialUpdateOK ipam roles partial update o k +*/ +type IPAMRolesPartialUpdateOK struct { + Payload *models.Role +} + +func (o *IPAMRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/roles/{id}/][%d] ipamRolesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Role) + + // 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_amroles_read_parameters.go b/netbox/client/ipam/ip_amroles_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..de91cfd007747d695e7705ae53f25e992705a6b6 --- /dev/null +++ b/netbox/client/ipam/ip_amroles_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" +) + +// NewIPAMRolesReadParams creates a new IPAMRolesReadParams object +// with the default values initialized. +func NewIPAMRolesReadParams() *IPAMRolesReadParams { + var () + return &IPAMRolesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesReadParamsWithTimeout creates a new IPAMRolesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesReadParamsWithTimeout(timeout time.Duration) *IPAMRolesReadParams { + var () + return &IPAMRolesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesReadParamsWithContext creates a new IPAMRolesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesReadParamsWithContext(ctx context.Context) *IPAMRolesReadParams { + var () + return &IPAMRolesReadParams{ + + Context: ctx, + } +} + +// NewIPAMRolesReadParamsWithHTTPClient creates a new IPAMRolesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesReadParamsWithHTTPClient(client *http.Client) *IPAMRolesReadParams { + var () + return &IPAMRolesReadParams{ + HTTPClient: client, + } +} + +/*IPAMRolesReadParams contains all the parameters to send to the API endpoint +for the ipam roles read operation typically these are written to a http.Request +*/ +type IPAMRolesReadParams struct { + + /*ID + A unique integer value identifying this role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles read params +func (o *IPAMRolesReadParams) WithTimeout(timeout time.Duration) *IPAMRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles read params +func (o *IPAMRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles read params +func (o *IPAMRolesReadParams) WithContext(ctx context.Context) *IPAMRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles read params +func (o *IPAMRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles read params +func (o *IPAMRolesReadParams) WithHTTPClient(client *http.Client) *IPAMRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles read params +func (o *IPAMRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam roles read params +func (o *IPAMRolesReadParams) WithID(id int64) *IPAMRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles read params +func (o *IPAMRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesReadParams) 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_amroles_read_responses.go b/netbox/client/ipam/ip_amroles_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9293a013403e20a26420255c626c22969a7b7b63 --- /dev/null +++ b/netbox/client/ipam/ip_amroles_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" +) + +// IPAMRolesReadReader is a Reader for the IPAMRolesRead structure. +type IPAMRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesReadOK() + 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()) + } +} + +// NewIPAMRolesReadOK creates a IPAMRolesReadOK with default headers values +func NewIPAMRolesReadOK() *IPAMRolesReadOK { + return &IPAMRolesReadOK{} +} + +/*IPAMRolesReadOK handles this case with default header values. + +IPAMRolesReadOK ipam roles read o k +*/ +type IPAMRolesReadOK struct { + Payload *models.Role +} + +func (o *IPAMRolesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/roles/{id}/][%d] ipamRolesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Role) + + // 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_amroles_update_parameters.go b/netbox/client/ipam/ip_amroles_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5de50f58003f282d8abd45f915929982439bffb1 --- /dev/null +++ b/netbox/client/ipam/ip_amroles_update_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" +) + +// NewIPAMRolesUpdateParams creates a new IPAMRolesUpdateParams object +// with the default values initialized. +func NewIPAMRolesUpdateParams() *IPAMRolesUpdateParams { + var () + return &IPAMRolesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMRolesUpdateParamsWithTimeout creates a new IPAMRolesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMRolesUpdateParamsWithTimeout(timeout time.Duration) *IPAMRolesUpdateParams { + var () + return &IPAMRolesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMRolesUpdateParamsWithContext creates a new IPAMRolesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMRolesUpdateParamsWithContext(ctx context.Context) *IPAMRolesUpdateParams { + var () + return &IPAMRolesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMRolesUpdateParamsWithHTTPClient creates a new IPAMRolesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMRolesUpdateParamsWithHTTPClient(client *http.Client) *IPAMRolesUpdateParams { + var () + return &IPAMRolesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMRolesUpdateParams contains all the parameters to send to the API endpoint +for the ipam roles update operation typically these are written to a http.Request +*/ +type IPAMRolesUpdateParams struct { + + /*Data*/ + Data *models.Role + /*ID + A unique integer value identifying this role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithTimeout(timeout time.Duration) *IPAMRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithContext(ctx context.Context) *IPAMRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithHTTPClient(client *http.Client) *IPAMRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithData(data *models.Role) *IPAMRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetData(data *models.Role) { + o.Data = data +} + +// WithID adds the id to the ipam roles update params +func (o *IPAMRolesUpdateParams) WithID(id int64) *IPAMRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam roles update params +func (o *IPAMRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMRolesUpdateParams) 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_amroles_update_responses.go b/netbox/client/ipam/ip_amroles_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..db28c4f55dac03f479f9b712fdb72352e7801610 --- /dev/null +++ b/netbox/client/ipam/ip_amroles_update_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" +) + +// IPAMRolesUpdateReader is a Reader for the IPAMRolesUpdate structure. +type IPAMRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMRolesUpdateOK() + 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()) + } +} + +// NewIPAMRolesUpdateOK creates a IPAMRolesUpdateOK with default headers values +func NewIPAMRolesUpdateOK() *IPAMRolesUpdateOK { + return &IPAMRolesUpdateOK{} +} + +/*IPAMRolesUpdateOK handles this case with default header values. + +IPAMRolesUpdateOK ipam roles update o k +*/ +type IPAMRolesUpdateOK struct { + Payload *models.Role +} + +func (o *IPAMRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/roles/{id}/][%d] ipamRolesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Role) + + // 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_amservices_create_parameters.go b/netbox/client/ipam/ip_amservices_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7e02221d8b2fa6a965964a7338d56aa11968c17f --- /dev/null +++ b/netbox/client/ipam/ip_amservices_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMServicesCreateParams creates a new IPAMServicesCreateParams object +// with the default values initialized. +func NewIPAMServicesCreateParams() *IPAMServicesCreateParams { + var () + return &IPAMServicesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesCreateParamsWithTimeout creates a new IPAMServicesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesCreateParamsWithTimeout(timeout time.Duration) *IPAMServicesCreateParams { + var () + return &IPAMServicesCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesCreateParamsWithContext creates a new IPAMServicesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesCreateParamsWithContext(ctx context.Context) *IPAMServicesCreateParams { + var () + return &IPAMServicesCreateParams{ + + Context: ctx, + } +} + +// NewIPAMServicesCreateParamsWithHTTPClient creates a new IPAMServicesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesCreateParamsWithHTTPClient(client *http.Client) *IPAMServicesCreateParams { + var () + return &IPAMServicesCreateParams{ + HTTPClient: client, + } +} + +/*IPAMServicesCreateParams contains all the parameters to send to the API endpoint +for the ipam services create operation typically these are written to a http.Request +*/ +type IPAMServicesCreateParams struct { + + /*Data*/ + Data *models.WritableService + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services create params +func (o *IPAMServicesCreateParams) WithTimeout(timeout time.Duration) *IPAMServicesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services create params +func (o *IPAMServicesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services create params +func (o *IPAMServicesCreateParams) WithContext(ctx context.Context) *IPAMServicesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services create params +func (o *IPAMServicesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services create params +func (o *IPAMServicesCreateParams) WithHTTPClient(client *http.Client) *IPAMServicesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services create params +func (o *IPAMServicesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam services create params +func (o *IPAMServicesCreateParams) WithData(data *models.WritableService) *IPAMServicesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam services create params +func (o *IPAMServicesCreateParams) SetData(data *models.WritableService) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesCreateParams) 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/ipam/ip_amservices_create_responses.go b/netbox/client/ipam/ip_amservices_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9bfd795f75ac44fa3932e23f127db8ca5349a197 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_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" +) + +// IPAMServicesCreateReader is a Reader for the IPAMServicesCreate structure. +type IPAMServicesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMServicesCreateCreated() + 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()) + } +} + +// NewIPAMServicesCreateCreated creates a IPAMServicesCreateCreated with default headers values +func NewIPAMServicesCreateCreated() *IPAMServicesCreateCreated { + return &IPAMServicesCreateCreated{} +} + +/*IPAMServicesCreateCreated handles this case with default header values. + +IPAMServicesCreateCreated ipam services create created +*/ +type IPAMServicesCreateCreated struct { + Payload *models.WritableService +} + +func (o *IPAMServicesCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/services/][%d] ipamServicesCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMServicesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableService) + + // 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_amservices_delete_parameters.go b/netbox/client/ipam/ip_amservices_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c7b8266dc109ba46cc81213b077deeb474592fc8 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_delete_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" +) + +// NewIPAMServicesDeleteParams creates a new IPAMServicesDeleteParams object +// with the default values initialized. +func NewIPAMServicesDeleteParams() *IPAMServicesDeleteParams { + var () + return &IPAMServicesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesDeleteParamsWithTimeout creates a new IPAMServicesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesDeleteParamsWithTimeout(timeout time.Duration) *IPAMServicesDeleteParams { + var () + return &IPAMServicesDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesDeleteParamsWithContext creates a new IPAMServicesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesDeleteParamsWithContext(ctx context.Context) *IPAMServicesDeleteParams { + var () + return &IPAMServicesDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMServicesDeleteParamsWithHTTPClient creates a new IPAMServicesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesDeleteParamsWithHTTPClient(client *http.Client) *IPAMServicesDeleteParams { + var () + return &IPAMServicesDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMServicesDeleteParams contains all the parameters to send to the API endpoint +for the ipam services delete operation typically these are written to a http.Request +*/ +type IPAMServicesDeleteParams struct { + + /*ID + A unique integer value identifying this service. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services delete params +func (o *IPAMServicesDeleteParams) WithTimeout(timeout time.Duration) *IPAMServicesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services delete params +func (o *IPAMServicesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services delete params +func (o *IPAMServicesDeleteParams) WithContext(ctx context.Context) *IPAMServicesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services delete params +func (o *IPAMServicesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services delete params +func (o *IPAMServicesDeleteParams) WithHTTPClient(client *http.Client) *IPAMServicesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services delete params +func (o *IPAMServicesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam services delete params +func (o *IPAMServicesDeleteParams) WithID(id int64) *IPAMServicesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services delete params +func (o *IPAMServicesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesDeleteParams) 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_amservices_delete_responses.go b/netbox/client/ipam/ip_amservices_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6e03dbabb57ad8e0a0b40e34a0cc8e2c3e2bfb81 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMServicesDeleteReader is a Reader for the IPAMServicesDelete structure. +type IPAMServicesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMServicesDeleteNoContent() + 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()) + } +} + +// NewIPAMServicesDeleteNoContent creates a IPAMServicesDeleteNoContent with default headers values +func NewIPAMServicesDeleteNoContent() *IPAMServicesDeleteNoContent { + return &IPAMServicesDeleteNoContent{} +} + +/*IPAMServicesDeleteNoContent handles this case with default header values. + +IPAMServicesDeleteNoContent ipam services delete no content +*/ +type IPAMServicesDeleteNoContent struct { +} + +func (o *IPAMServicesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/services/{id}/][%d] ipamServicesDeleteNoContent ", 204) +} + +func (o *IPAMServicesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amservices_list_parameters.go b/netbox/client/ipam/ip_amservices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9653e9e26487361989c1e21d70447b324f99ddc3 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_list_parameters.go @@ -0,0 +1,384 @@ +// 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" +) + +// NewIPAMServicesListParams creates a new IPAMServicesListParams object +// with the default values initialized. +func NewIPAMServicesListParams() *IPAMServicesListParams { + var () + return &IPAMServicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesListParamsWithTimeout creates a new IPAMServicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesListParamsWithTimeout(timeout time.Duration) *IPAMServicesListParams { + var () + return &IPAMServicesListParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesListParamsWithContext creates a new IPAMServicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesListParamsWithContext(ctx context.Context) *IPAMServicesListParams { + var () + return &IPAMServicesListParams{ + + Context: ctx, + } +} + +// NewIPAMServicesListParamsWithHTTPClient creates a new IPAMServicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesListParamsWithHTTPClient(client *http.Client) *IPAMServicesListParams { + var () + return &IPAMServicesListParams{ + HTTPClient: client, + } +} + +/*IPAMServicesListParams contains all the parameters to send to the API endpoint +for the ipam services list operation typically these are written to a http.Request +*/ +type IPAMServicesListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Port*/ + Port *float64 + /*Protocol*/ + Protocol *string + /*VirtualMachine*/ + VirtualMachine *string + /*VirtualMachineID*/ + VirtualMachineID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services list params +func (o *IPAMServicesListParams) WithTimeout(timeout time.Duration) *IPAMServicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services list params +func (o *IPAMServicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services list params +func (o *IPAMServicesListParams) WithContext(ctx context.Context) *IPAMServicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services list params +func (o *IPAMServicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services list params +func (o *IPAMServicesListParams) WithHTTPClient(client *http.Client) *IPAMServicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services list params +func (o *IPAMServicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the ipam services list params +func (o *IPAMServicesListParams) WithDevice(device *string) *IPAMServicesListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the ipam services list params +func (o *IPAMServicesListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the ipam services list params +func (o *IPAMServicesListParams) WithDeviceID(deviceID *string) *IPAMServicesListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the ipam services list params +func (o *IPAMServicesListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithLimit adds the limit to the ipam services list params +func (o *IPAMServicesListParams) WithLimit(limit *int64) *IPAMServicesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam services list params +func (o *IPAMServicesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam services list params +func (o *IPAMServicesListParams) WithName(name *string) *IPAMServicesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam services list params +func (o *IPAMServicesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam services list params +func (o *IPAMServicesListParams) WithOffset(offset *int64) *IPAMServicesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam services list params +func (o *IPAMServicesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPort adds the port to the ipam services list params +func (o *IPAMServicesListParams) WithPort(port *float64) *IPAMServicesListParams { + o.SetPort(port) + return o +} + +// SetPort adds the port to the ipam services list params +func (o *IPAMServicesListParams) SetPort(port *float64) { + o.Port = port +} + +// WithProtocol adds the protocol to the ipam services list params +func (o *IPAMServicesListParams) WithProtocol(protocol *string) *IPAMServicesListParams { + o.SetProtocol(protocol) + return o +} + +// SetProtocol adds the protocol to the ipam services list params +func (o *IPAMServicesListParams) SetProtocol(protocol *string) { + o.Protocol = protocol +} + +// WithVirtualMachine adds the virtualMachine to the ipam services list params +func (o *IPAMServicesListParams) WithVirtualMachine(virtualMachine *string) *IPAMServicesListParams { + o.SetVirtualMachine(virtualMachine) + return o +} + +// SetVirtualMachine adds the virtualMachine to the ipam services list params +func (o *IPAMServicesListParams) SetVirtualMachine(virtualMachine *string) { + o.VirtualMachine = virtualMachine +} + +// WithVirtualMachineID adds the virtualMachineID to the ipam services list params +func (o *IPAMServicesListParams) WithVirtualMachineID(virtualMachineID *string) *IPAMServicesListParams { + o.SetVirtualMachineID(virtualMachineID) + return o +} + +// SetVirtualMachineID adds the virtualMachineId to the ipam services list params +func (o *IPAMServicesListParams) SetVirtualMachineID(virtualMachineID *string) { + o.VirtualMachineID = virtualMachineID +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Port != nil { + + // query param port + var qrPort float64 + if o.Port != nil { + qrPort = *o.Port + } + qPort := swag.FormatFloat64(qrPort) + if qPort != "" { + if err := r.SetQueryParam("port", qPort); err != nil { + return err + } + } + + } + + if o.Protocol != nil { + + // query param protocol + var qrProtocol string + if o.Protocol != nil { + qrProtocol = *o.Protocol + } + qProtocol := qrProtocol + if qProtocol != "" { + if err := r.SetQueryParam("protocol", qProtocol); err != nil { + return err + } + } + + } + + if o.VirtualMachine != nil { + + // query param virtual_machine + var qrVirtualMachine string + if o.VirtualMachine != nil { + qrVirtualMachine = *o.VirtualMachine + } + qVirtualMachine := qrVirtualMachine + if qVirtualMachine != "" { + if err := r.SetQueryParam("virtual_machine", qVirtualMachine); err != nil { + return err + } + } + + } + + if o.VirtualMachineID != nil { + + // query param virtual_machine_id + var qrVirtualMachineID string + if o.VirtualMachineID != nil { + qrVirtualMachineID = *o.VirtualMachineID + } + qVirtualMachineID := qrVirtualMachineID + if qVirtualMachineID != "" { + if err := r.SetQueryParam("virtual_machine_id", qVirtualMachineID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amservices_list_responses.go b/netbox/client/ipam/ip_amservices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1f6dda6c3b2497418862a7927e035c622e990480 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_list_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" +) + +// IPAMServicesListReader is a Reader for the IPAMServicesList structure. +type IPAMServicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMServicesListOK creates a IPAMServicesListOK with default headers values +func NewIPAMServicesListOK() *IPAMServicesListOK { + return &IPAMServicesListOK{} +} + +/*IPAMServicesListOK handles this case with default header values. + +IPAMServicesListOK ipam services list o k +*/ +type IPAMServicesListOK struct { + Payload *models.IPAMServicesListOKBody +} + +func (o *IPAMServicesListOK) Error() string { + return fmt.Sprintf("[GET /ipam/services/][%d] ipamServicesListOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMServicesListOKBody) + + // 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_amservices_partial_update_parameters.go b/netbox/client/ipam/ip_amservices_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ad4c6ed63d3e6d63a93d6fc3c31c2bf2aa7e5115 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_partial_update_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" +) + +// NewIPAMServicesPartialUpdateParams creates a new IPAMServicesPartialUpdateParams object +// with the default values initialized. +func NewIPAMServicesPartialUpdateParams() *IPAMServicesPartialUpdateParams { + var () + return &IPAMServicesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesPartialUpdateParamsWithTimeout creates a new IPAMServicesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMServicesPartialUpdateParams { + var () + return &IPAMServicesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesPartialUpdateParamsWithContext creates a new IPAMServicesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesPartialUpdateParamsWithContext(ctx context.Context) *IPAMServicesPartialUpdateParams { + var () + return &IPAMServicesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMServicesPartialUpdateParamsWithHTTPClient creates a new IPAMServicesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMServicesPartialUpdateParams { + var () + return &IPAMServicesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMServicesPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam services partial update operation typically these are written to a http.Request +*/ +type IPAMServicesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableService + /*ID + A unique integer value identifying this service. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMServicesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithContext(ctx context.Context) *IPAMServicesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMServicesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithData(data *models.WritableService) *IPAMServicesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetData(data *models.WritableService) { + o.Data = data +} + +// WithID adds the id to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) WithID(id int64) *IPAMServicesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services partial update params +func (o *IPAMServicesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amservices_partial_update_responses.go b/netbox/client/ipam/ip_amservices_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..46e6ded757117c4010ec466a8cffbaa7e661c5b3 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_partial_update_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" +) + +// IPAMServicesPartialUpdateReader is a Reader for the IPAMServicesPartialUpdate structure. +type IPAMServicesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesPartialUpdateOK() + 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()) + } +} + +// NewIPAMServicesPartialUpdateOK creates a IPAMServicesPartialUpdateOK with default headers values +func NewIPAMServicesPartialUpdateOK() *IPAMServicesPartialUpdateOK { + return &IPAMServicesPartialUpdateOK{} +} + +/*IPAMServicesPartialUpdateOK handles this case with default header values. + +IPAMServicesPartialUpdateOK ipam services partial update o k +*/ +type IPAMServicesPartialUpdateOK struct { + Payload *models.WritableService +} + +func (o *IPAMServicesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/services/{id}/][%d] ipamServicesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableService) + + // 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_amservices_read_parameters.go b/netbox/client/ipam/ip_amservices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..18a968c85246ae711ebe048f5d7e0dac20506803 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_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" +) + +// NewIPAMServicesReadParams creates a new IPAMServicesReadParams object +// with the default values initialized. +func NewIPAMServicesReadParams() *IPAMServicesReadParams { + var () + return &IPAMServicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesReadParamsWithTimeout creates a new IPAMServicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesReadParamsWithTimeout(timeout time.Duration) *IPAMServicesReadParams { + var () + return &IPAMServicesReadParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesReadParamsWithContext creates a new IPAMServicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesReadParamsWithContext(ctx context.Context) *IPAMServicesReadParams { + var () + return &IPAMServicesReadParams{ + + Context: ctx, + } +} + +// NewIPAMServicesReadParamsWithHTTPClient creates a new IPAMServicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesReadParamsWithHTTPClient(client *http.Client) *IPAMServicesReadParams { + var () + return &IPAMServicesReadParams{ + HTTPClient: client, + } +} + +/*IPAMServicesReadParams contains all the parameters to send to the API endpoint +for the ipam services read operation typically these are written to a http.Request +*/ +type IPAMServicesReadParams struct { + + /*ID + A unique integer value identifying this service. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services read params +func (o *IPAMServicesReadParams) WithTimeout(timeout time.Duration) *IPAMServicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services read params +func (o *IPAMServicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services read params +func (o *IPAMServicesReadParams) WithContext(ctx context.Context) *IPAMServicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services read params +func (o *IPAMServicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services read params +func (o *IPAMServicesReadParams) WithHTTPClient(client *http.Client) *IPAMServicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services read params +func (o *IPAMServicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam services read params +func (o *IPAMServicesReadParams) WithID(id int64) *IPAMServicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services read params +func (o *IPAMServicesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesReadParams) 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_amservices_read_responses.go b/netbox/client/ipam/ip_amservices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c3f7675f205a57b79542344d6635cb281a81c67c --- /dev/null +++ b/netbox/client/ipam/ip_amservices_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" +) + +// IPAMServicesReadReader is a Reader for the IPAMServicesRead structure. +type IPAMServicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesReadOK() + 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()) + } +} + +// NewIPAMServicesReadOK creates a IPAMServicesReadOK with default headers values +func NewIPAMServicesReadOK() *IPAMServicesReadOK { + return &IPAMServicesReadOK{} +} + +/*IPAMServicesReadOK handles this case with default header values. + +IPAMServicesReadOK ipam services read o k +*/ +type IPAMServicesReadOK struct { + Payload *models.Service +} + +func (o *IPAMServicesReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/services/{id}/][%d] ipamServicesReadOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Service) + + // 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_amservices_update_parameters.go b/netbox/client/ipam/ip_amservices_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..625688035feae8f3d32233d3763f85d7e96c80b0 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_update_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" +) + +// NewIPAMServicesUpdateParams creates a new IPAMServicesUpdateParams object +// with the default values initialized. +func NewIPAMServicesUpdateParams() *IPAMServicesUpdateParams { + var () + return &IPAMServicesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMServicesUpdateParamsWithTimeout creates a new IPAMServicesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMServicesUpdateParamsWithTimeout(timeout time.Duration) *IPAMServicesUpdateParams { + var () + return &IPAMServicesUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMServicesUpdateParamsWithContext creates a new IPAMServicesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMServicesUpdateParamsWithContext(ctx context.Context) *IPAMServicesUpdateParams { + var () + return &IPAMServicesUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMServicesUpdateParamsWithHTTPClient creates a new IPAMServicesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMServicesUpdateParamsWithHTTPClient(client *http.Client) *IPAMServicesUpdateParams { + var () + return &IPAMServicesUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMServicesUpdateParams contains all the parameters to send to the API endpoint +for the ipam services update operation typically these are written to a http.Request +*/ +type IPAMServicesUpdateParams struct { + + /*Data*/ + Data *models.WritableService + /*ID + A unique integer value identifying this service. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam services update params +func (o *IPAMServicesUpdateParams) WithTimeout(timeout time.Duration) *IPAMServicesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam services update params +func (o *IPAMServicesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam services update params +func (o *IPAMServicesUpdateParams) WithContext(ctx context.Context) *IPAMServicesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam services update params +func (o *IPAMServicesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam services update params +func (o *IPAMServicesUpdateParams) WithHTTPClient(client *http.Client) *IPAMServicesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam services update params +func (o *IPAMServicesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam services update params +func (o *IPAMServicesUpdateParams) WithData(data *models.WritableService) *IPAMServicesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam services update params +func (o *IPAMServicesUpdateParams) SetData(data *models.WritableService) { + o.Data = data +} + +// WithID adds the id to the ipam services update params +func (o *IPAMServicesUpdateParams) WithID(id int64) *IPAMServicesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam services update params +func (o *IPAMServicesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMServicesUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Data != nil { + if err := r.SetBodyParam(o.Data); err != nil { + return err + } + } + + // path param id + if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amservices_update_responses.go b/netbox/client/ipam/ip_amservices_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..57d24c6d770880ee453794152688ecc9f09f3349 --- /dev/null +++ b/netbox/client/ipam/ip_amservices_update_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" +) + +// IPAMServicesUpdateReader is a Reader for the IPAMServicesUpdate structure. +type IPAMServicesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMServicesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMServicesUpdateOK() + 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()) + } +} + +// NewIPAMServicesUpdateOK creates a IPAMServicesUpdateOK with default headers values +func NewIPAMServicesUpdateOK() *IPAMServicesUpdateOK { + return &IPAMServicesUpdateOK{} +} + +/*IPAMServicesUpdateOK handles this case with default header values. + +IPAMServicesUpdateOK ipam services update o k +*/ +type IPAMServicesUpdateOK struct { + Payload *models.WritableService +} + +func (o *IPAMServicesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/services/{id}/][%d] ipamServicesUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMServicesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableService) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlan_groups_create_parameters.go b/netbox/client/ipam/ip_amvlan_groups_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8d3584784124933b16117e38e81ec41d39a20803 --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMVlanGroupsCreateParams creates a new IPAMVlanGroupsCreateParams object +// with the default values initialized. +func NewIPAMVlanGroupsCreateParams() *IPAMVlanGroupsCreateParams { + var () + return &IPAMVlanGroupsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsCreateParamsWithTimeout creates a new IPAMVlanGroupsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsCreateParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsCreateParams { + var () + return &IPAMVlanGroupsCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsCreateParamsWithContext creates a new IPAMVlanGroupsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsCreateParamsWithContext(ctx context.Context) *IPAMVlanGroupsCreateParams { + var () + return &IPAMVlanGroupsCreateParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsCreateParamsWithHTTPClient creates a new IPAMVlanGroupsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsCreateParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsCreateParams { + var () + return &IPAMVlanGroupsCreateParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsCreateParams contains all the parameters to send to the API endpoint +for the ipam vlan groups create operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsCreateParams struct { + + /*Data*/ + Data *models.WritableVLANGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) WithContext(ctx context.Context) *IPAMVlanGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) WithData(data *models.WritableVLANGroup) *IPAMVlanGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlan groups create params +func (o *IPAMVlanGroupsCreateParams) SetData(data *models.WritableVLANGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsCreateParams) 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/ipam/ip_amvlan_groups_create_responses.go b/netbox/client/ipam/ip_amvlan_groups_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..ea43c7123eff29e7ec9ae5b72da0cd0b1cea28ce --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_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" +) + +// IPAMVlanGroupsCreateReader is a Reader for the IPAMVlanGroupsCreate structure. +type IPAMVlanGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMVlanGroupsCreateCreated() + 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()) + } +} + +// NewIPAMVlanGroupsCreateCreated creates a IPAMVlanGroupsCreateCreated with default headers values +func NewIPAMVlanGroupsCreateCreated() *IPAMVlanGroupsCreateCreated { + return &IPAMVlanGroupsCreateCreated{} +} + +/*IPAMVlanGroupsCreateCreated handles this case with default header values. + +IPAMVlanGroupsCreateCreated ipam vlan groups create created +*/ +type IPAMVlanGroupsCreateCreated struct { + Payload *models.WritableVLANGroup +} + +func (o *IPAMVlanGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/vlan-groups/][%d] ipamVlanGroupsCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMVlanGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlan_groups_delete_parameters.go b/netbox/client/ipam/ip_amvlan_groups_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..4761e07bd181f9551f3d606ecf8bb0076d7e13f6 --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_delete_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" +) + +// NewIPAMVlanGroupsDeleteParams creates a new IPAMVlanGroupsDeleteParams object +// with the default values initialized. +func NewIPAMVlanGroupsDeleteParams() *IPAMVlanGroupsDeleteParams { + var () + return &IPAMVlanGroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsDeleteParamsWithTimeout creates a new IPAMVlanGroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsDeleteParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsDeleteParams { + var () + return &IPAMVlanGroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsDeleteParamsWithContext creates a new IPAMVlanGroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsDeleteParamsWithContext(ctx context.Context) *IPAMVlanGroupsDeleteParams { + var () + return &IPAMVlanGroupsDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsDeleteParamsWithHTTPClient creates a new IPAMVlanGroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsDeleteParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsDeleteParams { + var () + return &IPAMVlanGroupsDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsDeleteParams contains all the parameters to send to the API endpoint +for the ipam vlan groups delete operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsDeleteParams struct { + + /*ID + A unique integer value identifying this VLAN group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) WithContext(ctx context.Context) *IPAMVlanGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) WithID(id int64) *IPAMVlanGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups delete params +func (o *IPAMVlanGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsDeleteParams) 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_amvlan_groups_delete_responses.go b/netbox/client/ipam/ip_amvlan_groups_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f77eb28c0635d6a9dc2275223a21d80b56cf1ac5 --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMVlanGroupsDeleteReader is a Reader for the IPAMVlanGroupsDelete structure. +type IPAMVlanGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMVlanGroupsDeleteNoContent() + 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()) + } +} + +// NewIPAMVlanGroupsDeleteNoContent creates a IPAMVlanGroupsDeleteNoContent with default headers values +func NewIPAMVlanGroupsDeleteNoContent() *IPAMVlanGroupsDeleteNoContent { + return &IPAMVlanGroupsDeleteNoContent{} +} + +/*IPAMVlanGroupsDeleteNoContent handles this case with default header values. + +IPAMVlanGroupsDeleteNoContent ipam vlan groups delete no content +*/ +type IPAMVlanGroupsDeleteNoContent struct { +} + +func (o *IPAMVlanGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/vlan-groups/{id}/][%d] ipamVlanGroupsDeleteNoContent ", 204) +} + +func (o *IPAMVlanGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amvlan_groups_list_parameters.go b/netbox/client/ipam/ip_amvlan_groups_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..fccfb203a794c703bd97c6dc3f3aecabb6e0806e --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_list_parameters.go @@ -0,0 +1,297 @@ +// 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" +) + +// NewIPAMVlanGroupsListParams creates a new IPAMVlanGroupsListParams object +// with the default values initialized. +func NewIPAMVlanGroupsListParams() *IPAMVlanGroupsListParams { + var () + return &IPAMVlanGroupsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsListParamsWithTimeout creates a new IPAMVlanGroupsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsListParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsListParams { + var () + return &IPAMVlanGroupsListParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsListParamsWithContext creates a new IPAMVlanGroupsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsListParamsWithContext(ctx context.Context) *IPAMVlanGroupsListParams { + var () + return &IPAMVlanGroupsListParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsListParamsWithHTTPClient creates a new IPAMVlanGroupsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsListParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsListParams { + var () + return &IPAMVlanGroupsListParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsListParams contains all the parameters to send to the API endpoint +for the ipam vlan groups list operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithContext(ctx context.Context) *IPAMVlanGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithLimit(limit *int64) *IPAMVlanGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithName(name *string) *IPAMVlanGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithOffset(offset *int64) *IPAMVlanGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSite adds the site to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithSite(site *string) *IPAMVlanGroupsListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithSiteID(siteID *string) *IPAMVlanGroupsListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithSlug adds the slug to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) WithSlug(slug *string) *IPAMVlanGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the ipam vlan groups list params +func (o *IPAMVlanGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amvlan_groups_list_responses.go b/netbox/client/ipam/ip_amvlan_groups_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7f59051b750d4fabfc9ed1dc630741e91fd87c12 --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_list_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" +) + +// IPAMVlanGroupsListReader is a Reader for the IPAMVlanGroupsList structure. +type IPAMVlanGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlanGroupsListOK creates a IPAMVlanGroupsListOK with default headers values +func NewIPAMVlanGroupsListOK() *IPAMVlanGroupsListOK { + return &IPAMVlanGroupsListOK{} +} + +/*IPAMVlanGroupsListOK handles this case with default header values. + +IPAMVlanGroupsListOK ipam vlan groups list o k +*/ +type IPAMVlanGroupsListOK struct { + Payload *models.IPAMVlanGroupsListOKBody +} + +func (o *IPAMVlanGroupsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlan-groups/][%d] ipamVlanGroupsListOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMVlanGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go b/netbox/client/ipam/ip_amvlan_groups_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a900581400473e99694024ecc2209b160f000828 --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_partial_update_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" +) + +// NewIPAMVlanGroupsPartialUpdateParams creates a new IPAMVlanGroupsPartialUpdateParams object +// with the default values initialized. +func NewIPAMVlanGroupsPartialUpdateParams() *IPAMVlanGroupsPartialUpdateParams { + var () + return &IPAMVlanGroupsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsPartialUpdateParamsWithTimeout creates a new IPAMVlanGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsPartialUpdateParams { + var () + return &IPAMVlanGroupsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsPartialUpdateParamsWithContext creates a new IPAMVlanGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsPartialUpdateParamsWithContext(ctx context.Context) *IPAMVlanGroupsPartialUpdateParams { + var () + return &IPAMVlanGroupsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsPartialUpdateParamsWithHTTPClient creates a new IPAMVlanGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsPartialUpdateParams { + var () + return &IPAMVlanGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam vlan groups partial update operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVLANGroup + /*ID + A unique integer value identifying this VLAN group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithContext(ctx context.Context) *IPAMVlanGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithData(data *models.WritableVLANGroup) *IPAMVlanGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetData(data *models.WritableVLANGroup) { + o.Data = data +} + +// WithID adds the id to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) WithID(id int64) *IPAMVlanGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups partial update params +func (o *IPAMVlanGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsPartialUpdateParams) 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_amvlan_groups_partial_update_responses.go b/netbox/client/ipam/ip_amvlan_groups_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bf5310eea556838f46f80858c362f81825a4e3aa --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_partial_update_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" +) + +// IPAMVlanGroupsPartialUpdateReader is a Reader for the IPAMVlanGroupsPartialUpdate structure. +type IPAMVlanGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsPartialUpdateOK() + 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()) + } +} + +// NewIPAMVlanGroupsPartialUpdateOK creates a IPAMVlanGroupsPartialUpdateOK with default headers values +func NewIPAMVlanGroupsPartialUpdateOK() *IPAMVlanGroupsPartialUpdateOK { + return &IPAMVlanGroupsPartialUpdateOK{} +} + +/*IPAMVlanGroupsPartialUpdateOK handles this case with default header values. + +IPAMVlanGroupsPartialUpdateOK ipam vlan groups partial update o k +*/ +type IPAMVlanGroupsPartialUpdateOK struct { + Payload *models.WritableVLANGroup +} + +func (o *IPAMVlanGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/vlan-groups/{id}/][%d] ipamVlanGroupsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlan_groups_read_parameters.go b/netbox/client/ipam/ip_amvlan_groups_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8555dded33d539714a9a7efec03739ca9b35d345 --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_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" +) + +// NewIPAMVlanGroupsReadParams creates a new IPAMVlanGroupsReadParams object +// with the default values initialized. +func NewIPAMVlanGroupsReadParams() *IPAMVlanGroupsReadParams { + var () + return &IPAMVlanGroupsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsReadParamsWithTimeout creates a new IPAMVlanGroupsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsReadParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsReadParams { + var () + return &IPAMVlanGroupsReadParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsReadParamsWithContext creates a new IPAMVlanGroupsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsReadParamsWithContext(ctx context.Context) *IPAMVlanGroupsReadParams { + var () + return &IPAMVlanGroupsReadParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsReadParamsWithHTTPClient creates a new IPAMVlanGroupsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsReadParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsReadParams { + var () + return &IPAMVlanGroupsReadParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsReadParams contains all the parameters to send to the API endpoint +for the ipam vlan groups read operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsReadParams struct { + + /*ID + A unique integer value identifying this VLAN group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) WithContext(ctx context.Context) *IPAMVlanGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) WithID(id int64) *IPAMVlanGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups read params +func (o *IPAMVlanGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsReadParams) 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_amvlan_groups_read_responses.go b/netbox/client/ipam/ip_amvlan_groups_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..01c7ede30969958fd8fb318dbaf3fb6af861de3b --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_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" +) + +// IPAMVlanGroupsReadReader is a Reader for the IPAMVlanGroupsRead structure. +type IPAMVlanGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsReadOK() + 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()) + } +} + +// NewIPAMVlanGroupsReadOK creates a IPAMVlanGroupsReadOK with default headers values +func NewIPAMVlanGroupsReadOK() *IPAMVlanGroupsReadOK { + return &IPAMVlanGroupsReadOK{} +} + +/*IPAMVlanGroupsReadOK handles this case with default header values. + +IPAMVlanGroupsReadOK ipam vlan groups read o k +*/ +type IPAMVlanGroupsReadOK struct { + Payload *models.VLANGroup +} + +func (o *IPAMVlanGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlan-groups/{id}/][%d] ipamVlanGroupsReadOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlan_groups_update_parameters.go b/netbox/client/ipam/ip_amvlan_groups_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..fd2f73f2455ea34bb5908609bd0990c76ed57709 --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_update_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" +) + +// NewIPAMVlanGroupsUpdateParams creates a new IPAMVlanGroupsUpdateParams object +// with the default values initialized. +func NewIPAMVlanGroupsUpdateParams() *IPAMVlanGroupsUpdateParams { + var () + return &IPAMVlanGroupsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlanGroupsUpdateParamsWithTimeout creates a new IPAMVlanGroupsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlanGroupsUpdateParamsWithTimeout(timeout time.Duration) *IPAMVlanGroupsUpdateParams { + var () + return &IPAMVlanGroupsUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlanGroupsUpdateParamsWithContext creates a new IPAMVlanGroupsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlanGroupsUpdateParamsWithContext(ctx context.Context) *IPAMVlanGroupsUpdateParams { + var () + return &IPAMVlanGroupsUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVlanGroupsUpdateParamsWithHTTPClient creates a new IPAMVlanGroupsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlanGroupsUpdateParamsWithHTTPClient(client *http.Client) *IPAMVlanGroupsUpdateParams { + var () + return &IPAMVlanGroupsUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVlanGroupsUpdateParams contains all the parameters to send to the API endpoint +for the ipam vlan groups update operation typically these are written to a http.Request +*/ +type IPAMVlanGroupsUpdateParams struct { + + /*Data*/ + Data *models.WritableVLANGroup + /*ID + A unique integer value identifying this VLAN group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithTimeout(timeout time.Duration) *IPAMVlanGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithContext(ctx context.Context) *IPAMVlanGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithHTTPClient(client *http.Client) *IPAMVlanGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithData(data *models.WritableVLANGroup) *IPAMVlanGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetData(data *models.WritableVLANGroup) { + o.Data = data +} + +// WithID adds the id to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) WithID(id int64) *IPAMVlanGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlan groups update params +func (o *IPAMVlanGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlanGroupsUpdateParams) 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_amvlan_groups_update_responses.go b/netbox/client/ipam/ip_amvlan_groups_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1700b8603648c8bebe9ecc399d60d2593a0d52d5 --- /dev/null +++ b/netbox/client/ipam/ip_amvlan_groups_update_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" +) + +// IPAMVlanGroupsUpdateReader is a Reader for the IPAMVlanGroupsUpdate structure. +type IPAMVlanGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlanGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlanGroupsUpdateOK() + 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()) + } +} + +// NewIPAMVlanGroupsUpdateOK creates a IPAMVlanGroupsUpdateOK with default headers values +func NewIPAMVlanGroupsUpdateOK() *IPAMVlanGroupsUpdateOK { + return &IPAMVlanGroupsUpdateOK{} +} + +/*IPAMVlanGroupsUpdateOK handles this case with default header values. + +IPAMVlanGroupsUpdateOK ipam vlan groups update o k +*/ +type IPAMVlanGroupsUpdateOK struct { + Payload *models.WritableVLANGroup +} + +func (o *IPAMVlanGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/vlan-groups/{id}/][%d] ipamVlanGroupsUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVlanGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLANGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlans_create_parameters.go b/netbox/client/ipam/ip_amvlans_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1f9a99b6d1c38811fe297ab088224e0b2303321a --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMVlansCreateParams creates a new IPAMVlansCreateParams object +// with the default values initialized. +func NewIPAMVlansCreateParams() *IPAMVlansCreateParams { + var () + return &IPAMVlansCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansCreateParamsWithTimeout creates a new IPAMVlansCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansCreateParamsWithTimeout(timeout time.Duration) *IPAMVlansCreateParams { + var () + return &IPAMVlansCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansCreateParamsWithContext creates a new IPAMVlansCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansCreateParamsWithContext(ctx context.Context) *IPAMVlansCreateParams { + var () + return &IPAMVlansCreateParams{ + + Context: ctx, + } +} + +// NewIPAMVlansCreateParamsWithHTTPClient creates a new IPAMVlansCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansCreateParamsWithHTTPClient(client *http.Client) *IPAMVlansCreateParams { + var () + return &IPAMVlansCreateParams{ + HTTPClient: client, + } +} + +/*IPAMVlansCreateParams contains all the parameters to send to the API endpoint +for the ipam vlans create operation typically these are written to a http.Request +*/ +type IPAMVlansCreateParams struct { + + /*Data*/ + Data *models.WritableVLAN + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans create params +func (o *IPAMVlansCreateParams) WithTimeout(timeout time.Duration) *IPAMVlansCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans create params +func (o *IPAMVlansCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans create params +func (o *IPAMVlansCreateParams) WithContext(ctx context.Context) *IPAMVlansCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans create params +func (o *IPAMVlansCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans create params +func (o *IPAMVlansCreateParams) WithHTTPClient(client *http.Client) *IPAMVlansCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans create params +func (o *IPAMVlansCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlans create params +func (o *IPAMVlansCreateParams) WithData(data *models.WritableVLAN) *IPAMVlansCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlans create params +func (o *IPAMVlansCreateParams) SetData(data *models.WritableVLAN) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansCreateParams) 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/ipam/ip_amvlans_create_responses.go b/netbox/client/ipam/ip_amvlans_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4ab45d2866708e7ade06889290fb55c8f0c17ea3 --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_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" +) + +// IPAMVlansCreateReader is a Reader for the IPAMVlansCreate structure. +type IPAMVlansCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMVlansCreateCreated() + 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()) + } +} + +// NewIPAMVlansCreateCreated creates a IPAMVlansCreateCreated with default headers values +func NewIPAMVlansCreateCreated() *IPAMVlansCreateCreated { + return &IPAMVlansCreateCreated{} +} + +/*IPAMVlansCreateCreated handles this case with default header values. + +IPAMVlansCreateCreated ipam vlans create created +*/ +type IPAMVlansCreateCreated struct { + Payload *models.WritableVLAN +} + +func (o *IPAMVlansCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/vlans/][%d] ipamVlansCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMVlansCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlans_delete_parameters.go b/netbox/client/ipam/ip_amvlans_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..49ddf5527f52608e5c2b39ed48379dd8d0a4609f --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_delete_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" +) + +// NewIPAMVlansDeleteParams creates a new IPAMVlansDeleteParams object +// with the default values initialized. +func NewIPAMVlansDeleteParams() *IPAMVlansDeleteParams { + var () + return &IPAMVlansDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansDeleteParamsWithTimeout creates a new IPAMVlansDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansDeleteParamsWithTimeout(timeout time.Duration) *IPAMVlansDeleteParams { + var () + return &IPAMVlansDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansDeleteParamsWithContext creates a new IPAMVlansDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansDeleteParamsWithContext(ctx context.Context) *IPAMVlansDeleteParams { + var () + return &IPAMVlansDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMVlansDeleteParamsWithHTTPClient creates a new IPAMVlansDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansDeleteParamsWithHTTPClient(client *http.Client) *IPAMVlansDeleteParams { + var () + return &IPAMVlansDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMVlansDeleteParams contains all the parameters to send to the API endpoint +for the ipam vlans delete operation typically these are written to a http.Request +*/ +type IPAMVlansDeleteParams struct { + + /*ID + A unique integer value identifying this VLAN. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) WithTimeout(timeout time.Duration) *IPAMVlansDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) WithContext(ctx context.Context) *IPAMVlansDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) WithHTTPClient(client *http.Client) *IPAMVlansDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) WithID(id int64) *IPAMVlansDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlans delete params +func (o *IPAMVlansDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansDeleteParams) 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_amvlans_delete_responses.go b/netbox/client/ipam/ip_amvlans_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..6db44f1231237e466483b08558af88532126482c --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMVlansDeleteReader is a Reader for the IPAMVlansDelete structure. +type IPAMVlansDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMVlansDeleteNoContent() + 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()) + } +} + +// NewIPAMVlansDeleteNoContent creates a IPAMVlansDeleteNoContent with default headers values +func NewIPAMVlansDeleteNoContent() *IPAMVlansDeleteNoContent { + return &IPAMVlansDeleteNoContent{} +} + +/*IPAMVlansDeleteNoContent handles this case with default header values. + +IPAMVlansDeleteNoContent ipam vlans delete no content +*/ +type IPAMVlansDeleteNoContent struct { +} + +func (o *IPAMVlansDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/vlans/{id}/][%d] ipamVlansDeleteNoContent ", 204) +} + +func (o *IPAMVlansDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amvlans_list_parameters.go b/netbox/client/ipam/ip_amvlans_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6ecf2f57e0d9d5199b671c9ac6902a5eefed9057 --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_list_parameters.go @@ -0,0 +1,561 @@ +// 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" +) + +// NewIPAMVlansListParams creates a new IPAMVlansListParams object +// with the default values initialized. +func NewIPAMVlansListParams() *IPAMVlansListParams { + var () + return &IPAMVlansListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansListParamsWithTimeout creates a new IPAMVlansListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansListParamsWithTimeout(timeout time.Duration) *IPAMVlansListParams { + var () + return &IPAMVlansListParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansListParamsWithContext creates a new IPAMVlansListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansListParamsWithContext(ctx context.Context) *IPAMVlansListParams { + var () + return &IPAMVlansListParams{ + + Context: ctx, + } +} + +// NewIPAMVlansListParamsWithHTTPClient creates a new IPAMVlansListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansListParamsWithHTTPClient(client *http.Client) *IPAMVlansListParams { + var () + return &IPAMVlansListParams{ + HTTPClient: client, + } +} + +/*IPAMVlansListParams contains all the parameters to send to the API endpoint +for the ipam vlans list operation typically these are written to a http.Request +*/ +type IPAMVlansListParams struct { + + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + /*Vid*/ + Vid *float64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans list params +func (o *IPAMVlansListParams) WithTimeout(timeout time.Duration) *IPAMVlansListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans list params +func (o *IPAMVlansListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans list params +func (o *IPAMVlansListParams) WithContext(ctx context.Context) *IPAMVlansListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans list params +func (o *IPAMVlansListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans list params +func (o *IPAMVlansListParams) WithHTTPClient(client *http.Client) *IPAMVlansListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans list params +func (o *IPAMVlansListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGroup adds the group to the ipam vlans list params +func (o *IPAMVlansListParams) WithGroup(group *string) *IPAMVlansListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the ipam vlans list params +func (o *IPAMVlansListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the ipam vlans list params +func (o *IPAMVlansListParams) WithGroupID(groupID *string) *IPAMVlansListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the ipam vlans list params +func (o *IPAMVlansListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the ipam vlans list params +func (o *IPAMVlansListParams) WithIDIn(iDIn *float64) *IPAMVlansListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam vlans list params +func (o *IPAMVlansListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the ipam vlans list params +func (o *IPAMVlansListParams) WithLimit(limit *int64) *IPAMVlansListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam vlans list params +func (o *IPAMVlansListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam vlans list params +func (o *IPAMVlansListParams) WithName(name *string) *IPAMVlansListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam vlans list params +func (o *IPAMVlansListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam vlans list params +func (o *IPAMVlansListParams) WithOffset(offset *int64) *IPAMVlansListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam vlans list params +func (o *IPAMVlansListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the ipam vlans list params +func (o *IPAMVlansListParams) WithQ(q *string) *IPAMVlansListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam vlans list params +func (o *IPAMVlansListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the ipam vlans list params +func (o *IPAMVlansListParams) WithRole(role *string) *IPAMVlansListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the ipam vlans list params +func (o *IPAMVlansListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the ipam vlans list params +func (o *IPAMVlansListParams) WithRoleID(roleID *string) *IPAMVlansListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the ipam vlans list params +func (o *IPAMVlansListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSite adds the site to the ipam vlans list params +func (o *IPAMVlansListParams) WithSite(site *string) *IPAMVlansListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the ipam vlans list params +func (o *IPAMVlansListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the ipam vlans list params +func (o *IPAMVlansListParams) WithSiteID(siteID *string) *IPAMVlansListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the ipam vlans list params +func (o *IPAMVlansListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the ipam vlans list params +func (o *IPAMVlansListParams) WithStatus(status *string) *IPAMVlansListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the ipam vlans list params +func (o *IPAMVlansListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the ipam vlans list params +func (o *IPAMVlansListParams) WithTenant(tenant *string) *IPAMVlansListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam vlans list params +func (o *IPAMVlansListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the ipam vlans list params +func (o *IPAMVlansListParams) WithTenantID(tenantID *string) *IPAMVlansListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam vlans list params +func (o *IPAMVlansListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WithVid adds the vid to the ipam vlans list params +func (o *IPAMVlansListParams) WithVid(vid *float64) *IPAMVlansListParams { + o.SetVid(vid) + return o +} + +// SetVid adds the vid to the ipam vlans list params +func (o *IPAMVlansListParams) SetVid(vid *float64) { + o.Vid = vid +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Group != nil { + + // query param group + var qrGroup string + if o.Group != nil { + qrGroup = *o.Group + } + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("group", qGroup); err != nil { + return err + } + } + + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Role != nil { + + // query param role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + + } + + if o.RoleID != nil { + + // query param role_id + var qrRoleID string + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + if err := r.SetQueryParam("role_id", qRoleID); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.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 + 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.Vid != nil { + + // query param vid + var qrVid float64 + if o.Vid != nil { + qrVid = *o.Vid + } + qVid := swag.FormatFloat64(qrVid) + if qVid != "" { + if err := r.SetQueryParam("vid", qVid); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amvlans_list_responses.go b/netbox/client/ipam/ip_amvlans_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..79451ccbe7eb41cf4adc5a97b747f15e9daf10ea --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_list_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" +) + +// IPAMVlansListReader is a Reader for the IPAMVlansList structure. +type IPAMVlansListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVlansListOK creates a IPAMVlansListOK with default headers values +func NewIPAMVlansListOK() *IPAMVlansListOK { + return &IPAMVlansListOK{} +} + +/*IPAMVlansListOK handles this case with default header values. + +IPAMVlansListOK ipam vlans list o k +*/ +type IPAMVlansListOK struct { + Payload *models.IPAMVlansListOKBody +} + +func (o *IPAMVlansListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlans/][%d] ipamVlansListOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMVlansListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlans_partial_update_parameters.go b/netbox/client/ipam/ip_amvlans_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..84e783298de833bc3529d35c3bf877992562406c --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_partial_update_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" +) + +// NewIPAMVlansPartialUpdateParams creates a new IPAMVlansPartialUpdateParams object +// with the default values initialized. +func NewIPAMVlansPartialUpdateParams() *IPAMVlansPartialUpdateParams { + var () + return &IPAMVlansPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansPartialUpdateParamsWithTimeout creates a new IPAMVlansPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMVlansPartialUpdateParams { + var () + return &IPAMVlansPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansPartialUpdateParamsWithContext creates a new IPAMVlansPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansPartialUpdateParamsWithContext(ctx context.Context) *IPAMVlansPartialUpdateParams { + var () + return &IPAMVlansPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVlansPartialUpdateParamsWithHTTPClient creates a new IPAMVlansPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMVlansPartialUpdateParams { + var () + return &IPAMVlansPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVlansPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam vlans partial update operation typically these are written to a http.Request +*/ +type IPAMVlansPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVLAN + /*ID + A unique integer value identifying this VLAN. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMVlansPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithContext(ctx context.Context) *IPAMVlansPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMVlansPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithData(data *models.WritableVLAN) *IPAMVlansPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetData(data *models.WritableVLAN) { + o.Data = data +} + +// WithID adds the id to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) WithID(id int64) *IPAMVlansPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlans partial update params +func (o *IPAMVlansPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansPartialUpdateParams) 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_amvlans_partial_update_responses.go b/netbox/client/ipam/ip_amvlans_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c5f285eaad36364f358ce474b32be45238f1bf1e --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_partial_update_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" +) + +// IPAMVlansPartialUpdateReader is a Reader for the IPAMVlansPartialUpdate structure. +type IPAMVlansPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansPartialUpdateOK() + 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()) + } +} + +// NewIPAMVlansPartialUpdateOK creates a IPAMVlansPartialUpdateOK with default headers values +func NewIPAMVlansPartialUpdateOK() *IPAMVlansPartialUpdateOK { + return &IPAMVlansPartialUpdateOK{} +} + +/*IPAMVlansPartialUpdateOK handles this case with default header values. + +IPAMVlansPartialUpdateOK ipam vlans partial update o k +*/ +type IPAMVlansPartialUpdateOK struct { + Payload *models.WritableVLAN +} + +func (o *IPAMVlansPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/vlans/{id}/][%d] ipamVlansPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlans_read_parameters.go b/netbox/client/ipam/ip_amvlans_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..26f10dd2484399ae8d18204584994c5b71be1da4 --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_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" +) + +// NewIPAMVlansReadParams creates a new IPAMVlansReadParams object +// with the default values initialized. +func NewIPAMVlansReadParams() *IPAMVlansReadParams { + var () + return &IPAMVlansReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansReadParamsWithTimeout creates a new IPAMVlansReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansReadParamsWithTimeout(timeout time.Duration) *IPAMVlansReadParams { + var () + return &IPAMVlansReadParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansReadParamsWithContext creates a new IPAMVlansReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansReadParamsWithContext(ctx context.Context) *IPAMVlansReadParams { + var () + return &IPAMVlansReadParams{ + + Context: ctx, + } +} + +// NewIPAMVlansReadParamsWithHTTPClient creates a new IPAMVlansReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansReadParamsWithHTTPClient(client *http.Client) *IPAMVlansReadParams { + var () + return &IPAMVlansReadParams{ + HTTPClient: client, + } +} + +/*IPAMVlansReadParams contains all the parameters to send to the API endpoint +for the ipam vlans read operation typically these are written to a http.Request +*/ +type IPAMVlansReadParams struct { + + /*ID + A unique integer value identifying this VLAN. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans read params +func (o *IPAMVlansReadParams) WithTimeout(timeout time.Duration) *IPAMVlansReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans read params +func (o *IPAMVlansReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans read params +func (o *IPAMVlansReadParams) WithContext(ctx context.Context) *IPAMVlansReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans read params +func (o *IPAMVlansReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans read params +func (o *IPAMVlansReadParams) WithHTTPClient(client *http.Client) *IPAMVlansReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans read params +func (o *IPAMVlansReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vlans read params +func (o *IPAMVlansReadParams) WithID(id int64) *IPAMVlansReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlans read params +func (o *IPAMVlansReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansReadParams) 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_amvlans_read_responses.go b/netbox/client/ipam/ip_amvlans_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b540dd08186cb40eadca975784f1e7efe96027a1 --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_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" +) + +// IPAMVlansReadReader is a Reader for the IPAMVlansRead structure. +type IPAMVlansReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansReadOK() + 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()) + } +} + +// NewIPAMVlansReadOK creates a IPAMVlansReadOK with default headers values +func NewIPAMVlansReadOK() *IPAMVlansReadOK { + return &IPAMVlansReadOK{} +} + +/*IPAMVlansReadOK handles this case with default header values. + +IPAMVlansReadOK ipam vlans read o k +*/ +type IPAMVlansReadOK struct { + Payload *models.VLAN +} + +func (o *IPAMVlansReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/vlans/{id}/][%d] ipamVlansReadOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvlans_update_parameters.go b/netbox/client/ipam/ip_amvlans_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..529a2e582a8e7587dc448947c6719dce289ff42b --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_update_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" +) + +// NewIPAMVlansUpdateParams creates a new IPAMVlansUpdateParams object +// with the default values initialized. +func NewIPAMVlansUpdateParams() *IPAMVlansUpdateParams { + var () + return &IPAMVlansUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVlansUpdateParamsWithTimeout creates a new IPAMVlansUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVlansUpdateParamsWithTimeout(timeout time.Duration) *IPAMVlansUpdateParams { + var () + return &IPAMVlansUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVlansUpdateParamsWithContext creates a new IPAMVlansUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVlansUpdateParamsWithContext(ctx context.Context) *IPAMVlansUpdateParams { + var () + return &IPAMVlansUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVlansUpdateParamsWithHTTPClient creates a new IPAMVlansUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVlansUpdateParamsWithHTTPClient(client *http.Client) *IPAMVlansUpdateParams { + var () + return &IPAMVlansUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVlansUpdateParams contains all the parameters to send to the API endpoint +for the ipam vlans update operation typically these are written to a http.Request +*/ +type IPAMVlansUpdateParams struct { + + /*Data*/ + Data *models.WritableVLAN + /*ID + A unique integer value identifying this VLAN. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithTimeout(timeout time.Duration) *IPAMVlansUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithContext(ctx context.Context) *IPAMVlansUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithHTTPClient(client *http.Client) *IPAMVlansUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithData(data *models.WritableVLAN) *IPAMVlansUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetData(data *models.WritableVLAN) { + o.Data = data +} + +// WithID adds the id to the ipam vlans update params +func (o *IPAMVlansUpdateParams) WithID(id int64) *IPAMVlansUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vlans update params +func (o *IPAMVlansUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVlansUpdateParams) 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_amvlans_update_responses.go b/netbox/client/ipam/ip_amvlans_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..416e808cd7343180773bcff8796258902a4dbb1c --- /dev/null +++ b/netbox/client/ipam/ip_amvlans_update_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" +) + +// IPAMVlansUpdateReader is a Reader for the IPAMVlansUpdate structure. +type IPAMVlansUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVlansUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVlansUpdateOK() + 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()) + } +} + +// NewIPAMVlansUpdateOK creates a IPAMVlansUpdateOK with default headers values +func NewIPAMVlansUpdateOK() *IPAMVlansUpdateOK { + return &IPAMVlansUpdateOK{} +} + +/*IPAMVlansUpdateOK handles this case with default header values. + +IPAMVlansUpdateOK ipam vlans update o k +*/ +type IPAMVlansUpdateOK struct { + Payload *models.WritableVLAN +} + +func (o *IPAMVlansUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/vlans/{id}/][%d] ipamVlansUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVlansUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVLAN) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvrfs_create_parameters.go b/netbox/client/ipam/ip_amvrfs_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..0cc51543b3b5f2878e58860c4e89c32f818ec03c --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_create_parameters.go @@ -0,0 +1,137 @@ +// 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" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/models" +) + +// NewIPAMVrfsCreateParams creates a new IPAMVrfsCreateParams object +// with the default values initialized. +func NewIPAMVrfsCreateParams() *IPAMVrfsCreateParams { + var () + return &IPAMVrfsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsCreateParamsWithTimeout creates a new IPAMVrfsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsCreateParamsWithTimeout(timeout time.Duration) *IPAMVrfsCreateParams { + var () + return &IPAMVrfsCreateParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsCreateParamsWithContext creates a new IPAMVrfsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsCreateParamsWithContext(ctx context.Context) *IPAMVrfsCreateParams { + var () + return &IPAMVrfsCreateParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsCreateParamsWithHTTPClient creates a new IPAMVrfsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsCreateParamsWithHTTPClient(client *http.Client) *IPAMVrfsCreateParams { + var () + return &IPAMVrfsCreateParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsCreateParams contains all the parameters to send to the API endpoint +for the ipam vrfs create operation typically these are written to a http.Request +*/ +type IPAMVrfsCreateParams struct { + + /*Data*/ + Data *models.WritableVRF + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) WithTimeout(timeout time.Duration) *IPAMVrfsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) WithContext(ctx context.Context) *IPAMVrfsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) WithHTTPClient(client *http.Client) *IPAMVrfsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) WithData(data *models.WritableVRF) *IPAMVrfsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vrfs create params +func (o *IPAMVrfsCreateParams) SetData(data *models.WritableVRF) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsCreateParams) 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/ipam/ip_amvrfs_create_responses.go b/netbox/client/ipam/ip_amvrfs_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..69380e0d6690149aa79d70bf1013e16b8fe7a75b --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_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" +) + +// IPAMVrfsCreateReader is a Reader for the IPAMVrfsCreate structure. +type IPAMVrfsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewIPAMVrfsCreateCreated() + 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()) + } +} + +// NewIPAMVrfsCreateCreated creates a IPAMVrfsCreateCreated with default headers values +func NewIPAMVrfsCreateCreated() *IPAMVrfsCreateCreated { + return &IPAMVrfsCreateCreated{} +} + +/*IPAMVrfsCreateCreated handles this case with default header values. + +IPAMVrfsCreateCreated ipam vrfs create created +*/ +type IPAMVrfsCreateCreated struct { + Payload *models.WritableVRF +} + +func (o *IPAMVrfsCreateCreated) Error() string { + return fmt.Sprintf("[POST /ipam/vrfs/][%d] ipamVrfsCreateCreated %+v", 201, o.Payload) +} + +func (o *IPAMVrfsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVRF) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvrfs_delete_parameters.go b/netbox/client/ipam/ip_amvrfs_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e8af963c30f9527111541a97f2263629d746cbf0 --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_delete_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" +) + +// NewIPAMVrfsDeleteParams creates a new IPAMVrfsDeleteParams object +// with the default values initialized. +func NewIPAMVrfsDeleteParams() *IPAMVrfsDeleteParams { + var () + return &IPAMVrfsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsDeleteParamsWithTimeout creates a new IPAMVrfsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsDeleteParamsWithTimeout(timeout time.Duration) *IPAMVrfsDeleteParams { + var () + return &IPAMVrfsDeleteParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsDeleteParamsWithContext creates a new IPAMVrfsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsDeleteParamsWithContext(ctx context.Context) *IPAMVrfsDeleteParams { + var () + return &IPAMVrfsDeleteParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsDeleteParamsWithHTTPClient creates a new IPAMVrfsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsDeleteParamsWithHTTPClient(client *http.Client) *IPAMVrfsDeleteParams { + var () + return &IPAMVrfsDeleteParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsDeleteParams contains all the parameters to send to the API endpoint +for the ipam vrfs delete operation typically these are written to a http.Request +*/ +type IPAMVrfsDeleteParams struct { + + /*ID + A unique integer value identifying this VRF. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) WithTimeout(timeout time.Duration) *IPAMVrfsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) WithContext(ctx context.Context) *IPAMVrfsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) WithHTTPClient(client *http.Client) *IPAMVrfsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) WithID(id int64) *IPAMVrfsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vrfs delete params +func (o *IPAMVrfsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsDeleteParams) 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_amvrfs_delete_responses.go b/netbox/client/ipam/ip_amvrfs_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1cfe0c5cc8aaf24ed7acc531ecc10c11637a371b --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_delete_responses.go @@ -0,0 +1,56 @@ +// 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" + + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// IPAMVrfsDeleteReader is a Reader for the IPAMVrfsDelete structure. +type IPAMVrfsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewIPAMVrfsDeleteNoContent() + 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()) + } +} + +// NewIPAMVrfsDeleteNoContent creates a IPAMVrfsDeleteNoContent with default headers values +func NewIPAMVrfsDeleteNoContent() *IPAMVrfsDeleteNoContent { + return &IPAMVrfsDeleteNoContent{} +} + +/*IPAMVrfsDeleteNoContent handles this case with default header values. + +IPAMVrfsDeleteNoContent ipam vrfs delete no content +*/ +type IPAMVrfsDeleteNoContent struct { +} + +func (o *IPAMVrfsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /ipam/vrfs/{id}/][%d] ipamVrfsDeleteNoContent ", 204) +} + +func (o *IPAMVrfsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/ipam/ip_amvrfs_list_parameters.go b/netbox/client/ipam/ip_amvrfs_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..b7090fe232c64b983bef9b0027424610bd457924 --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_list_parameters.go @@ -0,0 +1,387 @@ +// 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" +) + +// NewIPAMVrfsListParams creates a new IPAMVrfsListParams object +// with the default values initialized. +func NewIPAMVrfsListParams() *IPAMVrfsListParams { + var () + return &IPAMVrfsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsListParamsWithTimeout creates a new IPAMVrfsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsListParamsWithTimeout(timeout time.Duration) *IPAMVrfsListParams { + var () + return &IPAMVrfsListParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsListParamsWithContext creates a new IPAMVrfsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsListParamsWithContext(ctx context.Context) *IPAMVrfsListParams { + var () + return &IPAMVrfsListParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsListParamsWithHTTPClient creates a new IPAMVrfsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsListParamsWithHTTPClient(client *http.Client) *IPAMVrfsListParams { + var () + return &IPAMVrfsListParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsListParams contains all the parameters to send to the API endpoint +for the ipam vrfs list operation typically these are written to a http.Request +*/ +type IPAMVrfsListParams struct { + + /*EnforceUnique*/ + EnforceUnique *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Rd*/ + Rd *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTimeout(timeout time.Duration) *IPAMVrfsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithContext(ctx context.Context) *IPAMVrfsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithHTTPClient(client *http.Client) *IPAMVrfsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnforceUnique adds the enforceUnique to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithEnforceUnique(enforceUnique *string) *IPAMVrfsListParams { + o.SetEnforceUnique(enforceUnique) + return o +} + +// SetEnforceUnique adds the enforceUnique to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetEnforceUnique(enforceUnique *string) { + o.EnforceUnique = enforceUnique +} + +// WithIDIn adds the iDIn to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithIDIn(iDIn *float64) *IPAMVrfsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithLimit(limit *int64) *IPAMVrfsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithName(name *string) *IPAMVrfsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithOffset(offset *int64) *IPAMVrfsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithQ(q *string) *IPAMVrfsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRd adds the rd to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithRd(rd *string) *IPAMVrfsListParams { + o.SetRd(rd) + return o +} + +// SetRd adds the rd to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetRd(rd *string) { + o.Rd = rd +} + +// WithTenant adds the tenant to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTenant(tenant *string) *IPAMVrfsListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the ipam vrfs list params +func (o *IPAMVrfsListParams) WithTenantID(tenantID *string) *IPAMVrfsListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the ipam vrfs list params +func (o *IPAMVrfsListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.EnforceUnique != nil { + + // query param enforce_unique + var qrEnforceUnique string + if o.EnforceUnique != nil { + qrEnforceUnique = *o.EnforceUnique + } + qEnforceUnique := qrEnforceUnique + if qEnforceUnique != "" { + if err := r.SetQueryParam("enforce_unique", qEnforceUnique); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Rd != nil { + + // query param rd + var qrRd string + if o.Rd != nil { + qrRd = *o.Rd + } + qRd := qrRd + if qRd != "" { + if err := r.SetQueryParam("rd", qRd); err != nil { + return err + } + } + + } + + if o.Tenant != nil { + + // query param tenant + var qrTenant string + if o.Tenant != nil { + qrTenant = *o.Tenant + } + qTenant := qrTenant + if qTenant != "" { + if err := r.SetQueryParam("tenant", qTenant); err != nil { + return err + } + } + + } + + if o.TenantID != nil { + + // query param tenant_id + var qrTenantID string + if o.TenantID != nil { + qrTenantID = *o.TenantID + } + qTenantID := qrTenantID + if qTenantID != "" { + if err := r.SetQueryParam("tenant_id", qTenantID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/ipam/ip_amvrfs_list_responses.go b/netbox/client/ipam/ip_amvrfs_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b58fc8cd386be62d62ddf55063fd40dd040670c4 --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_list_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" +) + +// IPAMVrfsListReader is a Reader for the IPAMVrfsList structure. +type IPAMVrfsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsListOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + + default: + return nil, runtime.NewAPIError("unknown error", response, response.Code()) + } +} + +// NewIPAMVrfsListOK creates a IPAMVrfsListOK with default headers values +func NewIPAMVrfsListOK() *IPAMVrfsListOK { + return &IPAMVrfsListOK{} +} + +/*IPAMVrfsListOK handles this case with default header values. + +IPAMVrfsListOK ipam vrfs list o k +*/ +type IPAMVrfsListOK struct { + Payload *models.IPAMVrfsListOKBody +} + +func (o *IPAMVrfsListOK) Error() string { + return fmt.Sprintf("[GET /ipam/vrfs/][%d] ipamVrfsListOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.IPAMVrfsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvrfs_partial_update_parameters.go b/netbox/client/ipam/ip_amvrfs_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9f253ff8db9cc15ec3c5eb46cf79890b74e3317f --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_partial_update_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" +) + +// NewIPAMVrfsPartialUpdateParams creates a new IPAMVrfsPartialUpdateParams object +// with the default values initialized. +func NewIPAMVrfsPartialUpdateParams() *IPAMVrfsPartialUpdateParams { + var () + return &IPAMVrfsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsPartialUpdateParamsWithTimeout creates a new IPAMVrfsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsPartialUpdateParamsWithTimeout(timeout time.Duration) *IPAMVrfsPartialUpdateParams { + var () + return &IPAMVrfsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsPartialUpdateParamsWithContext creates a new IPAMVrfsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsPartialUpdateParamsWithContext(ctx context.Context) *IPAMVrfsPartialUpdateParams { + var () + return &IPAMVrfsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsPartialUpdateParamsWithHTTPClient creates a new IPAMVrfsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsPartialUpdateParamsWithHTTPClient(client *http.Client) *IPAMVrfsPartialUpdateParams { + var () + return &IPAMVrfsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsPartialUpdateParams contains all the parameters to send to the API endpoint +for the ipam vrfs partial update operation typically these are written to a http.Request +*/ +type IPAMVrfsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVRF + /*ID + A unique integer value identifying this VRF. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithTimeout(timeout time.Duration) *IPAMVrfsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithContext(ctx context.Context) *IPAMVrfsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithHTTPClient(client *http.Client) *IPAMVrfsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithData(data *models.WritableVRF) *IPAMVrfsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetData(data *models.WritableVRF) { + o.Data = data +} + +// WithID adds the id to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) WithID(id int64) *IPAMVrfsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vrfs partial update params +func (o *IPAMVrfsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsPartialUpdateParams) 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_amvrfs_partial_update_responses.go b/netbox/client/ipam/ip_amvrfs_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..eeddcaaba317c3bd888b29924c82bbf39234b0be --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_partial_update_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" +) + +// IPAMVrfsPartialUpdateReader is a Reader for the IPAMVrfsPartialUpdate structure. +type IPAMVrfsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsPartialUpdateOK() + 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()) + } +} + +// NewIPAMVrfsPartialUpdateOK creates a IPAMVrfsPartialUpdateOK with default headers values +func NewIPAMVrfsPartialUpdateOK() *IPAMVrfsPartialUpdateOK { + return &IPAMVrfsPartialUpdateOK{} +} + +/*IPAMVrfsPartialUpdateOK handles this case with default header values. + +IPAMVrfsPartialUpdateOK ipam vrfs partial update o k +*/ +type IPAMVrfsPartialUpdateOK struct { + Payload *models.WritableVRF +} + +func (o *IPAMVrfsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /ipam/vrfs/{id}/][%d] ipamVrfsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVRF) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvrfs_read_parameters.go b/netbox/client/ipam/ip_amvrfs_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..39c5a74ba923bbfc677a39acd5bea52e0048e952 --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_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" +) + +// NewIPAMVrfsReadParams creates a new IPAMVrfsReadParams object +// with the default values initialized. +func NewIPAMVrfsReadParams() *IPAMVrfsReadParams { + var () + return &IPAMVrfsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsReadParamsWithTimeout creates a new IPAMVrfsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsReadParamsWithTimeout(timeout time.Duration) *IPAMVrfsReadParams { + var () + return &IPAMVrfsReadParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsReadParamsWithContext creates a new IPAMVrfsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsReadParamsWithContext(ctx context.Context) *IPAMVrfsReadParams { + var () + return &IPAMVrfsReadParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsReadParamsWithHTTPClient creates a new IPAMVrfsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsReadParamsWithHTTPClient(client *http.Client) *IPAMVrfsReadParams { + var () + return &IPAMVrfsReadParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsReadParams contains all the parameters to send to the API endpoint +for the ipam vrfs read operation typically these are written to a http.Request +*/ +type IPAMVrfsReadParams struct { + + /*ID + A unique integer value identifying this VRF. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs read params +func (o *IPAMVrfsReadParams) WithTimeout(timeout time.Duration) *IPAMVrfsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs read params +func (o *IPAMVrfsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs read params +func (o *IPAMVrfsReadParams) WithContext(ctx context.Context) *IPAMVrfsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs read params +func (o *IPAMVrfsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs read params +func (o *IPAMVrfsReadParams) WithHTTPClient(client *http.Client) *IPAMVrfsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs read params +func (o *IPAMVrfsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the ipam vrfs read params +func (o *IPAMVrfsReadParams) WithID(id int64) *IPAMVrfsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vrfs read params +func (o *IPAMVrfsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsReadParams) 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_amvrfs_read_responses.go b/netbox/client/ipam/ip_amvrfs_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..3d006b8caebd65f84ad31add335d3327b5b359a3 --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_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" +) + +// IPAMVrfsReadReader is a Reader for the IPAMVrfsRead structure. +type IPAMVrfsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsReadOK() + 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()) + } +} + +// NewIPAMVrfsReadOK creates a IPAMVrfsReadOK with default headers values +func NewIPAMVrfsReadOK() *IPAMVrfsReadOK { + return &IPAMVrfsReadOK{} +} + +/*IPAMVrfsReadOK handles this case with default header values. + +IPAMVrfsReadOK ipam vrfs read o k +*/ +type IPAMVrfsReadOK struct { + Payload *models.VRF +} + +func (o *IPAMVrfsReadOK) Error() string { + return fmt.Sprintf("[GET /ipam/vrfs/{id}/][%d] ipamVrfsReadOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VRF) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/ipam/ip_amvrfs_update_parameters.go b/netbox/client/ipam/ip_amvrfs_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a6c778c87917ddcac25410aca957cb6eb72f3e4d --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_update_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" +) + +// NewIPAMVrfsUpdateParams creates a new IPAMVrfsUpdateParams object +// with the default values initialized. +func NewIPAMVrfsUpdateParams() *IPAMVrfsUpdateParams { + var () + return &IPAMVrfsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewIPAMVrfsUpdateParamsWithTimeout creates a new IPAMVrfsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewIPAMVrfsUpdateParamsWithTimeout(timeout time.Duration) *IPAMVrfsUpdateParams { + var () + return &IPAMVrfsUpdateParams{ + + timeout: timeout, + } +} + +// NewIPAMVrfsUpdateParamsWithContext creates a new IPAMVrfsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewIPAMVrfsUpdateParamsWithContext(ctx context.Context) *IPAMVrfsUpdateParams { + var () + return &IPAMVrfsUpdateParams{ + + Context: ctx, + } +} + +// NewIPAMVrfsUpdateParamsWithHTTPClient creates a new IPAMVrfsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewIPAMVrfsUpdateParamsWithHTTPClient(client *http.Client) *IPAMVrfsUpdateParams { + var () + return &IPAMVrfsUpdateParams{ + HTTPClient: client, + } +} + +/*IPAMVrfsUpdateParams contains all the parameters to send to the API endpoint +for the ipam vrfs update operation typically these are written to a http.Request +*/ +type IPAMVrfsUpdateParams struct { + + /*Data*/ + Data *models.WritableVRF + /*ID + A unique integer value identifying this VRF. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithTimeout(timeout time.Duration) *IPAMVrfsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithContext(ctx context.Context) *IPAMVrfsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithHTTPClient(client *http.Client) *IPAMVrfsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithData(data *models.WritableVRF) *IPAMVrfsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetData(data *models.WritableVRF) { + o.Data = data +} + +// WithID adds the id to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) WithID(id int64) *IPAMVrfsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the ipam vrfs update params +func (o *IPAMVrfsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *IPAMVrfsUpdateParams) 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_amvrfs_update_responses.go b/netbox/client/ipam/ip_amvrfs_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..338ad1e697d02d7e6dd9470d47dd91c24739629f --- /dev/null +++ b/netbox/client/ipam/ip_amvrfs_update_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" +) + +// IPAMVrfsUpdateReader is a Reader for the IPAMVrfsUpdate structure. +type IPAMVrfsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *IPAMVrfsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewIPAMVrfsUpdateOK() + 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()) + } +} + +// NewIPAMVrfsUpdateOK creates a IPAMVrfsUpdateOK with default headers values +func NewIPAMVrfsUpdateOK() *IPAMVrfsUpdateOK { + return &IPAMVrfsUpdateOK{} +} + +/*IPAMVrfsUpdateOK handles this case with default header values. + +IPAMVrfsUpdateOK ipam vrfs update o k +*/ +type IPAMVrfsUpdateOK struct { + Payload *models.WritableVRF +} + +func (o *IPAMVrfsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /ipam/vrfs/{id}/][%d] ipamVrfsUpdateOK %+v", 200, o.Payload) +} + +func (o *IPAMVrfsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVRF) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/net_box_client.go b/netbox/client/net_box_client.go new file mode 100644 index 0000000000000000000000000000000000000000..ab5a392c0ea67638b1820fc1252fae9dbb921c4a --- /dev/null +++ b/netbox/client/net_box_client.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + + strfmt "github.com/go-openapi/strfmt" + + "github.com/davcamer/go-netbox/netbox/client/circuits" + "github.com/davcamer/go-netbox/netbox/client/dcim" + "github.com/davcamer/go-netbox/netbox/client/extras" + "github.com/davcamer/go-netbox/netbox/client/ipam" + "github.com/davcamer/go-netbox/netbox/client/secrets" + "github.com/davcamer/go-netbox/netbox/client/tenancy" + "github.com/davcamer/go-netbox/netbox/client/virtualization" +) + +// Default net box HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost:8000" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/api" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new net box HTTP client. +func NewHTTPClient(formats strfmt.Registry) *NetBox { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new net box HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *NetBox { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new net box client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *NetBox { + cli := new(NetBox) + cli.Transport = transport + + cli.Circuits = circuits.New(transport, formats) + + cli.Dcim = dcim.New(transport, formats) + + cli.Extras = extras.New(transport, formats) + + cli.IPAM = ipam.New(transport, formats) + + cli.Secrets = secrets.New(transport, formats) + + cli.Tenancy = tenancy.New(transport, formats) + + cli.Virtualization = virtualization.New(transport, formats) + + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// NetBox is a client for net box +type NetBox struct { + Circuits *circuits.Client + + Dcim *dcim.Client + + Extras *extras.Client + + IPAM *ipam.Client + + Secrets *secrets.Client + + Tenancy *tenancy.Client + + Virtualization *virtualization.Client + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *NetBox) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + + c.Circuits.SetTransport(transport) + + c.Dcim.SetTransport(transport) + + c.Extras.SetTransport(transport) + + c.IPAM.SetTransport(transport) + + c.Secrets.SetTransport(transport) + + c.Tenancy.SetTransport(transport) + + c.Virtualization.SetTransport(transport) + +} diff --git a/netbox/client/secrets/secrets_choices_list_parameters.go b/netbox/client/secrets/secrets_choices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6226ebaf48e236fc3bd2a5ccf9b0266cd4ed5f1d --- /dev/null +++ b/netbox/client/secrets/secrets_choices_list_parameters.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsChoicesListParams creates a new SecretsChoicesListParams object +// with the default values initialized. +func NewSecretsChoicesListParams() *SecretsChoicesListParams { + + return &SecretsChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsChoicesListParamsWithTimeout creates a new SecretsChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsChoicesListParamsWithTimeout(timeout time.Duration) *SecretsChoicesListParams { + + return &SecretsChoicesListParams{ + + timeout: timeout, + } +} + +// NewSecretsChoicesListParamsWithContext creates a new SecretsChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsChoicesListParamsWithContext(ctx context.Context) *SecretsChoicesListParams { + + return &SecretsChoicesListParams{ + + Context: ctx, + } +} + +// NewSecretsChoicesListParamsWithHTTPClient creates a new SecretsChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsChoicesListParamsWithHTTPClient(client *http.Client) *SecretsChoicesListParams { + + return &SecretsChoicesListParams{ + HTTPClient: client, + } +} + +/*SecretsChoicesListParams contains all the parameters to send to the API endpoint +for the secrets choices list operation typically these are written to a http.Request +*/ +type SecretsChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets choices list params +func (o *SecretsChoicesListParams) WithTimeout(timeout time.Duration) *SecretsChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets choices list params +func (o *SecretsChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets choices list params +func (o *SecretsChoicesListParams) WithContext(ctx context.Context) *SecretsChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets choices list params +func (o *SecretsChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets choices list params +func (o *SecretsChoicesListParams) WithHTTPClient(client *http.Client) *SecretsChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets choices list params +func (o *SecretsChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsChoicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/secrets/secrets_choices_list_responses.go b/netbox/client/secrets/secrets_choices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..86ccef3e6bdd7450e52813f3cb75cc9489f85d7c --- /dev/null +++ b/netbox/client/secrets/secrets_choices_list_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsChoicesListReader is a Reader for the SecretsChoicesList structure. +type SecretsChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsChoicesListOK() + 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()) + } +} + +// NewSecretsChoicesListOK creates a SecretsChoicesListOK with default headers values +func NewSecretsChoicesListOK() *SecretsChoicesListOK { + return &SecretsChoicesListOK{} +} + +/*SecretsChoicesListOK handles this case with default header values. + +SecretsChoicesListOK secrets choices list o k +*/ +type SecretsChoicesListOK struct { +} + +func (o *SecretsChoicesListOK) Error() string { + return fmt.Sprintf("[GET /secrets/_choices/][%d] secretsChoicesListOK ", 200) +} + +func (o *SecretsChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/secrets/secrets_choices_read_parameters.go b/netbox/client/secrets/secrets_choices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3f1dc169d6330dd910d00babe04da588a9f315ea --- /dev/null +++ b/netbox/client/secrets/secrets_choices_read_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsChoicesReadParams creates a new SecretsChoicesReadParams object +// with the default values initialized. +func NewSecretsChoicesReadParams() *SecretsChoicesReadParams { + var () + return &SecretsChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsChoicesReadParamsWithTimeout creates a new SecretsChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsChoicesReadParamsWithTimeout(timeout time.Duration) *SecretsChoicesReadParams { + var () + return &SecretsChoicesReadParams{ + + timeout: timeout, + } +} + +// NewSecretsChoicesReadParamsWithContext creates a new SecretsChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsChoicesReadParamsWithContext(ctx context.Context) *SecretsChoicesReadParams { + var () + return &SecretsChoicesReadParams{ + + Context: ctx, + } +} + +// NewSecretsChoicesReadParamsWithHTTPClient creates a new SecretsChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsChoicesReadParamsWithHTTPClient(client *http.Client) *SecretsChoicesReadParams { + var () + return &SecretsChoicesReadParams{ + HTTPClient: client, + } +} + +/*SecretsChoicesReadParams contains all the parameters to send to the API endpoint +for the secrets choices read operation typically these are written to a http.Request +*/ +type SecretsChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets choices read params +func (o *SecretsChoicesReadParams) WithTimeout(timeout time.Duration) *SecretsChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets choices read params +func (o *SecretsChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets choices read params +func (o *SecretsChoicesReadParams) WithContext(ctx context.Context) *SecretsChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets choices read params +func (o *SecretsChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets choices read params +func (o *SecretsChoicesReadParams) WithHTTPClient(client *http.Client) *SecretsChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets choices read params +func (o *SecretsChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets choices read params +func (o *SecretsChoicesReadParams) WithID(id string) *SecretsChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets choices read params +func (o *SecretsChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsChoicesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/secrets/secrets_choices_read_responses.go b/netbox/client/secrets/secrets_choices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..20c743437954398def5b5cde739ddbef0cdae48b --- /dev/null +++ b/netbox/client/secrets/secrets_choices_read_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsChoicesReadReader is a Reader for the SecretsChoicesRead structure. +type SecretsChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsChoicesReadOK() + 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()) + } +} + +// NewSecretsChoicesReadOK creates a SecretsChoicesReadOK with default headers values +func NewSecretsChoicesReadOK() *SecretsChoicesReadOK { + return &SecretsChoicesReadOK{} +} + +/*SecretsChoicesReadOK handles this case with default header values. + +SecretsChoicesReadOK secrets choices read o k +*/ +type SecretsChoicesReadOK struct { +} + +func (o *SecretsChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /secrets/_choices/{id}/][%d] secretsChoicesReadOK ", 200) +} + +func (o *SecretsChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/secrets/secrets_client.go b/netbox/client/secrets/secrets_client.go new file mode 100644 index 0000000000000000000000000000000000000000..6d733a94b39c3c960060fd09390ce8531597d92d --- /dev/null +++ b/netbox/client/secrets/secrets_client.go @@ -0,0 +1,512 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new secrets API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for secrets API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +SecretsChoicesList secrets choices list API +*/ +func (a *Client) SecretsChoicesList(params *SecretsChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets__choices_list", + Method: "GET", + PathPattern: "/secrets/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsChoicesListOK), nil + +} + +/* +SecretsChoicesRead secrets choices read API +*/ +func (a *Client) SecretsChoicesRead(params *SecretsChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets__choices_read", + Method: "GET", + PathPattern: "/secrets/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsChoicesReadOK), nil + +} + +/* +SecretsGenerateRsaKeyPairList This endpoint can be used to generate a new RSA key pair. The keys are returned in PEM format. + + { + "public_key": "<public key>", + "private_key": "<private key>" + } +*/ +func (a *Client) SecretsGenerateRsaKeyPairList(params *SecretsGenerateRsaKeyPairListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsGenerateRsaKeyPairListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsGenerateRsaKeyPairListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_generate-rsa-key-pair_list", + Method: "GET", + PathPattern: "/secrets/generate-rsa-key-pair/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsGenerateRsaKeyPairListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsGenerateRsaKeyPairListOK), nil + +} + +/* +SecretsGetSessionKeyCreate Retrieve a temporary session key to use for encrypting and decrypting secrets via the API. The user's private RSA +key is POSTed with the name `private_key`. An example: + + curl -v -X POST -H "Authorization: Token <token>" -H "Accept: application/json; indent=4" \ + --data-urlencode "private_key@<filename>" https://netbox/api/secrets/get-session-key/ + +This request will yield a base64-encoded session key to be included in an `X-Session-Key` header in future requests: + + { + "session_key": "+8t4SI6XikgVmB5+/urhozx9O5qCQANyOk1MNe6taRf=" + } + +This endpoint accepts one optional parameter: `preserve_key`. If True and a session key exists, the existing session +key will be returned instead of a new one. +*/ +func (a *Client) SecretsGetSessionKeyCreate(params *SecretsGetSessionKeyCreateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsGetSessionKeyCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsGetSessionKeyCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_get-session-key_create", + Method: "POST", + PathPattern: "/secrets/get-session-key/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsGetSessionKeyCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsGetSessionKeyCreateCreated), nil + +} + +/* +SecretsSecretRolesCreate secrets secret roles create API +*/ +func (a *Client) SecretsSecretRolesCreate(params *SecretsSecretRolesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_create", + Method: "POST", + PathPattern: "/secrets/secret-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesCreateCreated), nil + +} + +/* +SecretsSecretRolesDelete secrets secret roles delete API +*/ +func (a *Client) SecretsSecretRolesDelete(params *SecretsSecretRolesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_delete", + Method: "DELETE", + PathPattern: "/secrets/secret-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesDeleteNoContent), nil + +} + +/* +SecretsSecretRolesList secrets secret roles list API +*/ +func (a *Client) SecretsSecretRolesList(params *SecretsSecretRolesListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_list", + Method: "GET", + PathPattern: "/secrets/secret-roles/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesListOK), nil + +} + +/* +SecretsSecretRolesPartialUpdate secrets secret roles partial update API +*/ +func (a *Client) SecretsSecretRolesPartialUpdate(params *SecretsSecretRolesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_partial_update", + Method: "PATCH", + PathPattern: "/secrets/secret-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesPartialUpdateOK), nil + +} + +/* +SecretsSecretRolesRead secrets secret roles read API +*/ +func (a *Client) SecretsSecretRolesRead(params *SecretsSecretRolesReadParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_read", + Method: "GET", + PathPattern: "/secrets/secret-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesReadOK), nil + +} + +/* +SecretsSecretRolesUpdate secrets secret roles update API +*/ +func (a *Client) SecretsSecretRolesUpdate(params *SecretsSecretRolesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretRolesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretRolesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secret-roles_update", + Method: "PUT", + PathPattern: "/secrets/secret-roles/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretRolesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretRolesUpdateOK), nil + +} + +/* +SecretsSecretsCreate secrets secrets create API +*/ +func (a *Client) SecretsSecretsCreate(params *SecretsSecretsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_create", + Method: "POST", + PathPattern: "/secrets/secrets/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsCreateCreated), nil + +} + +/* +SecretsSecretsDelete secrets secrets delete API +*/ +func (a *Client) SecretsSecretsDelete(params *SecretsSecretsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_delete", + Method: "DELETE", + PathPattern: "/secrets/secrets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsDeleteNoContent), nil + +} + +/* +SecretsSecretsList secrets secrets list API +*/ +func (a *Client) SecretsSecretsList(params *SecretsSecretsListParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_list", + Method: "GET", + PathPattern: "/secrets/secrets/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsListOK), nil + +} + +/* +SecretsSecretsPartialUpdate secrets secrets partial update API +*/ +func (a *Client) SecretsSecretsPartialUpdate(params *SecretsSecretsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_partial_update", + Method: "PATCH", + PathPattern: "/secrets/secrets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsPartialUpdateOK), nil + +} + +/* +SecretsSecretsRead secrets secrets read API +*/ +func (a *Client) SecretsSecretsRead(params *SecretsSecretsReadParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_read", + Method: "GET", + PathPattern: "/secrets/secrets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsReadOK), nil + +} + +/* +SecretsSecretsUpdate secrets secrets update API +*/ +func (a *Client) SecretsSecretsUpdate(params *SecretsSecretsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*SecretsSecretsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewSecretsSecretsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "secrets_secrets_update", + Method: "PUT", + PathPattern: "/secrets/secrets/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &SecretsSecretsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*SecretsSecretsUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go b/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..dd4023000a17cedb50b0dabd0aa6acef37f18f8e --- /dev/null +++ b/netbox/client/secrets/secrets_generate_rsa_key_pair_list_parameters.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsGenerateRsaKeyPairListParams creates a new SecretsGenerateRsaKeyPairListParams object +// with the default values initialized. +func NewSecretsGenerateRsaKeyPairListParams() *SecretsGenerateRsaKeyPairListParams { + + return &SecretsGenerateRsaKeyPairListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsGenerateRsaKeyPairListParamsWithTimeout creates a new SecretsGenerateRsaKeyPairListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsGenerateRsaKeyPairListParamsWithTimeout(timeout time.Duration) *SecretsGenerateRsaKeyPairListParams { + + return &SecretsGenerateRsaKeyPairListParams{ + + timeout: timeout, + } +} + +// NewSecretsGenerateRsaKeyPairListParamsWithContext creates a new SecretsGenerateRsaKeyPairListParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsGenerateRsaKeyPairListParamsWithContext(ctx context.Context) *SecretsGenerateRsaKeyPairListParams { + + return &SecretsGenerateRsaKeyPairListParams{ + + Context: ctx, + } +} + +// NewSecretsGenerateRsaKeyPairListParamsWithHTTPClient creates a new SecretsGenerateRsaKeyPairListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsGenerateRsaKeyPairListParamsWithHTTPClient(client *http.Client) *SecretsGenerateRsaKeyPairListParams { + + return &SecretsGenerateRsaKeyPairListParams{ + HTTPClient: client, + } +} + +/*SecretsGenerateRsaKeyPairListParams contains all the parameters to send to the API endpoint +for the secrets generate rsa key pair list operation typically these are written to a http.Request +*/ +type SecretsGenerateRsaKeyPairListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) WithTimeout(timeout time.Duration) *SecretsGenerateRsaKeyPairListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) WithContext(ctx context.Context) *SecretsGenerateRsaKeyPairListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) WithHTTPClient(client *http.Client) *SecretsGenerateRsaKeyPairListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets generate rsa key pair list params +func (o *SecretsGenerateRsaKeyPairListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsGenerateRsaKeyPairListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/secrets/secrets_generate_rsa_key_pair_list_responses.go b/netbox/client/secrets/secrets_generate_rsa_key_pair_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b90da65d900cdbb12f9c012904a69c090ebcf916 --- /dev/null +++ b/netbox/client/secrets/secrets_generate_rsa_key_pair_list_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsGenerateRsaKeyPairListReader is a Reader for the SecretsGenerateRsaKeyPairList structure. +type SecretsGenerateRsaKeyPairListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsGenerateRsaKeyPairListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsGenerateRsaKeyPairListOK() + 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()) + } +} + +// NewSecretsGenerateRsaKeyPairListOK creates a SecretsGenerateRsaKeyPairListOK with default headers values +func NewSecretsGenerateRsaKeyPairListOK() *SecretsGenerateRsaKeyPairListOK { + return &SecretsGenerateRsaKeyPairListOK{} +} + +/*SecretsGenerateRsaKeyPairListOK handles this case with default header values. + +SecretsGenerateRsaKeyPairListOK secrets generate rsa key pair list o k +*/ +type SecretsGenerateRsaKeyPairListOK struct { +} + +func (o *SecretsGenerateRsaKeyPairListOK) Error() string { + return fmt.Sprintf("[GET /secrets/generate-rsa-key-pair/][%d] secretsGenerateRsaKeyPairListOK ", 200) +} + +func (o *SecretsGenerateRsaKeyPairListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/secrets/secrets_get_session_key_create_parameters.go b/netbox/client/secrets/secrets_get_session_key_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..74fa17c375ec985a8a995e856355a9a9137d9d33 --- /dev/null +++ b/netbox/client/secrets/secrets_get_session_key_create_parameters.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsGetSessionKeyCreateParams creates a new SecretsGetSessionKeyCreateParams object +// with the default values initialized. +func NewSecretsGetSessionKeyCreateParams() *SecretsGetSessionKeyCreateParams { + + return &SecretsGetSessionKeyCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsGetSessionKeyCreateParamsWithTimeout creates a new SecretsGetSessionKeyCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsGetSessionKeyCreateParamsWithTimeout(timeout time.Duration) *SecretsGetSessionKeyCreateParams { + + return &SecretsGetSessionKeyCreateParams{ + + timeout: timeout, + } +} + +// NewSecretsGetSessionKeyCreateParamsWithContext creates a new SecretsGetSessionKeyCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsGetSessionKeyCreateParamsWithContext(ctx context.Context) *SecretsGetSessionKeyCreateParams { + + return &SecretsGetSessionKeyCreateParams{ + + Context: ctx, + } +} + +// NewSecretsGetSessionKeyCreateParamsWithHTTPClient creates a new SecretsGetSessionKeyCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsGetSessionKeyCreateParamsWithHTTPClient(client *http.Client) *SecretsGetSessionKeyCreateParams { + + return &SecretsGetSessionKeyCreateParams{ + HTTPClient: client, + } +} + +/*SecretsGetSessionKeyCreateParams contains all the parameters to send to the API endpoint +for the secrets get session key create operation typically these are written to a http.Request +*/ +type SecretsGetSessionKeyCreateParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) WithTimeout(timeout time.Duration) *SecretsGetSessionKeyCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) WithContext(ctx context.Context) *SecretsGetSessionKeyCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) WithHTTPClient(client *http.Client) *SecretsGetSessionKeyCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets get session key create params +func (o *SecretsGetSessionKeyCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsGetSessionKeyCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/secrets/secrets_get_session_key_create_responses.go b/netbox/client/secrets/secrets_get_session_key_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..1d2707c796cc01a448a33456713fc745076cc854 --- /dev/null +++ b/netbox/client/secrets/secrets_get_session_key_create_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsGetSessionKeyCreateReader is a Reader for the SecretsGetSessionKeyCreate structure. +type SecretsGetSessionKeyCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsGetSessionKeyCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewSecretsGetSessionKeyCreateCreated() + 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()) + } +} + +// NewSecretsGetSessionKeyCreateCreated creates a SecretsGetSessionKeyCreateCreated with default headers values +func NewSecretsGetSessionKeyCreateCreated() *SecretsGetSessionKeyCreateCreated { + return &SecretsGetSessionKeyCreateCreated{} +} + +/*SecretsGetSessionKeyCreateCreated handles this case with default header values. + +SecretsGetSessionKeyCreateCreated secrets get session key create created +*/ +type SecretsGetSessionKeyCreateCreated struct { +} + +func (o *SecretsGetSessionKeyCreateCreated) Error() string { + return fmt.Sprintf("[POST /secrets/get-session-key/][%d] secretsGetSessionKeyCreateCreated ", 201) +} + +func (o *SecretsGetSessionKeyCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/secrets/secrets_secret_roles_create_parameters.go b/netbox/client/secrets/secrets_secret_roles_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c879c055e50e5774cb66fcc6da9353191d68aaa0 --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretRolesCreateParams creates a new SecretsSecretRolesCreateParams object +// with the default values initialized. +func NewSecretsSecretRolesCreateParams() *SecretsSecretRolesCreateParams { + var () + return &SecretsSecretRolesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesCreateParamsWithTimeout creates a new SecretsSecretRolesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesCreateParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesCreateParams { + var () + return &SecretsSecretRolesCreateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesCreateParamsWithContext creates a new SecretsSecretRolesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesCreateParamsWithContext(ctx context.Context) *SecretsSecretRolesCreateParams { + var () + return &SecretsSecretRolesCreateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesCreateParamsWithHTTPClient creates a new SecretsSecretRolesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesCreateParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesCreateParams { + var () + return &SecretsSecretRolesCreateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesCreateParams contains all the parameters to send to the API endpoint +for the secrets secret roles create operation typically these are written to a http.Request +*/ +type SecretsSecretRolesCreateParams struct { + + /*Data*/ + Data *models.SecretRole + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) WithContext(ctx context.Context) *SecretsSecretRolesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) WithData(data *models.SecretRole) *SecretsSecretRolesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secret roles create params +func (o *SecretsSecretRolesCreateParams) SetData(data *models.SecretRole) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesCreateParams) 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/secrets/secrets_secret_roles_create_responses.go b/netbox/client/secrets/secrets_secret_roles_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9df8940251bf9250456ee37764607dbee0112cf5 --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretRolesCreateReader is a Reader for the SecretsSecretRolesCreate structure. +type SecretsSecretRolesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewSecretsSecretRolesCreateCreated() + 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()) + } +} + +// NewSecretsSecretRolesCreateCreated creates a SecretsSecretRolesCreateCreated with default headers values +func NewSecretsSecretRolesCreateCreated() *SecretsSecretRolesCreateCreated { + return &SecretsSecretRolesCreateCreated{} +} + +/*SecretsSecretRolesCreateCreated handles this case with default header values. + +SecretsSecretRolesCreateCreated secrets secret roles create created +*/ +type SecretsSecretRolesCreateCreated struct { + Payload *models.SecretRole +} + +func (o *SecretsSecretRolesCreateCreated) Error() string { + return fmt.Sprintf("[POST /secrets/secret-roles/][%d] secretsSecretRolesCreateCreated %+v", 201, o.Payload) +} + +func (o *SecretsSecretRolesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secret_roles_delete_parameters.go b/netbox/client/secrets/secrets_secret_roles_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..354a801d5f604312a1bcf187ea40aaeee8703bfc --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretRolesDeleteParams creates a new SecretsSecretRolesDeleteParams object +// with the default values initialized. +func NewSecretsSecretRolesDeleteParams() *SecretsSecretRolesDeleteParams { + var () + return &SecretsSecretRolesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesDeleteParamsWithTimeout creates a new SecretsSecretRolesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesDeleteParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesDeleteParams { + var () + return &SecretsSecretRolesDeleteParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesDeleteParamsWithContext creates a new SecretsSecretRolesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesDeleteParamsWithContext(ctx context.Context) *SecretsSecretRolesDeleteParams { + var () + return &SecretsSecretRolesDeleteParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesDeleteParamsWithHTTPClient creates a new SecretsSecretRolesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesDeleteParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesDeleteParams { + var () + return &SecretsSecretRolesDeleteParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesDeleteParams contains all the parameters to send to the API endpoint +for the secrets secret roles delete operation typically these are written to a http.Request +*/ +type SecretsSecretRolesDeleteParams struct { + + /*ID + A unique integer value identifying this secret role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) WithContext(ctx context.Context) *SecretsSecretRolesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) WithID(id int64) *SecretsSecretRolesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles delete params +func (o *SecretsSecretRolesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesDeleteParams) 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/secrets/secrets_secret_roles_delete_responses.go b/netbox/client/secrets/secrets_secret_roles_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..320197c377a86e687e860ce22208ab6a7bc7a2de --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretRolesDeleteReader is a Reader for the SecretsSecretRolesDelete structure. +type SecretsSecretRolesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewSecretsSecretRolesDeleteNoContent() + 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()) + } +} + +// NewSecretsSecretRolesDeleteNoContent creates a SecretsSecretRolesDeleteNoContent with default headers values +func NewSecretsSecretRolesDeleteNoContent() *SecretsSecretRolesDeleteNoContent { + return &SecretsSecretRolesDeleteNoContent{} +} + +/*SecretsSecretRolesDeleteNoContent handles this case with default header values. + +SecretsSecretRolesDeleteNoContent secrets secret roles delete no content +*/ +type SecretsSecretRolesDeleteNoContent struct { +} + +func (o *SecretsSecretRolesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /secrets/secret-roles/{id}/][%d] secretsSecretRolesDeleteNoContent ", 204) +} + +func (o *SecretsSecretRolesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/secrets/secrets_secret_roles_list_parameters.go b/netbox/client/secrets/secrets_secret_roles_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..845ceaa35141c86ea671a82cd6d4adc31f9f8a6d --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_list_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretRolesListParams creates a new SecretsSecretRolesListParams object +// with the default values initialized. +func NewSecretsSecretRolesListParams() *SecretsSecretRolesListParams { + var () + return &SecretsSecretRolesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesListParamsWithTimeout creates a new SecretsSecretRolesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesListParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesListParams { + var () + return &SecretsSecretRolesListParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesListParamsWithContext creates a new SecretsSecretRolesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesListParamsWithContext(ctx context.Context) *SecretsSecretRolesListParams { + var () + return &SecretsSecretRolesListParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesListParamsWithHTTPClient creates a new SecretsSecretRolesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesListParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesListParams { + var () + return &SecretsSecretRolesListParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesListParams contains all the parameters to send to the API endpoint +for the secrets secret roles list operation typically these are written to a http.Request +*/ +type SecretsSecretRolesListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithContext(ctx context.Context) *SecretsSecretRolesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithLimit(limit *int64) *SecretsSecretRolesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithName(name *string) *SecretsSecretRolesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithOffset(offset *int64) *SecretsSecretRolesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) WithSlug(slug *string) *SecretsSecretRolesListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the secrets secret roles list params +func (o *SecretsSecretRolesListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/secrets/secrets_secret_roles_list_responses.go b/netbox/client/secrets/secrets_secret_roles_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5b73cbd6e63f1dca71cde9fb620f029bc903e7dd --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretRolesListReader is a Reader for the SecretsSecretRolesList structure. +type SecretsSecretRolesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretRolesListOK() + 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()) + } +} + +// NewSecretsSecretRolesListOK creates a SecretsSecretRolesListOK with default headers values +func NewSecretsSecretRolesListOK() *SecretsSecretRolesListOK { + return &SecretsSecretRolesListOK{} +} + +/*SecretsSecretRolesListOK handles this case with default header values. + +SecretsSecretRolesListOK secrets secret roles list o k +*/ +type SecretsSecretRolesListOK struct { + Payload *models.SecretsSecretRolesListOKBody +} + +func (o *SecretsSecretRolesListOK) Error() string { + return fmt.Sprintf("[GET /secrets/secret-roles/][%d] secretsSecretRolesListOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretRolesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretsSecretRolesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go b/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..88375341c2d81a5c0971d17434dfc04c3e2d15be --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretRolesPartialUpdateParams creates a new SecretsSecretRolesPartialUpdateParams object +// with the default values initialized. +func NewSecretsSecretRolesPartialUpdateParams() *SecretsSecretRolesPartialUpdateParams { + var () + return &SecretsSecretRolesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesPartialUpdateParamsWithTimeout creates a new SecretsSecretRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesPartialUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesPartialUpdateParams { + var () + return &SecretsSecretRolesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesPartialUpdateParamsWithContext creates a new SecretsSecretRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesPartialUpdateParamsWithContext(ctx context.Context) *SecretsSecretRolesPartialUpdateParams { + var () + return &SecretsSecretRolesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesPartialUpdateParamsWithHTTPClient creates a new SecretsSecretRolesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesPartialUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesPartialUpdateParams { + var () + return &SecretsSecretRolesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesPartialUpdateParams contains all the parameters to send to the API endpoint +for the secrets secret roles partial update operation typically these are written to a http.Request +*/ +type SecretsSecretRolesPartialUpdateParams struct { + + /*Data*/ + Data *models.SecretRole + /*ID + A unique integer value identifying this secret role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithContext(ctx context.Context) *SecretsSecretRolesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithData(data *models.SecretRole) *SecretsSecretRolesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetData(data *models.SecretRole) { + o.Data = data +} + +// WithID adds the id to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) WithID(id int64) *SecretsSecretRolesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles partial update params +func (o *SecretsSecretRolesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesPartialUpdateParams) 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/secrets/secrets_secret_roles_partial_update_responses.go b/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4a85694a8326b57cd5698aa935659c8d40f8e37d --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretRolesPartialUpdateReader is a Reader for the SecretsSecretRolesPartialUpdate structure. +type SecretsSecretRolesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretRolesPartialUpdateOK() + 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()) + } +} + +// NewSecretsSecretRolesPartialUpdateOK creates a SecretsSecretRolesPartialUpdateOK with default headers values +func NewSecretsSecretRolesPartialUpdateOK() *SecretsSecretRolesPartialUpdateOK { + return &SecretsSecretRolesPartialUpdateOK{} +} + +/*SecretsSecretRolesPartialUpdateOK handles this case with default header values. + +SecretsSecretRolesPartialUpdateOK secrets secret roles partial update o k +*/ +type SecretsSecretRolesPartialUpdateOK struct { + Payload *models.SecretRole +} + +func (o *SecretsSecretRolesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /secrets/secret-roles/{id}/][%d] secretsSecretRolesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretRolesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secret_roles_read_parameters.go b/netbox/client/secrets/secrets_secret_roles_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..93cd2101f97e7eed8c6bb5e5665ca9b7098af400 --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretRolesReadParams creates a new SecretsSecretRolesReadParams object +// with the default values initialized. +func NewSecretsSecretRolesReadParams() *SecretsSecretRolesReadParams { + var () + return &SecretsSecretRolesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesReadParamsWithTimeout creates a new SecretsSecretRolesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesReadParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesReadParams { + var () + return &SecretsSecretRolesReadParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesReadParamsWithContext creates a new SecretsSecretRolesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesReadParamsWithContext(ctx context.Context) *SecretsSecretRolesReadParams { + var () + return &SecretsSecretRolesReadParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesReadParamsWithHTTPClient creates a new SecretsSecretRolesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesReadParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesReadParams { + var () + return &SecretsSecretRolesReadParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesReadParams contains all the parameters to send to the API endpoint +for the secrets secret roles read operation typically these are written to a http.Request +*/ +type SecretsSecretRolesReadParams struct { + + /*ID + A unique integer value identifying this secret role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) WithContext(ctx context.Context) *SecretsSecretRolesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) WithID(id int64) *SecretsSecretRolesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles read params +func (o *SecretsSecretRolesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesReadParams) 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/secrets/secrets_secret_roles_read_responses.go b/netbox/client/secrets/secrets_secret_roles_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..cc81a7e37078574d8093d5378412fa432ce01539 --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretRolesReadReader is a Reader for the SecretsSecretRolesRead structure. +type SecretsSecretRolesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretRolesReadOK() + 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()) + } +} + +// NewSecretsSecretRolesReadOK creates a SecretsSecretRolesReadOK with default headers values +func NewSecretsSecretRolesReadOK() *SecretsSecretRolesReadOK { + return &SecretsSecretRolesReadOK{} +} + +/*SecretsSecretRolesReadOK handles this case with default header values. + +SecretsSecretRolesReadOK secrets secret roles read o k +*/ +type SecretsSecretRolesReadOK struct { + Payload *models.SecretRole +} + +func (o *SecretsSecretRolesReadOK) Error() string { + return fmt.Sprintf("[GET /secrets/secret-roles/{id}/][%d] secretsSecretRolesReadOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretRolesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secret_roles_update_parameters.go b/netbox/client/secrets/secrets_secret_roles_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..854362da121226d10ddd30616b39371d6110a76b --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretRolesUpdateParams creates a new SecretsSecretRolesUpdateParams object +// with the default values initialized. +func NewSecretsSecretRolesUpdateParams() *SecretsSecretRolesUpdateParams { + var () + return &SecretsSecretRolesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretRolesUpdateParamsWithTimeout creates a new SecretsSecretRolesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretRolesUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretRolesUpdateParams { + var () + return &SecretsSecretRolesUpdateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretRolesUpdateParamsWithContext creates a new SecretsSecretRolesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretRolesUpdateParamsWithContext(ctx context.Context) *SecretsSecretRolesUpdateParams { + var () + return &SecretsSecretRolesUpdateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretRolesUpdateParamsWithHTTPClient creates a new SecretsSecretRolesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretRolesUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretRolesUpdateParams { + var () + return &SecretsSecretRolesUpdateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretRolesUpdateParams contains all the parameters to send to the API endpoint +for the secrets secret roles update operation typically these are written to a http.Request +*/ +type SecretsSecretRolesUpdateParams struct { + + /*Data*/ + Data *models.SecretRole + /*ID + A unique integer value identifying this secret role. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretRolesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithContext(ctx context.Context) *SecretsSecretRolesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretRolesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithData(data *models.SecretRole) *SecretsSecretRolesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetData(data *models.SecretRole) { + o.Data = data +} + +// WithID adds the id to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) WithID(id int64) *SecretsSecretRolesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secret roles update params +func (o *SecretsSecretRolesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretRolesUpdateParams) 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/secrets/secrets_secret_roles_update_responses.go b/netbox/client/secrets/secrets_secret_roles_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c6ef6d11af328c61fb92c0ba39686e7600a680db --- /dev/null +++ b/netbox/client/secrets/secrets_secret_roles_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretRolesUpdateReader is a Reader for the SecretsSecretRolesUpdate structure. +type SecretsSecretRolesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretRolesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretRolesUpdateOK() + 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()) + } +} + +// NewSecretsSecretRolesUpdateOK creates a SecretsSecretRolesUpdateOK with default headers values +func NewSecretsSecretRolesUpdateOK() *SecretsSecretRolesUpdateOK { + return &SecretsSecretRolesUpdateOK{} +} + +/*SecretsSecretRolesUpdateOK handles this case with default header values. + +SecretsSecretRolesUpdateOK secrets secret roles update o k +*/ +type SecretsSecretRolesUpdateOK struct { + Payload *models.SecretRole +} + +func (o *SecretsSecretRolesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /secrets/secret-roles/{id}/][%d] secretsSecretRolesUpdateOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretRolesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretRole) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secrets_create_parameters.go b/netbox/client/secrets/secrets_secrets_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d126d831902a95131e78369f2d48520bcecb5b81 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretsCreateParams creates a new SecretsSecretsCreateParams object +// with the default values initialized. +func NewSecretsSecretsCreateParams() *SecretsSecretsCreateParams { + var () + return &SecretsSecretsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsCreateParamsWithTimeout creates a new SecretsSecretsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsCreateParamsWithTimeout(timeout time.Duration) *SecretsSecretsCreateParams { + var () + return &SecretsSecretsCreateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsCreateParamsWithContext creates a new SecretsSecretsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsCreateParamsWithContext(ctx context.Context) *SecretsSecretsCreateParams { + var () + return &SecretsSecretsCreateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsCreateParamsWithHTTPClient creates a new SecretsSecretsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsCreateParamsWithHTTPClient(client *http.Client) *SecretsSecretsCreateParams { + var () + return &SecretsSecretsCreateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsCreateParams contains all the parameters to send to the API endpoint +for the secrets secrets create operation typically these are written to a http.Request +*/ +type SecretsSecretsCreateParams struct { + + /*Data*/ + Data *models.WritableSecret + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets create params +func (o *SecretsSecretsCreateParams) WithTimeout(timeout time.Duration) *SecretsSecretsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets create params +func (o *SecretsSecretsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets create params +func (o *SecretsSecretsCreateParams) WithContext(ctx context.Context) *SecretsSecretsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets create params +func (o *SecretsSecretsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets create params +func (o *SecretsSecretsCreateParams) WithHTTPClient(client *http.Client) *SecretsSecretsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets create params +func (o *SecretsSecretsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secrets create params +func (o *SecretsSecretsCreateParams) WithData(data *models.WritableSecret) *SecretsSecretsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secrets create params +func (o *SecretsSecretsCreateParams) SetData(data *models.WritableSecret) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsCreateParams) 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/secrets/secrets_secrets_create_responses.go b/netbox/client/secrets/secrets_secrets_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..66484fcf23be2a06463b9001b767c77befacc7c7 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretsCreateReader is a Reader for the SecretsSecretsCreate structure. +type SecretsSecretsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewSecretsSecretsCreateCreated() + 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()) + } +} + +// NewSecretsSecretsCreateCreated creates a SecretsSecretsCreateCreated with default headers values +func NewSecretsSecretsCreateCreated() *SecretsSecretsCreateCreated { + return &SecretsSecretsCreateCreated{} +} + +/*SecretsSecretsCreateCreated handles this case with default header values. + +SecretsSecretsCreateCreated secrets secrets create created +*/ +type SecretsSecretsCreateCreated struct { + Payload *models.WritableSecret +} + +func (o *SecretsSecretsCreateCreated) Error() string { + return fmt.Sprintf("[POST /secrets/secrets/][%d] secretsSecretsCreateCreated %+v", 201, o.Payload) +} + +func (o *SecretsSecretsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSecret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secrets_delete_parameters.go b/netbox/client/secrets/secrets_secrets_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..82ff5fed6211d85c69ddce92b17df6a7bab4f834 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretsDeleteParams creates a new SecretsSecretsDeleteParams object +// with the default values initialized. +func NewSecretsSecretsDeleteParams() *SecretsSecretsDeleteParams { + var () + return &SecretsSecretsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsDeleteParamsWithTimeout creates a new SecretsSecretsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsDeleteParamsWithTimeout(timeout time.Duration) *SecretsSecretsDeleteParams { + var () + return &SecretsSecretsDeleteParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsDeleteParamsWithContext creates a new SecretsSecretsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsDeleteParamsWithContext(ctx context.Context) *SecretsSecretsDeleteParams { + var () + return &SecretsSecretsDeleteParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsDeleteParamsWithHTTPClient creates a new SecretsSecretsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsDeleteParamsWithHTTPClient(client *http.Client) *SecretsSecretsDeleteParams { + var () + return &SecretsSecretsDeleteParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsDeleteParams contains all the parameters to send to the API endpoint +for the secrets secrets delete operation typically these are written to a http.Request +*/ +type SecretsSecretsDeleteParams struct { + + /*ID + A unique integer value identifying this secret. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) WithTimeout(timeout time.Duration) *SecretsSecretsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) WithContext(ctx context.Context) *SecretsSecretsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) WithHTTPClient(client *http.Client) *SecretsSecretsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) WithID(id int64) *SecretsSecretsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secrets delete params +func (o *SecretsSecretsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsDeleteParams) 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/secrets/secrets_secrets_delete_responses.go b/netbox/client/secrets/secrets_secrets_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bb1ed934e7d4c48f8d3bb8cb36d36d1fc8aa273a --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretsDeleteReader is a Reader for the SecretsSecretsDelete structure. +type SecretsSecretsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewSecretsSecretsDeleteNoContent() + 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()) + } +} + +// NewSecretsSecretsDeleteNoContent creates a SecretsSecretsDeleteNoContent with default headers values +func NewSecretsSecretsDeleteNoContent() *SecretsSecretsDeleteNoContent { + return &SecretsSecretsDeleteNoContent{} +} + +/*SecretsSecretsDeleteNoContent handles this case with default header values. + +SecretsSecretsDeleteNoContent secrets secrets delete no content +*/ +type SecretsSecretsDeleteNoContent struct { +} + +func (o *SecretsSecretsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /secrets/secrets/{id}/][%d] secretsSecretsDeleteNoContent ", 204) +} + +func (o *SecretsSecretsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/secrets/secrets_secrets_list_parameters.go b/netbox/client/secrets/secrets_secrets_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..02ba58455c2a40ba0dd6c1c9af2bf43fef413cff --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_list_parameters.go @@ -0,0 +1,387 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretsListParams creates a new SecretsSecretsListParams object +// with the default values initialized. +func NewSecretsSecretsListParams() *SecretsSecretsListParams { + var () + return &SecretsSecretsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsListParamsWithTimeout creates a new SecretsSecretsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsListParamsWithTimeout(timeout time.Duration) *SecretsSecretsListParams { + var () + return &SecretsSecretsListParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsListParamsWithContext creates a new SecretsSecretsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsListParamsWithContext(ctx context.Context) *SecretsSecretsListParams { + var () + return &SecretsSecretsListParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsListParamsWithHTTPClient creates a new SecretsSecretsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsListParamsWithHTTPClient(client *http.Client) *SecretsSecretsListParams { + var () + return &SecretsSecretsListParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsListParams contains all the parameters to send to the API endpoint +for the secrets secrets list operation typically these are written to a http.Request +*/ +type SecretsSecretsListParams struct { + + /*Device*/ + Device *string + /*DeviceID*/ + DeviceID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets list params +func (o *SecretsSecretsListParams) WithTimeout(timeout time.Duration) *SecretsSecretsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets list params +func (o *SecretsSecretsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets list params +func (o *SecretsSecretsListParams) WithContext(ctx context.Context) *SecretsSecretsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets list params +func (o *SecretsSecretsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets list params +func (o *SecretsSecretsListParams) WithHTTPClient(client *http.Client) *SecretsSecretsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets list params +func (o *SecretsSecretsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithDevice adds the device to the secrets secrets list params +func (o *SecretsSecretsListParams) WithDevice(device *string) *SecretsSecretsListParams { + o.SetDevice(device) + return o +} + +// SetDevice adds the device to the secrets secrets list params +func (o *SecretsSecretsListParams) SetDevice(device *string) { + o.Device = device +} + +// WithDeviceID adds the deviceID to the secrets secrets list params +func (o *SecretsSecretsListParams) WithDeviceID(deviceID *string) *SecretsSecretsListParams { + o.SetDeviceID(deviceID) + return o +} + +// SetDeviceID adds the deviceId to the secrets secrets list params +func (o *SecretsSecretsListParams) SetDeviceID(deviceID *string) { + o.DeviceID = deviceID +} + +// WithIDIn adds the iDIn to the secrets secrets list params +func (o *SecretsSecretsListParams) WithIDIn(iDIn *float64) *SecretsSecretsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the secrets secrets list params +func (o *SecretsSecretsListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the secrets secrets list params +func (o *SecretsSecretsListParams) WithLimit(limit *int64) *SecretsSecretsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the secrets secrets list params +func (o *SecretsSecretsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the secrets secrets list params +func (o *SecretsSecretsListParams) WithName(name *string) *SecretsSecretsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the secrets secrets list params +func (o *SecretsSecretsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the secrets secrets list params +func (o *SecretsSecretsListParams) WithOffset(offset *int64) *SecretsSecretsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the secrets secrets list params +func (o *SecretsSecretsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the secrets secrets list params +func (o *SecretsSecretsListParams) WithQ(q *string) *SecretsSecretsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the secrets secrets list params +func (o *SecretsSecretsListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the secrets secrets list params +func (o *SecretsSecretsListParams) WithRole(role *string) *SecretsSecretsListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the secrets secrets list params +func (o *SecretsSecretsListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the secrets secrets list params +func (o *SecretsSecretsListParams) WithRoleID(roleID *string) *SecretsSecretsListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the secrets secrets list params +func (o *SecretsSecretsListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Device != nil { + + // query param device + var qrDevice string + if o.Device != nil { + qrDevice = *o.Device + } + qDevice := qrDevice + if qDevice != "" { + if err := r.SetQueryParam("device", qDevice); err != nil { + return err + } + } + + } + + if o.DeviceID != nil { + + // query param device_id + var qrDeviceID string + if o.DeviceID != nil { + qrDeviceID = *o.DeviceID + } + qDeviceID := qrDeviceID + if qDeviceID != "" { + if err := r.SetQueryParam("device_id", qDeviceID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Role != nil { + + // query param role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + + } + + if o.RoleID != nil { + + // query param role_id + var qrRoleID string + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + if err := r.SetQueryParam("role_id", qRoleID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/secrets/secrets_secrets_list_responses.go b/netbox/client/secrets/secrets_secrets_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..612b0d39e1878420d4c8b3fbae489414670d2db1 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretsListReader is a Reader for the SecretsSecretsList structure. +type SecretsSecretsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretsListOK() + 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()) + } +} + +// NewSecretsSecretsListOK creates a SecretsSecretsListOK with default headers values +func NewSecretsSecretsListOK() *SecretsSecretsListOK { + return &SecretsSecretsListOK{} +} + +/*SecretsSecretsListOK handles this case with default header values. + +SecretsSecretsListOK secrets secrets list o k +*/ +type SecretsSecretsListOK struct { + Payload *models.SecretsSecretsListOKBody +} + +func (o *SecretsSecretsListOK) Error() string { + return fmt.Sprintf("[GET /secrets/secrets/][%d] secretsSecretsListOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.SecretsSecretsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secrets_partial_update_parameters.go b/netbox/client/secrets/secrets_secrets_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f10a56fca3677ec6b90327da8a56af729b0864c3 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretsPartialUpdateParams creates a new SecretsSecretsPartialUpdateParams object +// with the default values initialized. +func NewSecretsSecretsPartialUpdateParams() *SecretsSecretsPartialUpdateParams { + var () + return &SecretsSecretsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsPartialUpdateParamsWithTimeout creates a new SecretsSecretsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsPartialUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretsPartialUpdateParams { + var () + return &SecretsSecretsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsPartialUpdateParamsWithContext creates a new SecretsSecretsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsPartialUpdateParamsWithContext(ctx context.Context) *SecretsSecretsPartialUpdateParams { + var () + return &SecretsSecretsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsPartialUpdateParamsWithHTTPClient creates a new SecretsSecretsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsPartialUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretsPartialUpdateParams { + var () + return &SecretsSecretsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsPartialUpdateParams contains all the parameters to send to the API endpoint +for the secrets secrets partial update operation typically these are written to a http.Request +*/ +type SecretsSecretsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableSecret + /*ID + A unique integer value identifying this secret. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithContext(ctx context.Context) *SecretsSecretsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithData(data *models.WritableSecret) *SecretsSecretsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetData(data *models.WritableSecret) { + o.Data = data +} + +// WithID adds the id to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) WithID(id int64) *SecretsSecretsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secrets partial update params +func (o *SecretsSecretsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsPartialUpdateParams) 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/secrets/secrets_secrets_partial_update_responses.go b/netbox/client/secrets/secrets_secrets_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d0b8633e487dcb98ba00e0812aa4389a6b1dc3c8 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretsPartialUpdateReader is a Reader for the SecretsSecretsPartialUpdate structure. +type SecretsSecretsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretsPartialUpdateOK() + 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()) + } +} + +// NewSecretsSecretsPartialUpdateOK creates a SecretsSecretsPartialUpdateOK with default headers values +func NewSecretsSecretsPartialUpdateOK() *SecretsSecretsPartialUpdateOK { + return &SecretsSecretsPartialUpdateOK{} +} + +/*SecretsSecretsPartialUpdateOK handles this case with default header values. + +SecretsSecretsPartialUpdateOK secrets secrets partial update o k +*/ +type SecretsSecretsPartialUpdateOK struct { + Payload *models.WritableSecret +} + +func (o *SecretsSecretsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /secrets/secrets/{id}/][%d] secretsSecretsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSecret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secrets_read_parameters.go b/netbox/client/secrets/secrets_secrets_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1025490197612dd7f86b4ccb97e3684d16b3524b --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretsReadParams creates a new SecretsSecretsReadParams object +// with the default values initialized. +func NewSecretsSecretsReadParams() *SecretsSecretsReadParams { + var () + return &SecretsSecretsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsReadParamsWithTimeout creates a new SecretsSecretsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsReadParamsWithTimeout(timeout time.Duration) *SecretsSecretsReadParams { + var () + return &SecretsSecretsReadParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsReadParamsWithContext creates a new SecretsSecretsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsReadParamsWithContext(ctx context.Context) *SecretsSecretsReadParams { + var () + return &SecretsSecretsReadParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsReadParamsWithHTTPClient creates a new SecretsSecretsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsReadParamsWithHTTPClient(client *http.Client) *SecretsSecretsReadParams { + var () + return &SecretsSecretsReadParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsReadParams contains all the parameters to send to the API endpoint +for the secrets secrets read operation typically these are written to a http.Request +*/ +type SecretsSecretsReadParams struct { + + /*ID + A unique integer value identifying this secret. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets read params +func (o *SecretsSecretsReadParams) WithTimeout(timeout time.Duration) *SecretsSecretsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets read params +func (o *SecretsSecretsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets read params +func (o *SecretsSecretsReadParams) WithContext(ctx context.Context) *SecretsSecretsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets read params +func (o *SecretsSecretsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets read params +func (o *SecretsSecretsReadParams) WithHTTPClient(client *http.Client) *SecretsSecretsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets read params +func (o *SecretsSecretsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the secrets secrets read params +func (o *SecretsSecretsReadParams) WithID(id int64) *SecretsSecretsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secrets read params +func (o *SecretsSecretsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsReadParams) 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/secrets/secrets_secrets_read_responses.go b/netbox/client/secrets/secrets_secrets_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2033323f024a8d288360d2ec30c2995df40103b4 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretsReadReader is a Reader for the SecretsSecretsRead structure. +type SecretsSecretsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretsReadOK() + 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()) + } +} + +// NewSecretsSecretsReadOK creates a SecretsSecretsReadOK with default headers values +func NewSecretsSecretsReadOK() *SecretsSecretsReadOK { + return &SecretsSecretsReadOK{} +} + +/*SecretsSecretsReadOK handles this case with default header values. + +SecretsSecretsReadOK secrets secrets read o k +*/ +type SecretsSecretsReadOK struct { + Payload *models.Secret +} + +func (o *SecretsSecretsReadOK) Error() string { + return fmt.Sprintf("[GET /secrets/secrets/{id}/][%d] secretsSecretsReadOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Secret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/secrets/secrets_secrets_update_parameters.go b/netbox/client/secrets/secrets_secrets_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c9929e040579d616079841ee258733e5b8348708 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// NewSecretsSecretsUpdateParams creates a new SecretsSecretsUpdateParams object +// with the default values initialized. +func NewSecretsSecretsUpdateParams() *SecretsSecretsUpdateParams { + var () + return &SecretsSecretsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewSecretsSecretsUpdateParamsWithTimeout creates a new SecretsSecretsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewSecretsSecretsUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretsUpdateParams { + var () + return &SecretsSecretsUpdateParams{ + + timeout: timeout, + } +} + +// NewSecretsSecretsUpdateParamsWithContext creates a new SecretsSecretsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewSecretsSecretsUpdateParamsWithContext(ctx context.Context) *SecretsSecretsUpdateParams { + var () + return &SecretsSecretsUpdateParams{ + + Context: ctx, + } +} + +// NewSecretsSecretsUpdateParamsWithHTTPClient creates a new SecretsSecretsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewSecretsSecretsUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretsUpdateParams { + var () + return &SecretsSecretsUpdateParams{ + HTTPClient: client, + } +} + +/*SecretsSecretsUpdateParams contains all the parameters to send to the API endpoint +for the secrets secrets update operation typically these are written to a http.Request +*/ +type SecretsSecretsUpdateParams struct { + + /*Data*/ + Data *models.WritableSecret + /*ID + A unique integer value identifying this secret. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithContext(ctx context.Context) *SecretsSecretsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithData(data *models.WritableSecret) *SecretsSecretsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetData(data *models.WritableSecret) { + o.Data = data +} + +// WithID adds the id to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) WithID(id int64) *SecretsSecretsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the secrets secrets update params +func (o *SecretsSecretsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *SecretsSecretsUpdateParams) 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/secrets/secrets_secrets_update_responses.go b/netbox/client/secrets/secrets_secrets_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..efeb4001a0d4bb10569827ae068887e3cf5f6f55 --- /dev/null +++ b/netbox/client/secrets/secrets_secrets_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package secrets + +// 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" +) + +// SecretsSecretsUpdateReader is a Reader for the SecretsSecretsUpdate structure. +type SecretsSecretsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *SecretsSecretsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewSecretsSecretsUpdateOK() + 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()) + } +} + +// NewSecretsSecretsUpdateOK creates a SecretsSecretsUpdateOK with default headers values +func NewSecretsSecretsUpdateOK() *SecretsSecretsUpdateOK { + return &SecretsSecretsUpdateOK{} +} + +/*SecretsSecretsUpdateOK handles this case with default header values. + +SecretsSecretsUpdateOK secrets secrets update o k +*/ +type SecretsSecretsUpdateOK struct { + Payload *models.WritableSecret +} + +func (o *SecretsSecretsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /secrets/secrets/{id}/][%d] secretsSecretsUpdateOK %+v", 200, o.Payload) +} + +func (o *SecretsSecretsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableSecret) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_choices_list_parameters.go b/netbox/client/tenancy/tenancy_choices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6a38ec6dc1d1959f4fff7034998fc42d0428ae20 --- /dev/null +++ b/netbox/client/tenancy/tenancy_choices_list_parameters.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyChoicesListParams creates a new TenancyChoicesListParams object +// with the default values initialized. +func NewTenancyChoicesListParams() *TenancyChoicesListParams { + + return &TenancyChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyChoicesListParamsWithTimeout creates a new TenancyChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyChoicesListParamsWithTimeout(timeout time.Duration) *TenancyChoicesListParams { + + return &TenancyChoicesListParams{ + + timeout: timeout, + } +} + +// NewTenancyChoicesListParamsWithContext creates a new TenancyChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyChoicesListParamsWithContext(ctx context.Context) *TenancyChoicesListParams { + + return &TenancyChoicesListParams{ + + Context: ctx, + } +} + +// NewTenancyChoicesListParamsWithHTTPClient creates a new TenancyChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyChoicesListParamsWithHTTPClient(client *http.Client) *TenancyChoicesListParams { + + return &TenancyChoicesListParams{ + HTTPClient: client, + } +} + +/*TenancyChoicesListParams contains all the parameters to send to the API endpoint +for the tenancy choices list operation typically these are written to a http.Request +*/ +type TenancyChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy choices list params +func (o *TenancyChoicesListParams) WithTimeout(timeout time.Duration) *TenancyChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy choices list params +func (o *TenancyChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy choices list params +func (o *TenancyChoicesListParams) WithContext(ctx context.Context) *TenancyChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy choices list params +func (o *TenancyChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy choices list params +func (o *TenancyChoicesListParams) WithHTTPClient(client *http.Client) *TenancyChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy choices list params +func (o *TenancyChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyChoicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/tenancy/tenancy_choices_list_responses.go b/netbox/client/tenancy/tenancy_choices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..65cb4167b0c6ec60370ee6b476f7a43edd31b857 --- /dev/null +++ b/netbox/client/tenancy/tenancy_choices_list_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyChoicesListReader is a Reader for the TenancyChoicesList structure. +type TenancyChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyChoicesListOK() + 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()) + } +} + +// NewTenancyChoicesListOK creates a TenancyChoicesListOK with default headers values +func NewTenancyChoicesListOK() *TenancyChoicesListOK { + return &TenancyChoicesListOK{} +} + +/*TenancyChoicesListOK handles this case with default header values. + +TenancyChoicesListOK tenancy choices list o k +*/ +type TenancyChoicesListOK struct { +} + +func (o *TenancyChoicesListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/_choices/][%d] tenancyChoicesListOK ", 200) +} + +func (o *TenancyChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/tenancy/tenancy_choices_read_parameters.go b/netbox/client/tenancy/tenancy_choices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a33ff923e6fc757dc23e2e64e2e794a699a3d863 --- /dev/null +++ b/netbox/client/tenancy/tenancy_choices_read_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyChoicesReadParams creates a new TenancyChoicesReadParams object +// with the default values initialized. +func NewTenancyChoicesReadParams() *TenancyChoicesReadParams { + var () + return &TenancyChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyChoicesReadParamsWithTimeout creates a new TenancyChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyChoicesReadParamsWithTimeout(timeout time.Duration) *TenancyChoicesReadParams { + var () + return &TenancyChoicesReadParams{ + + timeout: timeout, + } +} + +// NewTenancyChoicesReadParamsWithContext creates a new TenancyChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyChoicesReadParamsWithContext(ctx context.Context) *TenancyChoicesReadParams { + var () + return &TenancyChoicesReadParams{ + + Context: ctx, + } +} + +// NewTenancyChoicesReadParamsWithHTTPClient creates a new TenancyChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyChoicesReadParamsWithHTTPClient(client *http.Client) *TenancyChoicesReadParams { + var () + return &TenancyChoicesReadParams{ + HTTPClient: client, + } +} + +/*TenancyChoicesReadParams contains all the parameters to send to the API endpoint +for the tenancy choices read operation typically these are written to a http.Request +*/ +type TenancyChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy choices read params +func (o *TenancyChoicesReadParams) WithTimeout(timeout time.Duration) *TenancyChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy choices read params +func (o *TenancyChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy choices read params +func (o *TenancyChoicesReadParams) WithContext(ctx context.Context) *TenancyChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy choices read params +func (o *TenancyChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy choices read params +func (o *TenancyChoicesReadParams) WithHTTPClient(client *http.Client) *TenancyChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy choices read params +func (o *TenancyChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy choices read params +func (o *TenancyChoicesReadParams) WithID(id string) *TenancyChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy choices read params +func (o *TenancyChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyChoicesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/tenancy/tenancy_choices_read_responses.go b/netbox/client/tenancy/tenancy_choices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c5867709da0f3789cc31b0db8ec1974742efe535 --- /dev/null +++ b/netbox/client/tenancy/tenancy_choices_read_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyChoicesReadReader is a Reader for the TenancyChoicesRead structure. +type TenancyChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyChoicesReadOK() + 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()) + } +} + +// NewTenancyChoicesReadOK creates a TenancyChoicesReadOK with default headers values +func NewTenancyChoicesReadOK() *TenancyChoicesReadOK { + return &TenancyChoicesReadOK{} +} + +/*TenancyChoicesReadOK handles this case with default header values. + +TenancyChoicesReadOK tenancy choices read o k +*/ +type TenancyChoicesReadOK struct { +} + +func (o *TenancyChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/_choices/{id}/][%d] tenancyChoicesReadOK ", 200) +} + +func (o *TenancyChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/tenancy/tenancy_client.go b/netbox/client/tenancy/tenancy_client.go new file mode 100644 index 0000000000000000000000000000000000000000..9dadf876cfc5f92808b7c372031809f1604b845b --- /dev/null +++ b/netbox/client/tenancy/tenancy_client.go @@ -0,0 +1,436 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new tenancy API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for tenancy API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +TenancyChoicesList tenancy choices list API +*/ +func (a *Client) TenancyChoicesList(params *TenancyChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy__choices_list", + Method: "GET", + PathPattern: "/tenancy/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyChoicesListOK), nil + +} + +/* +TenancyChoicesRead tenancy choices read API +*/ +func (a *Client) TenancyChoicesRead(params *TenancyChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy__choices_read", + Method: "GET", + PathPattern: "/tenancy/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyChoicesReadOK), nil + +} + +/* +TenancyTenantGroupsCreate tenancy tenant groups create API +*/ +func (a *Client) TenancyTenantGroupsCreate(params *TenancyTenantGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_create", + Method: "POST", + PathPattern: "/tenancy/tenant-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsCreateCreated), nil + +} + +/* +TenancyTenantGroupsDelete tenancy tenant groups delete API +*/ +func (a *Client) TenancyTenantGroupsDelete(params *TenancyTenantGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_delete", + Method: "DELETE", + PathPattern: "/tenancy/tenant-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsDeleteNoContent), nil + +} + +/* +TenancyTenantGroupsList tenancy tenant groups list API +*/ +func (a *Client) TenancyTenantGroupsList(params *TenancyTenantGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_list", + Method: "GET", + PathPattern: "/tenancy/tenant-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsListOK), nil + +} + +/* +TenancyTenantGroupsPartialUpdate tenancy tenant groups partial update API +*/ +func (a *Client) TenancyTenantGroupsPartialUpdate(params *TenancyTenantGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/tenant-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsPartialUpdateOK), nil + +} + +/* +TenancyTenantGroupsRead tenancy tenant groups read API +*/ +func (a *Client) TenancyTenantGroupsRead(params *TenancyTenantGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_read", + Method: "GET", + PathPattern: "/tenancy/tenant-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsReadOK), nil + +} + +/* +TenancyTenantGroupsUpdate tenancy tenant groups update API +*/ +func (a *Client) TenancyTenantGroupsUpdate(params *TenancyTenantGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenant-groups_update", + Method: "PUT", + PathPattern: "/tenancy/tenant-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantGroupsUpdateOK), nil + +} + +/* +TenancyTenantsCreate tenancy tenants create API +*/ +func (a *Client) TenancyTenantsCreate(params *TenancyTenantsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_create", + Method: "POST", + PathPattern: "/tenancy/tenants/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsCreateCreated), nil + +} + +/* +TenancyTenantsDelete tenancy tenants delete API +*/ +func (a *Client) TenancyTenantsDelete(params *TenancyTenantsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_delete", + Method: "DELETE", + PathPattern: "/tenancy/tenants/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsDeleteNoContent), nil + +} + +/* +TenancyTenantsList tenancy tenants list API +*/ +func (a *Client) TenancyTenantsList(params *TenancyTenantsListParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_list", + Method: "GET", + PathPattern: "/tenancy/tenants/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsListOK), nil + +} + +/* +TenancyTenantsPartialUpdate tenancy tenants partial update API +*/ +func (a *Client) TenancyTenantsPartialUpdate(params *TenancyTenantsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_partial_update", + Method: "PATCH", + PathPattern: "/tenancy/tenants/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsPartialUpdateOK), nil + +} + +/* +TenancyTenantsRead tenancy tenants read API +*/ +func (a *Client) TenancyTenantsRead(params *TenancyTenantsReadParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_read", + Method: "GET", + PathPattern: "/tenancy/tenants/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsReadOK), nil + +} + +/* +TenancyTenantsUpdate tenancy tenants update API +*/ +func (a *Client) TenancyTenantsUpdate(params *TenancyTenantsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*TenancyTenantsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewTenancyTenantsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "tenancy_tenants_update", + Method: "PUT", + PathPattern: "/tenancy/tenants/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &TenancyTenantsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*TenancyTenantsUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e68aaeae8c6c394b324750b2d862b53a823936f4 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantGroupsCreateParams creates a new TenancyTenantGroupsCreateParams object +// with the default values initialized. +func NewTenancyTenantGroupsCreateParams() *TenancyTenantGroupsCreateParams { + var () + return &TenancyTenantGroupsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsCreateParamsWithTimeout creates a new TenancyTenantGroupsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsCreateParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsCreateParams { + var () + return &TenancyTenantGroupsCreateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsCreateParamsWithContext creates a new TenancyTenantGroupsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsCreateParamsWithContext(ctx context.Context) *TenancyTenantGroupsCreateParams { + var () + return &TenancyTenantGroupsCreateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsCreateParamsWithHTTPClient creates a new TenancyTenantGroupsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsCreateParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsCreateParams { + var () + return &TenancyTenantGroupsCreateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsCreateParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups create operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsCreateParams struct { + + /*Data*/ + Data *models.TenantGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) WithContext(ctx context.Context) *TenancyTenantGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) WithData(data *models.TenantGroup) *TenancyTenantGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenant groups create params +func (o *TenancyTenantGroupsCreateParams) SetData(data *models.TenantGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsCreateParams) 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/tenancy/tenancy_tenant_groups_create_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b136ede6edceba471074707916bfe144bb815783 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantGroupsCreateReader is a Reader for the TenancyTenantGroupsCreate structure. +type TenancyTenantGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewTenancyTenantGroupsCreateCreated() + 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()) + } +} + +// NewTenancyTenantGroupsCreateCreated creates a TenancyTenantGroupsCreateCreated with default headers values +func NewTenancyTenantGroupsCreateCreated() *TenancyTenantGroupsCreateCreated { + return &TenancyTenantGroupsCreateCreated{} +} + +/*TenancyTenantGroupsCreateCreated handles this case with default header values. + +TenancyTenantGroupsCreateCreated tenancy tenant groups create created +*/ +type TenancyTenantGroupsCreateCreated struct { + Payload *models.TenantGroup +} + +func (o *TenancyTenantGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /tenancy/tenant-groups/][%d] tenancyTenantGroupsCreateCreated %+v", 201, o.Payload) +} + +func (o *TenancyTenantGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..add032807d2acf87adb63ee7b4315a8c1f9df11e --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantGroupsDeleteParams creates a new TenancyTenantGroupsDeleteParams object +// with the default values initialized. +func NewTenancyTenantGroupsDeleteParams() *TenancyTenantGroupsDeleteParams { + var () + return &TenancyTenantGroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsDeleteParamsWithTimeout creates a new TenancyTenantGroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsDeleteParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsDeleteParams { + var () + return &TenancyTenantGroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsDeleteParamsWithContext creates a new TenancyTenantGroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsDeleteParamsWithContext(ctx context.Context) *TenancyTenantGroupsDeleteParams { + var () + return &TenancyTenantGroupsDeleteParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsDeleteParamsWithHTTPClient creates a new TenancyTenantGroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsDeleteParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsDeleteParams { + var () + return &TenancyTenantGroupsDeleteParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsDeleteParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups delete operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsDeleteParams struct { + + /*ID + A unique integer value identifying this tenant group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) WithContext(ctx context.Context) *TenancyTenantGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) WithID(id int64) *TenancyTenantGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups delete params +func (o *TenancyTenantGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsDeleteParams) 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/tenancy/tenancy_tenant_groups_delete_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f599db10a4c69af364deadb302ab0357bfcd5eb2 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantGroupsDeleteReader is a Reader for the TenancyTenantGroupsDelete structure. +type TenancyTenantGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewTenancyTenantGroupsDeleteNoContent() + 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()) + } +} + +// NewTenancyTenantGroupsDeleteNoContent creates a TenancyTenantGroupsDeleteNoContent with default headers values +func NewTenancyTenantGroupsDeleteNoContent() *TenancyTenantGroupsDeleteNoContent { + return &TenancyTenantGroupsDeleteNoContent{} +} + +/*TenancyTenantGroupsDeleteNoContent handles this case with default header values. + +TenancyTenantGroupsDeleteNoContent tenancy tenant groups delete no content +*/ +type TenancyTenantGroupsDeleteNoContent struct { +} + +func (o *TenancyTenantGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/tenant-groups/{id}/][%d] tenancyTenantGroupsDeleteNoContent ", 204) +} + +func (o *TenancyTenantGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..54a6ba28fc1cc36b517f1125e57fc252467e9ba3 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_list_parameters.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantGroupsListParams creates a new TenancyTenantGroupsListParams object +// with the default values initialized. +func NewTenancyTenantGroupsListParams() *TenancyTenantGroupsListParams { + var () + return &TenancyTenantGroupsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsListParamsWithTimeout creates a new TenancyTenantGroupsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsListParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsListParams { + var () + return &TenancyTenantGroupsListParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsListParamsWithContext creates a new TenancyTenantGroupsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsListParamsWithContext(ctx context.Context) *TenancyTenantGroupsListParams { + var () + return &TenancyTenantGroupsListParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsListParamsWithHTTPClient creates a new TenancyTenantGroupsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsListParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsListParams { + var () + return &TenancyTenantGroupsListParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsListParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups list operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsListParams struct { + + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Slug*/ + Slug *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithContext(ctx context.Context) *TenancyTenantGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithLimit(limit *int64) *TenancyTenantGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithName(name *string) *TenancyTenantGroupsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithOffset(offset *int64) *TenancyTenantGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithSlug adds the slug to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) WithSlug(slug *string) *TenancyTenantGroupsListParams { + o.SetSlug(slug) + return o +} + +// SetSlug adds the slug to the tenancy tenant groups list params +func (o *TenancyTenantGroupsListParams) SetSlug(slug *string) { + o.Slug = slug +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Slug != nil { + + // query param slug + var qrSlug string + if o.Slug != nil { + qrSlug = *o.Slug + } + qSlug := qrSlug + if qSlug != "" { + if err := r.SetQueryParam("slug", qSlug); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2dee13599cc8506bed8ac547693f257e75ba7972 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantGroupsListReader is a Reader for the TenancyTenantGroupsList structure. +type TenancyTenantGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantGroupsListOK() + 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()) + } +} + +// NewTenancyTenantGroupsListOK creates a TenancyTenantGroupsListOK with default headers values +func NewTenancyTenantGroupsListOK() *TenancyTenantGroupsListOK { + return &TenancyTenantGroupsListOK{} +} + +/*TenancyTenantGroupsListOK handles this case with default header values. + +TenancyTenantGroupsListOK tenancy tenant groups list o k +*/ +type TenancyTenantGroupsListOK struct { + Payload *models.TenancyTenantGroupsListOKBody +} + +func (o *TenancyTenantGroupsListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/tenant-groups/][%d] tenancyTenantGroupsListOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenancyTenantGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1600b2197828b4c1db84bb42f76259faf16e1df0 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantGroupsPartialUpdateParams creates a new TenancyTenantGroupsPartialUpdateParams object +// with the default values initialized. +func NewTenancyTenantGroupsPartialUpdateParams() *TenancyTenantGroupsPartialUpdateParams { + var () + return &TenancyTenantGroupsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsPartialUpdateParamsWithTimeout creates a new TenancyTenantGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsPartialUpdateParams { + var () + return &TenancyTenantGroupsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsPartialUpdateParamsWithContext creates a new TenancyTenantGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsPartialUpdateParamsWithContext(ctx context.Context) *TenancyTenantGroupsPartialUpdateParams { + var () + return &TenancyTenantGroupsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsPartialUpdateParamsWithHTTPClient creates a new TenancyTenantGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsPartialUpdateParams { + var () + return &TenancyTenantGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsPartialUpdateParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups partial update operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsPartialUpdateParams struct { + + /*Data*/ + Data *models.TenantGroup + /*ID + A unique integer value identifying this tenant group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithContext(ctx context.Context) *TenancyTenantGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithData(data *models.TenantGroup) *TenancyTenantGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetData(data *models.TenantGroup) { + o.Data = data +} + +// WithID adds the id to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) WithID(id int64) *TenancyTenantGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups partial update params +func (o *TenancyTenantGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsPartialUpdateParams) 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/tenancy/tenancy_tenant_groups_partial_update_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c4d535e4ad76828757868dbe5947d7d197af09fd --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantGroupsPartialUpdateReader is a Reader for the TenancyTenantGroupsPartialUpdate structure. +type TenancyTenantGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantGroupsPartialUpdateOK() + 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()) + } +} + +// NewTenancyTenantGroupsPartialUpdateOK creates a TenancyTenantGroupsPartialUpdateOK with default headers values +func NewTenancyTenantGroupsPartialUpdateOK() *TenancyTenantGroupsPartialUpdateOK { + return &TenancyTenantGroupsPartialUpdateOK{} +} + +/*TenancyTenantGroupsPartialUpdateOK handles this case with default header values. + +TenancyTenantGroupsPartialUpdateOK tenancy tenant groups partial update o k +*/ +type TenancyTenantGroupsPartialUpdateOK struct { + Payload *models.TenantGroup +} + +func (o *TenancyTenantGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/tenant-groups/{id}/][%d] tenancyTenantGroupsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d95de540775e1626e35ff3dfefc612a14bc90ce1 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantGroupsReadParams creates a new TenancyTenantGroupsReadParams object +// with the default values initialized. +func NewTenancyTenantGroupsReadParams() *TenancyTenantGroupsReadParams { + var () + return &TenancyTenantGroupsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsReadParamsWithTimeout creates a new TenancyTenantGroupsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsReadParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsReadParams { + var () + return &TenancyTenantGroupsReadParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsReadParamsWithContext creates a new TenancyTenantGroupsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsReadParamsWithContext(ctx context.Context) *TenancyTenantGroupsReadParams { + var () + return &TenancyTenantGroupsReadParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsReadParamsWithHTTPClient creates a new TenancyTenantGroupsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsReadParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsReadParams { + var () + return &TenancyTenantGroupsReadParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsReadParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups read operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsReadParams struct { + + /*ID + A unique integer value identifying this tenant group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) WithContext(ctx context.Context) *TenancyTenantGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) WithID(id int64) *TenancyTenantGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups read params +func (o *TenancyTenantGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsReadParams) 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/tenancy/tenancy_tenant_groups_read_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..dbe40ad4dcb36b8b5dcdff16d8014810fa458663 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantGroupsReadReader is a Reader for the TenancyTenantGroupsRead structure. +type TenancyTenantGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantGroupsReadOK() + 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()) + } +} + +// NewTenancyTenantGroupsReadOK creates a TenancyTenantGroupsReadOK with default headers values +func NewTenancyTenantGroupsReadOK() *TenancyTenantGroupsReadOK { + return &TenancyTenantGroupsReadOK{} +} + +/*TenancyTenantGroupsReadOK handles this case with default header values. + +TenancyTenantGroupsReadOK tenancy tenant groups read o k +*/ +type TenancyTenantGroupsReadOK struct { + Payload *models.TenantGroup +} + +func (o *TenancyTenantGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/tenant-groups/{id}/][%d] tenancyTenantGroupsReadOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go b/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..51b2193da636ff8d23f793ccc7becbd61e0d4040 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantGroupsUpdateParams creates a new TenancyTenantGroupsUpdateParams object +// with the default values initialized. +func NewTenancyTenantGroupsUpdateParams() *TenancyTenantGroupsUpdateParams { + var () + return &TenancyTenantGroupsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantGroupsUpdateParamsWithTimeout creates a new TenancyTenantGroupsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantGroupsUpdateParamsWithTimeout(timeout time.Duration) *TenancyTenantGroupsUpdateParams { + var () + return &TenancyTenantGroupsUpdateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantGroupsUpdateParamsWithContext creates a new TenancyTenantGroupsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantGroupsUpdateParamsWithContext(ctx context.Context) *TenancyTenantGroupsUpdateParams { + var () + return &TenancyTenantGroupsUpdateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantGroupsUpdateParamsWithHTTPClient creates a new TenancyTenantGroupsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantGroupsUpdateParamsWithHTTPClient(client *http.Client) *TenancyTenantGroupsUpdateParams { + var () + return &TenancyTenantGroupsUpdateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantGroupsUpdateParams contains all the parameters to send to the API endpoint +for the tenancy tenant groups update operation typically these are written to a http.Request +*/ +type TenancyTenantGroupsUpdateParams struct { + + /*Data*/ + Data *models.TenantGroup + /*ID + A unique integer value identifying this tenant group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithTimeout(timeout time.Duration) *TenancyTenantGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithContext(ctx context.Context) *TenancyTenantGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithHTTPClient(client *http.Client) *TenancyTenantGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithData(data *models.TenantGroup) *TenancyTenantGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetData(data *models.TenantGroup) { + o.Data = data +} + +// WithID adds the id to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) WithID(id int64) *TenancyTenantGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenant groups update params +func (o *TenancyTenantGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantGroupsUpdateParams) 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/tenancy/tenancy_tenant_groups_update_responses.go b/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..fdf10b15c49f5abeda8646a176d48baca9534aa9 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenant_groups_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantGroupsUpdateReader is a Reader for the TenancyTenantGroupsUpdate structure. +type TenancyTenantGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantGroupsUpdateOK() + 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()) + } +} + +// NewTenancyTenantGroupsUpdateOK creates a TenancyTenantGroupsUpdateOK with default headers values +func NewTenancyTenantGroupsUpdateOK() *TenancyTenantGroupsUpdateOK { + return &TenancyTenantGroupsUpdateOK{} +} + +/*TenancyTenantGroupsUpdateOK handles this case with default header values. + +TenancyTenantGroupsUpdateOK tenancy tenant groups update o k +*/ +type TenancyTenantGroupsUpdateOK struct { + Payload *models.TenantGroup +} + +func (o *TenancyTenantGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/tenant-groups/{id}/][%d] tenancyTenantGroupsUpdateOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenantGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenants_create_parameters.go b/netbox/client/tenancy/tenancy_tenants_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..13b96020c357bb2b0d886052c7410c6be6986102 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantsCreateParams creates a new TenancyTenantsCreateParams object +// with the default values initialized. +func NewTenancyTenantsCreateParams() *TenancyTenantsCreateParams { + var () + return &TenancyTenantsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsCreateParamsWithTimeout creates a new TenancyTenantsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsCreateParamsWithTimeout(timeout time.Duration) *TenancyTenantsCreateParams { + var () + return &TenancyTenantsCreateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsCreateParamsWithContext creates a new TenancyTenantsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsCreateParamsWithContext(ctx context.Context) *TenancyTenantsCreateParams { + var () + return &TenancyTenantsCreateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsCreateParamsWithHTTPClient creates a new TenancyTenantsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsCreateParamsWithHTTPClient(client *http.Client) *TenancyTenantsCreateParams { + var () + return &TenancyTenantsCreateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsCreateParams contains all the parameters to send to the API endpoint +for the tenancy tenants create operation typically these are written to a http.Request +*/ +type TenancyTenantsCreateParams struct { + + /*Data*/ + Data *models.WritableTenant + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) WithTimeout(timeout time.Duration) *TenancyTenantsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) WithContext(ctx context.Context) *TenancyTenantsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) WithHTTPClient(client *http.Client) *TenancyTenantsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) WithData(data *models.WritableTenant) *TenancyTenantsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenants create params +func (o *TenancyTenantsCreateParams) SetData(data *models.WritableTenant) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsCreateParams) 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/tenancy/tenancy_tenants_create_responses.go b/netbox/client/tenancy/tenancy_tenants_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..81d80b81849515289a60bd4d87b2aa924d218538 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantsCreateReader is a Reader for the TenancyTenantsCreate structure. +type TenancyTenantsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewTenancyTenantsCreateCreated() + 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()) + } +} + +// NewTenancyTenantsCreateCreated creates a TenancyTenantsCreateCreated with default headers values +func NewTenancyTenantsCreateCreated() *TenancyTenantsCreateCreated { + return &TenancyTenantsCreateCreated{} +} + +/*TenancyTenantsCreateCreated handles this case with default header values. + +TenancyTenantsCreateCreated tenancy tenants create created +*/ +type TenancyTenantsCreateCreated struct { + Payload *models.WritableTenant +} + +func (o *TenancyTenantsCreateCreated) Error() string { + return fmt.Sprintf("[POST /tenancy/tenants/][%d] tenancyTenantsCreateCreated %+v", 201, o.Payload) +} + +func (o *TenancyTenantsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenants_delete_parameters.go b/netbox/client/tenancy/tenancy_tenants_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1fa1e041e13bd3366710ce33d1c38267203232dd --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantsDeleteParams creates a new TenancyTenantsDeleteParams object +// with the default values initialized. +func NewTenancyTenantsDeleteParams() *TenancyTenantsDeleteParams { + var () + return &TenancyTenantsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsDeleteParamsWithTimeout creates a new TenancyTenantsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsDeleteParamsWithTimeout(timeout time.Duration) *TenancyTenantsDeleteParams { + var () + return &TenancyTenantsDeleteParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsDeleteParamsWithContext creates a new TenancyTenantsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsDeleteParamsWithContext(ctx context.Context) *TenancyTenantsDeleteParams { + var () + return &TenancyTenantsDeleteParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsDeleteParamsWithHTTPClient creates a new TenancyTenantsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsDeleteParamsWithHTTPClient(client *http.Client) *TenancyTenantsDeleteParams { + var () + return &TenancyTenantsDeleteParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsDeleteParams contains all the parameters to send to the API endpoint +for the tenancy tenants delete operation typically these are written to a http.Request +*/ +type TenancyTenantsDeleteParams struct { + + /*ID + A unique integer value identifying this tenant. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) WithTimeout(timeout time.Duration) *TenancyTenantsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) WithContext(ctx context.Context) *TenancyTenantsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) WithHTTPClient(client *http.Client) *TenancyTenantsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) WithID(id int64) *TenancyTenantsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenants delete params +func (o *TenancyTenantsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsDeleteParams) 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/tenancy/tenancy_tenants_delete_responses.go b/netbox/client/tenancy/tenancy_tenants_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f53b2faa22a15408d3c91248a1041db008826f54 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantsDeleteReader is a Reader for the TenancyTenantsDelete structure. +type TenancyTenantsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewTenancyTenantsDeleteNoContent() + 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()) + } +} + +// NewTenancyTenantsDeleteNoContent creates a TenancyTenantsDeleteNoContent with default headers values +func NewTenancyTenantsDeleteNoContent() *TenancyTenantsDeleteNoContent { + return &TenancyTenantsDeleteNoContent{} +} + +/*TenancyTenantsDeleteNoContent handles this case with default header values. + +TenancyTenantsDeleteNoContent tenancy tenants delete no content +*/ +type TenancyTenantsDeleteNoContent struct { +} + +func (o *TenancyTenantsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /tenancy/tenants/{id}/][%d] tenancyTenantsDeleteNoContent ", 204) +} + +func (o *TenancyTenantsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenants_list_parameters.go b/netbox/client/tenancy/tenancy_tenants_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..7e959425ed5af74cac8244262d6d37983a483aee --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_list_parameters.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantsListParams creates a new TenancyTenantsListParams object +// with the default values initialized. +func NewTenancyTenantsListParams() *TenancyTenantsListParams { + var () + return &TenancyTenantsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsListParamsWithTimeout creates a new TenancyTenantsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsListParamsWithTimeout(timeout time.Duration) *TenancyTenantsListParams { + var () + return &TenancyTenantsListParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsListParamsWithContext creates a new TenancyTenantsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsListParamsWithContext(ctx context.Context) *TenancyTenantsListParams { + var () + return &TenancyTenantsListParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsListParamsWithHTTPClient creates a new TenancyTenantsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsListParamsWithHTTPClient(client *http.Client) *TenancyTenantsListParams { + var () + return &TenancyTenantsListParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsListParams contains all the parameters to send to the API endpoint +for the tenancy tenants list operation typically these are written to a http.Request +*/ +type TenancyTenantsListParams struct { + + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithTimeout(timeout time.Duration) *TenancyTenantsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithContext(ctx context.Context) *TenancyTenantsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithHTTPClient(client *http.Client) *TenancyTenantsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGroup adds the group to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithGroup(group *string) *TenancyTenantsListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithGroupID(groupID *string) *TenancyTenantsListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithIDIn(iDIn *float64) *TenancyTenantsListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithLimit(limit *int64) *TenancyTenantsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithName(name *string) *TenancyTenantsListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithOffset(offset *int64) *TenancyTenantsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the tenancy tenants list params +func (o *TenancyTenantsListParams) WithQ(q *string) *TenancyTenantsListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the tenancy tenants list params +func (o *TenancyTenantsListParams) SetQ(q *string) { + o.Q = q +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Group != nil { + + // query param group + var qrGroup string + if o.Group != nil { + qrGroup = *o.Group + } + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("group", qGroup); err != nil { + return err + } + } + + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenants_list_responses.go b/netbox/client/tenancy/tenancy_tenants_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..47d1e4a9c915b29a8b6d6f84f0f0ea37a96b073b --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantsListReader is a Reader for the TenancyTenantsList structure. +type TenancyTenantsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantsListOK() + 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()) + } +} + +// NewTenancyTenantsListOK creates a TenancyTenantsListOK with default headers values +func NewTenancyTenantsListOK() *TenancyTenantsListOK { + return &TenancyTenantsListOK{} +} + +/*TenancyTenantsListOK handles this case with default header values. + +TenancyTenantsListOK tenancy tenants list o k +*/ +type TenancyTenantsListOK struct { + Payload *models.TenancyTenantsListOKBody +} + +func (o *TenancyTenantsListOK) Error() string { + return fmt.Sprintf("[GET /tenancy/tenants/][%d] tenancyTenantsListOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.TenancyTenantsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go b/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..50cbe4a23728fce6d6891a30f7563c73b28af2aa --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantsPartialUpdateParams creates a new TenancyTenantsPartialUpdateParams object +// with the default values initialized. +func NewTenancyTenantsPartialUpdateParams() *TenancyTenantsPartialUpdateParams { + var () + return &TenancyTenantsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsPartialUpdateParamsWithTimeout creates a new TenancyTenantsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsPartialUpdateParamsWithTimeout(timeout time.Duration) *TenancyTenantsPartialUpdateParams { + var () + return &TenancyTenantsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsPartialUpdateParamsWithContext creates a new TenancyTenantsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsPartialUpdateParamsWithContext(ctx context.Context) *TenancyTenantsPartialUpdateParams { + var () + return &TenancyTenantsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsPartialUpdateParamsWithHTTPClient creates a new TenancyTenantsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsPartialUpdateParamsWithHTTPClient(client *http.Client) *TenancyTenantsPartialUpdateParams { + var () + return &TenancyTenantsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsPartialUpdateParams contains all the parameters to send to the API endpoint +for the tenancy tenants partial update operation typically these are written to a http.Request +*/ +type TenancyTenantsPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableTenant + /*ID + A unique integer value identifying this tenant. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithTimeout(timeout time.Duration) *TenancyTenantsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithContext(ctx context.Context) *TenancyTenantsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithHTTPClient(client *http.Client) *TenancyTenantsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithData(data *models.WritableTenant) *TenancyTenantsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetData(data *models.WritableTenant) { + o.Data = data +} + +// WithID adds the id to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) WithID(id int64) *TenancyTenantsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenants partial update params +func (o *TenancyTenantsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsPartialUpdateParams) 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/tenancy/tenancy_tenants_partial_update_responses.go b/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..4cb9adafa92954ddceec561cfc623732693c6834 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantsPartialUpdateReader is a Reader for the TenancyTenantsPartialUpdate structure. +type TenancyTenantsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantsPartialUpdateOK() + 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()) + } +} + +// NewTenancyTenantsPartialUpdateOK creates a TenancyTenantsPartialUpdateOK with default headers values +func NewTenancyTenantsPartialUpdateOK() *TenancyTenantsPartialUpdateOK { + return &TenancyTenantsPartialUpdateOK{} +} + +/*TenancyTenantsPartialUpdateOK handles this case with default header values. + +TenancyTenantsPartialUpdateOK tenancy tenants partial update o k +*/ +type TenancyTenantsPartialUpdateOK struct { + Payload *models.WritableTenant +} + +func (o *TenancyTenantsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /tenancy/tenants/{id}/][%d] tenancyTenantsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenants_read_parameters.go b/netbox/client/tenancy/tenancy_tenants_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d5a42c55d9ec793b317639d3c9c1615a13c43695 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantsReadParams creates a new TenancyTenantsReadParams object +// with the default values initialized. +func NewTenancyTenantsReadParams() *TenancyTenantsReadParams { + var () + return &TenancyTenantsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsReadParamsWithTimeout creates a new TenancyTenantsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsReadParamsWithTimeout(timeout time.Duration) *TenancyTenantsReadParams { + var () + return &TenancyTenantsReadParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsReadParamsWithContext creates a new TenancyTenantsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsReadParamsWithContext(ctx context.Context) *TenancyTenantsReadParams { + var () + return &TenancyTenantsReadParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsReadParamsWithHTTPClient creates a new TenancyTenantsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsReadParamsWithHTTPClient(client *http.Client) *TenancyTenantsReadParams { + var () + return &TenancyTenantsReadParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsReadParams contains all the parameters to send to the API endpoint +for the tenancy tenants read operation typically these are written to a http.Request +*/ +type TenancyTenantsReadParams struct { + + /*ID + A unique integer value identifying this tenant. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants read params +func (o *TenancyTenantsReadParams) WithTimeout(timeout time.Duration) *TenancyTenantsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants read params +func (o *TenancyTenantsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants read params +func (o *TenancyTenantsReadParams) WithContext(ctx context.Context) *TenancyTenantsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants read params +func (o *TenancyTenantsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants read params +func (o *TenancyTenantsReadParams) WithHTTPClient(client *http.Client) *TenancyTenantsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants read params +func (o *TenancyTenantsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the tenancy tenants read params +func (o *TenancyTenantsReadParams) WithID(id int64) *TenancyTenantsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenants read params +func (o *TenancyTenantsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsReadParams) 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/tenancy/tenancy_tenants_read_responses.go b/netbox/client/tenancy/tenancy_tenants_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2b1e0ebd7849d1861026def2195a6a5f0bddcd33 --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantsReadReader is a Reader for the TenancyTenantsRead structure. +type TenancyTenantsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantsReadOK() + 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()) + } +} + +// NewTenancyTenantsReadOK creates a TenancyTenantsReadOK with default headers values +func NewTenancyTenantsReadOK() *TenancyTenantsReadOK { + return &TenancyTenantsReadOK{} +} + +/*TenancyTenantsReadOK handles this case with default header values. + +TenancyTenantsReadOK tenancy tenants read o k +*/ +type TenancyTenantsReadOK struct { + Payload *models.Tenant +} + +func (o *TenancyTenantsReadOK) Error() string { + return fmt.Sprintf("[GET /tenancy/tenants/{id}/][%d] tenancyTenantsReadOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Tenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/tenancy/tenancy_tenants_update_parameters.go b/netbox/client/tenancy/tenancy_tenants_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e6ac779441da65a366019704beed98c99b5b28ec --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// NewTenancyTenantsUpdateParams creates a new TenancyTenantsUpdateParams object +// with the default values initialized. +func NewTenancyTenantsUpdateParams() *TenancyTenantsUpdateParams { + var () + return &TenancyTenantsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewTenancyTenantsUpdateParamsWithTimeout creates a new TenancyTenantsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewTenancyTenantsUpdateParamsWithTimeout(timeout time.Duration) *TenancyTenantsUpdateParams { + var () + return &TenancyTenantsUpdateParams{ + + timeout: timeout, + } +} + +// NewTenancyTenantsUpdateParamsWithContext creates a new TenancyTenantsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewTenancyTenantsUpdateParamsWithContext(ctx context.Context) *TenancyTenantsUpdateParams { + var () + return &TenancyTenantsUpdateParams{ + + Context: ctx, + } +} + +// NewTenancyTenantsUpdateParamsWithHTTPClient creates a new TenancyTenantsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewTenancyTenantsUpdateParamsWithHTTPClient(client *http.Client) *TenancyTenantsUpdateParams { + var () + return &TenancyTenantsUpdateParams{ + HTTPClient: client, + } +} + +/*TenancyTenantsUpdateParams contains all the parameters to send to the API endpoint +for the tenancy tenants update operation typically these are written to a http.Request +*/ +type TenancyTenantsUpdateParams struct { + + /*Data*/ + Data *models.WritableTenant + /*ID + A unique integer value identifying this tenant. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithTimeout(timeout time.Duration) *TenancyTenantsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithContext(ctx context.Context) *TenancyTenantsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithHTTPClient(client *http.Client) *TenancyTenantsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithData(data *models.WritableTenant) *TenancyTenantsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetData(data *models.WritableTenant) { + o.Data = data +} + +// WithID adds the id to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) WithID(id int64) *TenancyTenantsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the tenancy tenants update params +func (o *TenancyTenantsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *TenancyTenantsUpdateParams) 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/tenancy/tenancy_tenants_update_responses.go b/netbox/client/tenancy/tenancy_tenants_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..a25e78a1b4ef8f6352b8b08eac6479c23ec246dc --- /dev/null +++ b/netbox/client/tenancy/tenancy_tenants_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tenancy + +// 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" +) + +// TenancyTenantsUpdateReader is a Reader for the TenancyTenantsUpdate structure. +type TenancyTenantsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *TenancyTenantsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewTenancyTenantsUpdateOK() + 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()) + } +} + +// NewTenancyTenantsUpdateOK creates a TenancyTenantsUpdateOK with default headers values +func NewTenancyTenantsUpdateOK() *TenancyTenantsUpdateOK { + return &TenancyTenantsUpdateOK{} +} + +/*TenancyTenantsUpdateOK handles this case with default header values. + +TenancyTenantsUpdateOK tenancy tenants update o k +*/ +type TenancyTenantsUpdateOK struct { + Payload *models.WritableTenant +} + +func (o *TenancyTenantsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /tenancy/tenants/{id}/][%d] tenancyTenantsUpdateOK %+v", 200, o.Payload) +} + +func (o *TenancyTenantsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableTenant) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_choices_list_parameters.go b/netbox/client/virtualization/virtualization_choices_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..94d161cb41105d55b88e7884b748c12986a9fe5b --- /dev/null +++ b/netbox/client/virtualization/virtualization_choices_list_parameters.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationChoicesListParams creates a new VirtualizationChoicesListParams object +// with the default values initialized. +func NewVirtualizationChoicesListParams() *VirtualizationChoicesListParams { + + return &VirtualizationChoicesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationChoicesListParamsWithTimeout creates a new VirtualizationChoicesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationChoicesListParamsWithTimeout(timeout time.Duration) *VirtualizationChoicesListParams { + + return &VirtualizationChoicesListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationChoicesListParamsWithContext creates a new VirtualizationChoicesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationChoicesListParamsWithContext(ctx context.Context) *VirtualizationChoicesListParams { + + return &VirtualizationChoicesListParams{ + + Context: ctx, + } +} + +// NewVirtualizationChoicesListParamsWithHTTPClient creates a new VirtualizationChoicesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationChoicesListParamsWithHTTPClient(client *http.Client) *VirtualizationChoicesListParams { + + return &VirtualizationChoicesListParams{ + HTTPClient: client, + } +} + +/*VirtualizationChoicesListParams contains all the parameters to send to the API endpoint +for the virtualization choices list operation typically these are written to a http.Request +*/ +type VirtualizationChoicesListParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization choices list params +func (o *VirtualizationChoicesListParams) WithTimeout(timeout time.Duration) *VirtualizationChoicesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization choices list params +func (o *VirtualizationChoicesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization choices list params +func (o *VirtualizationChoicesListParams) WithContext(ctx context.Context) *VirtualizationChoicesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization choices list params +func (o *VirtualizationChoicesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization choices list params +func (o *VirtualizationChoicesListParams) WithHTTPClient(client *http.Client) *VirtualizationChoicesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization choices list params +func (o *VirtualizationChoicesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationChoicesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/virtualization/virtualization_choices_list_responses.go b/netbox/client/virtualization/virtualization_choices_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c116e6c4dea9b7872c1da36272757ba984bc9984 --- /dev/null +++ b/netbox/client/virtualization/virtualization_choices_list_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationChoicesListReader is a Reader for the VirtualizationChoicesList structure. +type VirtualizationChoicesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationChoicesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationChoicesListOK() + 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()) + } +} + +// NewVirtualizationChoicesListOK creates a VirtualizationChoicesListOK with default headers values +func NewVirtualizationChoicesListOK() *VirtualizationChoicesListOK { + return &VirtualizationChoicesListOK{} +} + +/*VirtualizationChoicesListOK handles this case with default header values. + +VirtualizationChoicesListOK virtualization choices list o k +*/ +type VirtualizationChoicesListOK struct { +} + +func (o *VirtualizationChoicesListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/_choices/][%d] virtualizationChoicesListOK ", 200) +} + +func (o *VirtualizationChoicesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/virtualization/virtualization_choices_read_parameters.go b/netbox/client/virtualization/virtualization_choices_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e7b5ec58400a75fc11fb86f83866439c431865ba --- /dev/null +++ b/netbox/client/virtualization/virtualization_choices_read_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationChoicesReadParams creates a new VirtualizationChoicesReadParams object +// with the default values initialized. +func NewVirtualizationChoicesReadParams() *VirtualizationChoicesReadParams { + var () + return &VirtualizationChoicesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationChoicesReadParamsWithTimeout creates a new VirtualizationChoicesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationChoicesReadParamsWithTimeout(timeout time.Duration) *VirtualizationChoicesReadParams { + var () + return &VirtualizationChoicesReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationChoicesReadParamsWithContext creates a new VirtualizationChoicesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationChoicesReadParamsWithContext(ctx context.Context) *VirtualizationChoicesReadParams { + var () + return &VirtualizationChoicesReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationChoicesReadParamsWithHTTPClient creates a new VirtualizationChoicesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationChoicesReadParamsWithHTTPClient(client *http.Client) *VirtualizationChoicesReadParams { + var () + return &VirtualizationChoicesReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationChoicesReadParams contains all the parameters to send to the API endpoint +for the virtualization choices read operation typically these are written to a http.Request +*/ +type VirtualizationChoicesReadParams struct { + + /*ID*/ + ID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) WithTimeout(timeout time.Duration) *VirtualizationChoicesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) WithContext(ctx context.Context) *VirtualizationChoicesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) WithHTTPClient(client *http.Client) *VirtualizationChoicesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) WithID(id string) *VirtualizationChoicesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization choices read params +func (o *VirtualizationChoicesReadParams) SetID(id string) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationChoicesReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param id + if err := r.SetPathParam("id", o.ID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/virtualization/virtualization_choices_read_responses.go b/netbox/client/virtualization/virtualization_choices_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7b83eaef1f65486224944158c6eb54983ab32d4b --- /dev/null +++ b/netbox/client/virtualization/virtualization_choices_read_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationChoicesReadReader is a Reader for the VirtualizationChoicesRead structure. +type VirtualizationChoicesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationChoicesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationChoicesReadOK() + 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()) + } +} + +// NewVirtualizationChoicesReadOK creates a VirtualizationChoicesReadOK with default headers values +func NewVirtualizationChoicesReadOK() *VirtualizationChoicesReadOK { + return &VirtualizationChoicesReadOK{} +} + +/*VirtualizationChoicesReadOK handles this case with default header values. + +VirtualizationChoicesReadOK virtualization choices read o k +*/ +type VirtualizationChoicesReadOK struct { +} + +func (o *VirtualizationChoicesReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/_choices/{id}/][%d] virtualizationChoicesReadOK ", 200) +} + +func (o *VirtualizationChoicesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/virtualization/virtualization_client.go b/netbox/client/virtualization/virtualization_client.go new file mode 100644 index 0000000000000000000000000000000000000000..efd7f0df90bc95cc4469605f05e4fd27804325b5 --- /dev/null +++ b/netbox/client/virtualization/virtualization_client.go @@ -0,0 +1,958 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + + strfmt "github.com/go-openapi/strfmt" +) + +// New creates a new virtualization API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client { + return &Client{transport: transport, formats: formats} +} + +/* +Client for virtualization API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +/* +VirtualizationChoicesList virtualization choices list API +*/ +func (a *Client) VirtualizationChoicesList(params *VirtualizationChoicesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationChoicesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationChoicesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization__choices_list", + Method: "GET", + PathPattern: "/virtualization/_choices/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationChoicesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationChoicesListOK), nil + +} + +/* +VirtualizationChoicesRead virtualization choices read API +*/ +func (a *Client) VirtualizationChoicesRead(params *VirtualizationChoicesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationChoicesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationChoicesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization__choices_read", + Method: "GET", + PathPattern: "/virtualization/_choices/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationChoicesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationChoicesReadOK), nil + +} + +/* +VirtualizationClusterGroupsCreate virtualization cluster groups create API +*/ +func (a *Client) VirtualizationClusterGroupsCreate(params *VirtualizationClusterGroupsCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_create", + Method: "POST", + PathPattern: "/virtualization/cluster-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsCreateCreated), nil + +} + +/* +VirtualizationClusterGroupsDelete virtualization cluster groups delete API +*/ +func (a *Client) VirtualizationClusterGroupsDelete(params *VirtualizationClusterGroupsDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_delete", + Method: "DELETE", + PathPattern: "/virtualization/cluster-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsDeleteNoContent), nil + +} + +/* +VirtualizationClusterGroupsList virtualization cluster groups list API +*/ +func (a *Client) VirtualizationClusterGroupsList(params *VirtualizationClusterGroupsListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_list", + Method: "GET", + PathPattern: "/virtualization/cluster-groups/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsListOK), nil + +} + +/* +VirtualizationClusterGroupsPartialUpdate virtualization cluster groups partial update API +*/ +func (a *Client) VirtualizationClusterGroupsPartialUpdate(params *VirtualizationClusterGroupsPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/cluster-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsPartialUpdateOK), nil + +} + +/* +VirtualizationClusterGroupsRead virtualization cluster groups read API +*/ +func (a *Client) VirtualizationClusterGroupsRead(params *VirtualizationClusterGroupsReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_read", + Method: "GET", + PathPattern: "/virtualization/cluster-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsReadOK), nil + +} + +/* +VirtualizationClusterGroupsUpdate virtualization cluster groups update API +*/ +func (a *Client) VirtualizationClusterGroupsUpdate(params *VirtualizationClusterGroupsUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterGroupsUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterGroupsUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-groups_update", + Method: "PUT", + PathPattern: "/virtualization/cluster-groups/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterGroupsUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterGroupsUpdateOK), nil + +} + +/* +VirtualizationClusterTypesCreate virtualization cluster types create API +*/ +func (a *Client) VirtualizationClusterTypesCreate(params *VirtualizationClusterTypesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_create", + Method: "POST", + PathPattern: "/virtualization/cluster-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesCreateCreated), nil + +} + +/* +VirtualizationClusterTypesDelete virtualization cluster types delete API +*/ +func (a *Client) VirtualizationClusterTypesDelete(params *VirtualizationClusterTypesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_delete", + Method: "DELETE", + PathPattern: "/virtualization/cluster-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesDeleteNoContent), nil + +} + +/* +VirtualizationClusterTypesList virtualization cluster types list API +*/ +func (a *Client) VirtualizationClusterTypesList(params *VirtualizationClusterTypesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_list", + Method: "GET", + PathPattern: "/virtualization/cluster-types/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesListOK), nil + +} + +/* +VirtualizationClusterTypesPartialUpdate virtualization cluster types partial update API +*/ +func (a *Client) VirtualizationClusterTypesPartialUpdate(params *VirtualizationClusterTypesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/cluster-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesPartialUpdateOK), nil + +} + +/* +VirtualizationClusterTypesRead virtualization cluster types read API +*/ +func (a *Client) VirtualizationClusterTypesRead(params *VirtualizationClusterTypesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_read", + Method: "GET", + PathPattern: "/virtualization/cluster-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesReadOK), nil + +} + +/* +VirtualizationClusterTypesUpdate virtualization cluster types update API +*/ +func (a *Client) VirtualizationClusterTypesUpdate(params *VirtualizationClusterTypesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClusterTypesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClusterTypesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_cluster-types_update", + Method: "PUT", + PathPattern: "/virtualization/cluster-types/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClusterTypesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClusterTypesUpdateOK), nil + +} + +/* +VirtualizationClustersCreate virtualization clusters create API +*/ +func (a *Client) VirtualizationClustersCreate(params *VirtualizationClustersCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_create", + Method: "POST", + PathPattern: "/virtualization/clusters/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersCreateCreated), nil + +} + +/* +VirtualizationClustersDelete virtualization clusters delete API +*/ +func (a *Client) VirtualizationClustersDelete(params *VirtualizationClustersDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_delete", + Method: "DELETE", + PathPattern: "/virtualization/clusters/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersDeleteNoContent), nil + +} + +/* +VirtualizationClustersList virtualization clusters list API +*/ +func (a *Client) VirtualizationClustersList(params *VirtualizationClustersListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_list", + Method: "GET", + PathPattern: "/virtualization/clusters/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersListOK), nil + +} + +/* +VirtualizationClustersPartialUpdate virtualization clusters partial update API +*/ +func (a *Client) VirtualizationClustersPartialUpdate(params *VirtualizationClustersPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/clusters/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersPartialUpdateOK), nil + +} + +/* +VirtualizationClustersRead virtualization clusters read API +*/ +func (a *Client) VirtualizationClustersRead(params *VirtualizationClustersReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_read", + Method: "GET", + PathPattern: "/virtualization/clusters/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersReadOK), nil + +} + +/* +VirtualizationClustersUpdate virtualization clusters update API +*/ +func (a *Client) VirtualizationClustersUpdate(params *VirtualizationClustersUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationClustersUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationClustersUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_clusters_update", + Method: "PUT", + PathPattern: "/virtualization/clusters/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationClustersUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationClustersUpdateOK), nil + +} + +/* +VirtualizationInterfacesCreate virtualization interfaces create API +*/ +func (a *Client) VirtualizationInterfacesCreate(params *VirtualizationInterfacesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_create", + Method: "POST", + PathPattern: "/virtualization/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesCreateCreated), nil + +} + +/* +VirtualizationInterfacesDelete virtualization interfaces delete API +*/ +func (a *Client) VirtualizationInterfacesDelete(params *VirtualizationInterfacesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_delete", + Method: "DELETE", + PathPattern: "/virtualization/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesDeleteNoContent), nil + +} + +/* +VirtualizationInterfacesList virtualization interfaces list API +*/ +func (a *Client) VirtualizationInterfacesList(params *VirtualizationInterfacesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_list", + Method: "GET", + PathPattern: "/virtualization/interfaces/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesListOK), nil + +} + +/* +VirtualizationInterfacesPartialUpdate virtualization interfaces partial update API +*/ +func (a *Client) VirtualizationInterfacesPartialUpdate(params *VirtualizationInterfacesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesPartialUpdateOK), nil + +} + +/* +VirtualizationInterfacesRead virtualization interfaces read API +*/ +func (a *Client) VirtualizationInterfacesRead(params *VirtualizationInterfacesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_read", + Method: "GET", + PathPattern: "/virtualization/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesReadOK), nil + +} + +/* +VirtualizationInterfacesUpdate virtualization interfaces update API +*/ +func (a *Client) VirtualizationInterfacesUpdate(params *VirtualizationInterfacesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationInterfacesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationInterfacesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_interfaces_update", + Method: "PUT", + PathPattern: "/virtualization/interfaces/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationInterfacesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationInterfacesUpdateOK), nil + +} + +/* +VirtualizationVirtualMachinesCreate virtualization virtual machines create API +*/ +func (a *Client) VirtualizationVirtualMachinesCreate(params *VirtualizationVirtualMachinesCreateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesCreateCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesCreateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_create", + Method: "POST", + PathPattern: "/virtualization/virtual-machines/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesCreateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesCreateCreated), nil + +} + +/* +VirtualizationVirtualMachinesDelete virtualization virtual machines delete API +*/ +func (a *Client) VirtualizationVirtualMachinesDelete(params *VirtualizationVirtualMachinesDeleteParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesDeleteNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesDeleteParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_delete", + Method: "DELETE", + PathPattern: "/virtualization/virtual-machines/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesDeleteReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesDeleteNoContent), nil + +} + +/* +VirtualizationVirtualMachinesList virtualization virtual machines list API +*/ +func (a *Client) VirtualizationVirtualMachinesList(params *VirtualizationVirtualMachinesListParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesListOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesListParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_list", + Method: "GET", + PathPattern: "/virtualization/virtual-machines/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesListReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesListOK), nil + +} + +/* +VirtualizationVirtualMachinesPartialUpdate virtualization virtual machines partial update API +*/ +func (a *Client) VirtualizationVirtualMachinesPartialUpdate(params *VirtualizationVirtualMachinesPartialUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesPartialUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesPartialUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_partial_update", + Method: "PATCH", + PathPattern: "/virtualization/virtual-machines/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesPartialUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesPartialUpdateOK), nil + +} + +/* +VirtualizationVirtualMachinesRead virtualization virtual machines read API +*/ +func (a *Client) VirtualizationVirtualMachinesRead(params *VirtualizationVirtualMachinesReadParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesReadOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesReadParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_read", + Method: "GET", + PathPattern: "/virtualization/virtual-machines/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesReadReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesReadOK), nil + +} + +/* +VirtualizationVirtualMachinesUpdate virtualization virtual machines update API +*/ +func (a *Client) VirtualizationVirtualMachinesUpdate(params *VirtualizationVirtualMachinesUpdateParams, authInfo runtime.ClientAuthInfoWriter) (*VirtualizationVirtualMachinesUpdateOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewVirtualizationVirtualMachinesUpdateParams() + } + + result, err := a.transport.Submit(&runtime.ClientOperation{ + ID: "virtualization_virtual-machines_update", + Method: "PUT", + PathPattern: "/virtualization/virtual-machines/{id}/", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &VirtualizationVirtualMachinesUpdateReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + }) + if err != nil { + return nil, err + } + return result.(*VirtualizationVirtualMachinesUpdateOK), nil + +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a145b2c192c7394944503bfe8e27f406ef4fef27 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterGroupsCreateParams creates a new VirtualizationClusterGroupsCreateParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsCreateParams() *VirtualizationClusterGroupsCreateParams { + var () + return &VirtualizationClusterGroupsCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsCreateParamsWithTimeout creates a new VirtualizationClusterGroupsCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsCreateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsCreateParams { + var () + return &VirtualizationClusterGroupsCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsCreateParamsWithContext creates a new VirtualizationClusterGroupsCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsCreateParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsCreateParams { + var () + return &VirtualizationClusterGroupsCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsCreateParamsWithHTTPClient creates a new VirtualizationClusterGroupsCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsCreateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsCreateParams { + var () + return &VirtualizationClusterGroupsCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsCreateParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups create operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsCreateParams struct { + + /*Data*/ + Data *models.ClusterGroup + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) WithData(data *models.ClusterGroup) *VirtualizationClusterGroupsCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster groups create params +func (o *VirtualizationClusterGroupsCreateParams) SetData(data *models.ClusterGroup) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsCreateParams) 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/virtualization/virtualization_cluster_groups_create_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..87869493f1903f14a6c2410a0195c35abd0116ec --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterGroupsCreateReader is a Reader for the VirtualizationClusterGroupsCreate structure. +type VirtualizationClusterGroupsCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationClusterGroupsCreateCreated() + 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()) + } +} + +// NewVirtualizationClusterGroupsCreateCreated creates a VirtualizationClusterGroupsCreateCreated with default headers values +func NewVirtualizationClusterGroupsCreateCreated() *VirtualizationClusterGroupsCreateCreated { + return &VirtualizationClusterGroupsCreateCreated{} +} + +/*VirtualizationClusterGroupsCreateCreated handles this case with default header values. + +VirtualizationClusterGroupsCreateCreated virtualization cluster groups create created +*/ +type VirtualizationClusterGroupsCreateCreated struct { + Payload *models.ClusterGroup +} + +func (o *VirtualizationClusterGroupsCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/cluster-groups/][%d] virtualizationClusterGroupsCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationClusterGroupsCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..916505eeb1e937837bd5a465e2fdf821f0209662 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterGroupsDeleteParams creates a new VirtualizationClusterGroupsDeleteParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsDeleteParams() *VirtualizationClusterGroupsDeleteParams { + var () + return &VirtualizationClusterGroupsDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsDeleteParamsWithTimeout creates a new VirtualizationClusterGroupsDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsDeleteParams { + var () + return &VirtualizationClusterGroupsDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsDeleteParamsWithContext creates a new VirtualizationClusterGroupsDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsDeleteParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsDeleteParams { + var () + return &VirtualizationClusterGroupsDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsDeleteParamsWithHTTPClient creates a new VirtualizationClusterGroupsDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsDeleteParams { + var () + return &VirtualizationClusterGroupsDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsDeleteParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups delete operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsDeleteParams struct { + + /*ID + A unique integer value identifying this cluster group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) WithID(id int64) *VirtualizationClusterGroupsDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups delete params +func (o *VirtualizationClusterGroupsDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsDeleteParams) 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/virtualization/virtualization_cluster_groups_delete_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..eadf4a6ae137e7a94385416c29a15bf99af697d5 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterGroupsDeleteReader is a Reader for the VirtualizationClusterGroupsDelete structure. +type VirtualizationClusterGroupsDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationClusterGroupsDeleteNoContent() + 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()) + } +} + +// NewVirtualizationClusterGroupsDeleteNoContent creates a VirtualizationClusterGroupsDeleteNoContent with default headers values +func NewVirtualizationClusterGroupsDeleteNoContent() *VirtualizationClusterGroupsDeleteNoContent { + return &VirtualizationClusterGroupsDeleteNoContent{} +} + +/*VirtualizationClusterGroupsDeleteNoContent handles this case with default header values. + +VirtualizationClusterGroupsDeleteNoContent virtualization cluster groups delete no content +*/ +type VirtualizationClusterGroupsDeleteNoContent struct { +} + +func (o *VirtualizationClusterGroupsDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/cluster-groups/{id}/][%d] virtualizationClusterGroupsDeleteNoContent ", 204) +} + +func (o *VirtualizationClusterGroupsDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..12050ff74d483082c5f031d017fe8264f9883e99 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_list_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterGroupsListParams creates a new VirtualizationClusterGroupsListParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsListParams() *VirtualizationClusterGroupsListParams { + var () + return &VirtualizationClusterGroupsListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsListParamsWithTimeout creates a new VirtualizationClusterGroupsListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsListParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsListParams { + var () + return &VirtualizationClusterGroupsListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsListParamsWithContext creates a new VirtualizationClusterGroupsListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsListParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsListParams { + var () + return &VirtualizationClusterGroupsListParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsListParamsWithHTTPClient creates a new VirtualizationClusterGroupsListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsListParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsListParams { + var () + return &VirtualizationClusterGroupsListParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsListParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups list operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsListParams 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 virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithLimit(limit *int64) *VirtualizationClusterGroupsListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) WithOffset(offset *int64) *VirtualizationClusterGroupsListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization cluster groups list params +func (o *VirtualizationClusterGroupsListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsListParams) 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/virtualization/virtualization_cluster_groups_list_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..46b9184e9c930bf2306a27dc2d573fe9b9c18590 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterGroupsListReader is a Reader for the VirtualizationClusterGroupsList structure. +type VirtualizationClusterGroupsListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterGroupsListOK() + 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()) + } +} + +// NewVirtualizationClusterGroupsListOK creates a VirtualizationClusterGroupsListOK with default headers values +func NewVirtualizationClusterGroupsListOK() *VirtualizationClusterGroupsListOK { + return &VirtualizationClusterGroupsListOK{} +} + +/*VirtualizationClusterGroupsListOK handles this case with default header values. + +VirtualizationClusterGroupsListOK virtualization cluster groups list o k +*/ +type VirtualizationClusterGroupsListOK struct { + Payload *models.VirtualizationClusterGroupsListOKBody +} + +func (o *VirtualizationClusterGroupsListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/cluster-groups/][%d] virtualizationClusterGroupsListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterGroupsListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationClusterGroupsListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..8e670e7c1060e393a8aa642dff0fa7cdc47ab90e --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterGroupsPartialUpdateParams creates a new VirtualizationClusterGroupsPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsPartialUpdateParams() *VirtualizationClusterGroupsPartialUpdateParams { + var () + return &VirtualizationClusterGroupsPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsPartialUpdateParamsWithTimeout creates a new VirtualizationClusterGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsPartialUpdateParams { + var () + return &VirtualizationClusterGroupsPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsPartialUpdateParamsWithContext creates a new VirtualizationClusterGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsPartialUpdateParams { + var () + return &VirtualizationClusterGroupsPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsPartialUpdateParamsWithHTTPClient creates a new VirtualizationClusterGroupsPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsPartialUpdateParams { + var () + return &VirtualizationClusterGroupsPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups partial update operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsPartialUpdateParams struct { + + /*Data*/ + Data *models.ClusterGroup + /*ID + A unique integer value identifying this cluster group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithData(data *models.ClusterGroup) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetData(data *models.ClusterGroup) { + o.Data = data +} + +// WithID adds the id to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) WithID(id int64) *VirtualizationClusterGroupsPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups partial update params +func (o *VirtualizationClusterGroupsPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsPartialUpdateParams) 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/virtualization/virtualization_cluster_groups_partial_update_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..5c4ed6bc3c12d595311299748afdbe2a74c0effe --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterGroupsPartialUpdateReader is a Reader for the VirtualizationClusterGroupsPartialUpdate structure. +type VirtualizationClusterGroupsPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterGroupsPartialUpdateOK() + 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()) + } +} + +// NewVirtualizationClusterGroupsPartialUpdateOK creates a VirtualizationClusterGroupsPartialUpdateOK with default headers values +func NewVirtualizationClusterGroupsPartialUpdateOK() *VirtualizationClusterGroupsPartialUpdateOK { + return &VirtualizationClusterGroupsPartialUpdateOK{} +} + +/*VirtualizationClusterGroupsPartialUpdateOK handles this case with default header values. + +VirtualizationClusterGroupsPartialUpdateOK virtualization cluster groups partial update o k +*/ +type VirtualizationClusterGroupsPartialUpdateOK struct { + Payload *models.ClusterGroup +} + +func (o *VirtualizationClusterGroupsPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/cluster-groups/{id}/][%d] virtualizationClusterGroupsPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterGroupsPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..6c08465d0aac290026b42c35e30ad9770fc0c700 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterGroupsReadParams creates a new VirtualizationClusterGroupsReadParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsReadParams() *VirtualizationClusterGroupsReadParams { + var () + return &VirtualizationClusterGroupsReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsReadParamsWithTimeout creates a new VirtualizationClusterGroupsReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsReadParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsReadParams { + var () + return &VirtualizationClusterGroupsReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsReadParamsWithContext creates a new VirtualizationClusterGroupsReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsReadParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsReadParams { + var () + return &VirtualizationClusterGroupsReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsReadParamsWithHTTPClient creates a new VirtualizationClusterGroupsReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsReadParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsReadParams { + var () + return &VirtualizationClusterGroupsReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsReadParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups read operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsReadParams struct { + + /*ID + A unique integer value identifying this cluster group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) WithID(id int64) *VirtualizationClusterGroupsReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups read params +func (o *VirtualizationClusterGroupsReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsReadParams) 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/virtualization/virtualization_cluster_groups_read_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..7b79c8453417c6ecf71f736d78e689e57cad15c7 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterGroupsReadReader is a Reader for the VirtualizationClusterGroupsRead structure. +type VirtualizationClusterGroupsReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterGroupsReadOK() + 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()) + } +} + +// NewVirtualizationClusterGroupsReadOK creates a VirtualizationClusterGroupsReadOK with default headers values +func NewVirtualizationClusterGroupsReadOK() *VirtualizationClusterGroupsReadOK { + return &VirtualizationClusterGroupsReadOK{} +} + +/*VirtualizationClusterGroupsReadOK handles this case with default header values. + +VirtualizationClusterGroupsReadOK virtualization cluster groups read o k +*/ +type VirtualizationClusterGroupsReadOK struct { + Payload *models.ClusterGroup +} + +func (o *VirtualizationClusterGroupsReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/cluster-groups/{id}/][%d] virtualizationClusterGroupsReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterGroupsReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go b/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c1300f362b3038f113882d791b45a47571dc25fb --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterGroupsUpdateParams creates a new VirtualizationClusterGroupsUpdateParams object +// with the default values initialized. +func NewVirtualizationClusterGroupsUpdateParams() *VirtualizationClusterGroupsUpdateParams { + var () + return &VirtualizationClusterGroupsUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterGroupsUpdateParamsWithTimeout creates a new VirtualizationClusterGroupsUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterGroupsUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterGroupsUpdateParams { + var () + return &VirtualizationClusterGroupsUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterGroupsUpdateParamsWithContext creates a new VirtualizationClusterGroupsUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterGroupsUpdateParamsWithContext(ctx context.Context) *VirtualizationClusterGroupsUpdateParams { + var () + return &VirtualizationClusterGroupsUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterGroupsUpdateParamsWithHTTPClient creates a new VirtualizationClusterGroupsUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterGroupsUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterGroupsUpdateParams { + var () + return &VirtualizationClusterGroupsUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterGroupsUpdateParams contains all the parameters to send to the API endpoint +for the virtualization cluster groups update operation typically these are written to a http.Request +*/ +type VirtualizationClusterGroupsUpdateParams struct { + + /*Data*/ + Data *models.ClusterGroup + /*ID + A unique integer value identifying this cluster group. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterGroupsUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithContext(ctx context.Context) *VirtualizationClusterGroupsUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterGroupsUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithData(data *models.ClusterGroup) *VirtualizationClusterGroupsUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetData(data *models.ClusterGroup) { + o.Data = data +} + +// WithID adds the id to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) WithID(id int64) *VirtualizationClusterGroupsUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster groups update params +func (o *VirtualizationClusterGroupsUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterGroupsUpdateParams) 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/virtualization/virtualization_cluster_groups_update_responses.go b/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..edc994ad0285bdc54fed621c07009880441d04c4 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_groups_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterGroupsUpdateReader is a Reader for the VirtualizationClusterGroupsUpdate structure. +type VirtualizationClusterGroupsUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterGroupsUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterGroupsUpdateOK() + 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()) + } +} + +// NewVirtualizationClusterGroupsUpdateOK creates a VirtualizationClusterGroupsUpdateOK with default headers values +func NewVirtualizationClusterGroupsUpdateOK() *VirtualizationClusterGroupsUpdateOK { + return &VirtualizationClusterGroupsUpdateOK{} +} + +/*VirtualizationClusterGroupsUpdateOK handles this case with default header values. + +VirtualizationClusterGroupsUpdateOK virtualization cluster groups update o k +*/ +type VirtualizationClusterGroupsUpdateOK struct { + Payload *models.ClusterGroup +} + +func (o *VirtualizationClusterGroupsUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/cluster-groups/{id}/][%d] virtualizationClusterGroupsUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterGroupsUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterGroup) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d6b9efd043c6b11c9a20637d85a82355046a0607 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterTypesCreateParams creates a new VirtualizationClusterTypesCreateParams object +// with the default values initialized. +func NewVirtualizationClusterTypesCreateParams() *VirtualizationClusterTypesCreateParams { + var () + return &VirtualizationClusterTypesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesCreateParamsWithTimeout creates a new VirtualizationClusterTypesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesCreateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesCreateParams { + var () + return &VirtualizationClusterTypesCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesCreateParamsWithContext creates a new VirtualizationClusterTypesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesCreateParamsWithContext(ctx context.Context) *VirtualizationClusterTypesCreateParams { + var () + return &VirtualizationClusterTypesCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesCreateParamsWithHTTPClient creates a new VirtualizationClusterTypesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesCreateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesCreateParams { + var () + return &VirtualizationClusterTypesCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesCreateParams contains all the parameters to send to the API endpoint +for the virtualization cluster types create operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesCreateParams struct { + + /*Data*/ + Data *models.ClusterType + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) WithContext(ctx context.Context) *VirtualizationClusterTypesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) WithData(data *models.ClusterType) *VirtualizationClusterTypesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster types create params +func (o *VirtualizationClusterTypesCreateParams) SetData(data *models.ClusterType) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesCreateParams) 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/virtualization/virtualization_cluster_types_create_responses.go b/netbox/client/virtualization/virtualization_cluster_types_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bf9afc986fdcfa07b1cb5f6225cb4cc45d0a5128 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterTypesCreateReader is a Reader for the VirtualizationClusterTypesCreate structure. +type VirtualizationClusterTypesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationClusterTypesCreateCreated() + 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()) + } +} + +// NewVirtualizationClusterTypesCreateCreated creates a VirtualizationClusterTypesCreateCreated with default headers values +func NewVirtualizationClusterTypesCreateCreated() *VirtualizationClusterTypesCreateCreated { + return &VirtualizationClusterTypesCreateCreated{} +} + +/*VirtualizationClusterTypesCreateCreated handles this case with default header values. + +VirtualizationClusterTypesCreateCreated virtualization cluster types create created +*/ +type VirtualizationClusterTypesCreateCreated struct { + Payload *models.ClusterType +} + +func (o *VirtualizationClusterTypesCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/cluster-types/][%d] virtualizationClusterTypesCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationClusterTypesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..55a198dbb17bd484cb205f1908a3615fa439035c --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterTypesDeleteParams creates a new VirtualizationClusterTypesDeleteParams object +// with the default values initialized. +func NewVirtualizationClusterTypesDeleteParams() *VirtualizationClusterTypesDeleteParams { + var () + return &VirtualizationClusterTypesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesDeleteParamsWithTimeout creates a new VirtualizationClusterTypesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesDeleteParams { + var () + return &VirtualizationClusterTypesDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesDeleteParamsWithContext creates a new VirtualizationClusterTypesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesDeleteParamsWithContext(ctx context.Context) *VirtualizationClusterTypesDeleteParams { + var () + return &VirtualizationClusterTypesDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesDeleteParamsWithHTTPClient creates a new VirtualizationClusterTypesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesDeleteParams { + var () + return &VirtualizationClusterTypesDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesDeleteParams contains all the parameters to send to the API endpoint +for the virtualization cluster types delete operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesDeleteParams struct { + + /*ID + A unique integer value identifying this cluster type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) WithContext(ctx context.Context) *VirtualizationClusterTypesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) WithID(id int64) *VirtualizationClusterTypesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types delete params +func (o *VirtualizationClusterTypesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesDeleteParams) 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/virtualization/virtualization_cluster_types_delete_responses.go b/netbox/client/virtualization/virtualization_cluster_types_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..27c23323f57202d5253e04fb1fa6831106f631a5 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterTypesDeleteReader is a Reader for the VirtualizationClusterTypesDelete structure. +type VirtualizationClusterTypesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationClusterTypesDeleteNoContent() + 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()) + } +} + +// NewVirtualizationClusterTypesDeleteNoContent creates a VirtualizationClusterTypesDeleteNoContent with default headers values +func NewVirtualizationClusterTypesDeleteNoContent() *VirtualizationClusterTypesDeleteNoContent { + return &VirtualizationClusterTypesDeleteNoContent{} +} + +/*VirtualizationClusterTypesDeleteNoContent handles this case with default header values. + +VirtualizationClusterTypesDeleteNoContent virtualization cluster types delete no content +*/ +type VirtualizationClusterTypesDeleteNoContent struct { +} + +func (o *VirtualizationClusterTypesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/cluster-types/{id}/][%d] virtualizationClusterTypesDeleteNoContent ", 204) +} + +func (o *VirtualizationClusterTypesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..be2cd2dd63d13312d704af7ca1ac440d2888c52e --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_list_parameters.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterTypesListParams creates a new VirtualizationClusterTypesListParams object +// with the default values initialized. +func NewVirtualizationClusterTypesListParams() *VirtualizationClusterTypesListParams { + var () + return &VirtualizationClusterTypesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesListParamsWithTimeout creates a new VirtualizationClusterTypesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesListParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesListParams { + var () + return &VirtualizationClusterTypesListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesListParamsWithContext creates a new VirtualizationClusterTypesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesListParamsWithContext(ctx context.Context) *VirtualizationClusterTypesListParams { + var () + return &VirtualizationClusterTypesListParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesListParamsWithHTTPClient creates a new VirtualizationClusterTypesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesListParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesListParams { + var () + return &VirtualizationClusterTypesListParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesListParams contains all the parameters to send to the API endpoint +for the virtualization cluster types list operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesListParams 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 virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithContext(ctx context.Context) *VirtualizationClusterTypesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLimit adds the limit to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithLimit(limit *int64) *VirtualizationClusterTypesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithOffset adds the offset to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) WithOffset(offset *int64) *VirtualizationClusterTypesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization cluster types list params +func (o *VirtualizationClusterTypesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesListParams) 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/virtualization/virtualization_cluster_types_list_responses.go b/netbox/client/virtualization/virtualization_cluster_types_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..d992c89464224ec8a75871845c193ea32dbb479a --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterTypesListReader is a Reader for the VirtualizationClusterTypesList structure. +type VirtualizationClusterTypesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterTypesListOK() + 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()) + } +} + +// NewVirtualizationClusterTypesListOK creates a VirtualizationClusterTypesListOK with default headers values +func NewVirtualizationClusterTypesListOK() *VirtualizationClusterTypesListOK { + return &VirtualizationClusterTypesListOK{} +} + +/*VirtualizationClusterTypesListOK handles this case with default header values. + +VirtualizationClusterTypesListOK virtualization cluster types list o k +*/ +type VirtualizationClusterTypesListOK struct { + Payload *models.VirtualizationClusterTypesListOKBody +} + +func (o *VirtualizationClusterTypesListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/cluster-types/][%d] virtualizationClusterTypesListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterTypesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationClusterTypesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..9ecaa561c1e05bcfd80950e208c82932b4f292d4 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterTypesPartialUpdateParams creates a new VirtualizationClusterTypesPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationClusterTypesPartialUpdateParams() *VirtualizationClusterTypesPartialUpdateParams { + var () + return &VirtualizationClusterTypesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesPartialUpdateParamsWithTimeout creates a new VirtualizationClusterTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesPartialUpdateParams { + var () + return &VirtualizationClusterTypesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesPartialUpdateParamsWithContext creates a new VirtualizationClusterTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationClusterTypesPartialUpdateParams { + var () + return &VirtualizationClusterTypesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesPartialUpdateParamsWithHTTPClient creates a new VirtualizationClusterTypesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesPartialUpdateParams { + var () + return &VirtualizationClusterTypesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization cluster types partial update operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesPartialUpdateParams struct { + + /*Data*/ + Data *models.ClusterType + /*ID + A unique integer value identifying this cluster type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationClusterTypesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithData(data *models.ClusterType) *VirtualizationClusterTypesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetData(data *models.ClusterType) { + o.Data = data +} + +// WithID adds the id to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) WithID(id int64) *VirtualizationClusterTypesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types partial update params +func (o *VirtualizationClusterTypesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesPartialUpdateParams) 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/virtualization/virtualization_cluster_types_partial_update_responses.go b/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9e411da2d254310624b55e597075990f324b52c0 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterTypesPartialUpdateReader is a Reader for the VirtualizationClusterTypesPartialUpdate structure. +type VirtualizationClusterTypesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterTypesPartialUpdateOK() + 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()) + } +} + +// NewVirtualizationClusterTypesPartialUpdateOK creates a VirtualizationClusterTypesPartialUpdateOK with default headers values +func NewVirtualizationClusterTypesPartialUpdateOK() *VirtualizationClusterTypesPartialUpdateOK { + return &VirtualizationClusterTypesPartialUpdateOK{} +} + +/*VirtualizationClusterTypesPartialUpdateOK handles this case with default header values. + +VirtualizationClusterTypesPartialUpdateOK virtualization cluster types partial update o k +*/ +type VirtualizationClusterTypesPartialUpdateOK struct { + Payload *models.ClusterType +} + +func (o *VirtualizationClusterTypesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/cluster-types/{id}/][%d] virtualizationClusterTypesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterTypesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..e511827b18be0688906f8c928f30a75b0454a6d8 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterTypesReadParams creates a new VirtualizationClusterTypesReadParams object +// with the default values initialized. +func NewVirtualizationClusterTypesReadParams() *VirtualizationClusterTypesReadParams { + var () + return &VirtualizationClusterTypesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesReadParamsWithTimeout creates a new VirtualizationClusterTypesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesReadParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesReadParams { + var () + return &VirtualizationClusterTypesReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesReadParamsWithContext creates a new VirtualizationClusterTypesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesReadParamsWithContext(ctx context.Context) *VirtualizationClusterTypesReadParams { + var () + return &VirtualizationClusterTypesReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesReadParamsWithHTTPClient creates a new VirtualizationClusterTypesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesReadParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesReadParams { + var () + return &VirtualizationClusterTypesReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesReadParams contains all the parameters to send to the API endpoint +for the virtualization cluster types read operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesReadParams struct { + + /*ID + A unique integer value identifying this cluster type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) WithContext(ctx context.Context) *VirtualizationClusterTypesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) WithID(id int64) *VirtualizationClusterTypesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types read params +func (o *VirtualizationClusterTypesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesReadParams) 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/virtualization/virtualization_cluster_types_read_responses.go b/netbox/client/virtualization/virtualization_cluster_types_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..83698319fffdcebff2a5496cce560745cb7856e2 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterTypesReadReader is a Reader for the VirtualizationClusterTypesRead structure. +type VirtualizationClusterTypesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterTypesReadOK() + 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()) + } +} + +// NewVirtualizationClusterTypesReadOK creates a VirtualizationClusterTypesReadOK with default headers values +func NewVirtualizationClusterTypesReadOK() *VirtualizationClusterTypesReadOK { + return &VirtualizationClusterTypesReadOK{} +} + +/*VirtualizationClusterTypesReadOK handles this case with default header values. + +VirtualizationClusterTypesReadOK virtualization cluster types read o k +*/ +type VirtualizationClusterTypesReadOK struct { + Payload *models.ClusterType +} + +func (o *VirtualizationClusterTypesReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/cluster-types/{id}/][%d] virtualizationClusterTypesReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterTypesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go b/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..f55a9695e38c2cae125d3a7cf805123897857525 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClusterTypesUpdateParams creates a new VirtualizationClusterTypesUpdateParams object +// with the default values initialized. +func NewVirtualizationClusterTypesUpdateParams() *VirtualizationClusterTypesUpdateParams { + var () + return &VirtualizationClusterTypesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClusterTypesUpdateParamsWithTimeout creates a new VirtualizationClusterTypesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClusterTypesUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClusterTypesUpdateParams { + var () + return &VirtualizationClusterTypesUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClusterTypesUpdateParamsWithContext creates a new VirtualizationClusterTypesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClusterTypesUpdateParamsWithContext(ctx context.Context) *VirtualizationClusterTypesUpdateParams { + var () + return &VirtualizationClusterTypesUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClusterTypesUpdateParamsWithHTTPClient creates a new VirtualizationClusterTypesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClusterTypesUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClusterTypesUpdateParams { + var () + return &VirtualizationClusterTypesUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClusterTypesUpdateParams contains all the parameters to send to the API endpoint +for the virtualization cluster types update operation typically these are written to a http.Request +*/ +type VirtualizationClusterTypesUpdateParams struct { + + /*Data*/ + Data *models.ClusterType + /*ID + A unique integer value identifying this cluster type. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClusterTypesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithContext(ctx context.Context) *VirtualizationClusterTypesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClusterTypesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithData(data *models.ClusterType) *VirtualizationClusterTypesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetData(data *models.ClusterType) { + o.Data = data +} + +// WithID adds the id to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) WithID(id int64) *VirtualizationClusterTypesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization cluster types update params +func (o *VirtualizationClusterTypesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClusterTypesUpdateParams) 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/virtualization/virtualization_cluster_types_update_responses.go b/netbox/client/virtualization/virtualization_cluster_types_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8704a2a163f6b58f61533f8aa176e35da0206ca4 --- /dev/null +++ b/netbox/client/virtualization/virtualization_cluster_types_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClusterTypesUpdateReader is a Reader for the VirtualizationClusterTypesUpdate structure. +type VirtualizationClusterTypesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClusterTypesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClusterTypesUpdateOK() + 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()) + } +} + +// NewVirtualizationClusterTypesUpdateOK creates a VirtualizationClusterTypesUpdateOK with default headers values +func NewVirtualizationClusterTypesUpdateOK() *VirtualizationClusterTypesUpdateOK { + return &VirtualizationClusterTypesUpdateOK{} +} + +/*VirtualizationClusterTypesUpdateOK handles this case with default header values. + +VirtualizationClusterTypesUpdateOK virtualization cluster types update o k +*/ +type VirtualizationClusterTypesUpdateOK struct { + Payload *models.ClusterType +} + +func (o *VirtualizationClusterTypesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/cluster-types/{id}/][%d] virtualizationClusterTypesUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClusterTypesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.ClusterType) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_clusters_create_parameters.go b/netbox/client/virtualization/virtualization_clusters_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5a7347ccff4975602e5976abe7afa15c484a5fb6 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClustersCreateParams creates a new VirtualizationClustersCreateParams object +// with the default values initialized. +func NewVirtualizationClustersCreateParams() *VirtualizationClustersCreateParams { + var () + return &VirtualizationClustersCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersCreateParamsWithTimeout creates a new VirtualizationClustersCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersCreateParamsWithTimeout(timeout time.Duration) *VirtualizationClustersCreateParams { + var () + return &VirtualizationClustersCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersCreateParamsWithContext creates a new VirtualizationClustersCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersCreateParamsWithContext(ctx context.Context) *VirtualizationClustersCreateParams { + var () + return &VirtualizationClustersCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersCreateParamsWithHTTPClient creates a new VirtualizationClustersCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersCreateParamsWithHTTPClient(client *http.Client) *VirtualizationClustersCreateParams { + var () + return &VirtualizationClustersCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersCreateParams contains all the parameters to send to the API endpoint +for the virtualization clusters create operation typically these are written to a http.Request +*/ +type VirtualizationClustersCreateParams struct { + + /*Data*/ + Data *models.WritableCluster + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) WithTimeout(timeout time.Duration) *VirtualizationClustersCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) WithContext(ctx context.Context) *VirtualizationClustersCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) WithHTTPClient(client *http.Client) *VirtualizationClustersCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) WithData(data *models.WritableCluster) *VirtualizationClustersCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization clusters create params +func (o *VirtualizationClustersCreateParams) SetData(data *models.WritableCluster) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersCreateParams) 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/virtualization/virtualization_clusters_create_responses.go b/netbox/client/virtualization/virtualization_clusters_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..b5ff6b46b2b9e659ec7d07058b7ad2f26610b218 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClustersCreateReader is a Reader for the VirtualizationClustersCreate structure. +type VirtualizationClustersCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationClustersCreateCreated() + 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()) + } +} + +// NewVirtualizationClustersCreateCreated creates a VirtualizationClustersCreateCreated with default headers values +func NewVirtualizationClustersCreateCreated() *VirtualizationClustersCreateCreated { + return &VirtualizationClustersCreateCreated{} +} + +/*VirtualizationClustersCreateCreated handles this case with default header values. + +VirtualizationClustersCreateCreated virtualization clusters create created +*/ +type VirtualizationClustersCreateCreated struct { + Payload *models.WritableCluster +} + +func (o *VirtualizationClustersCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/clusters/][%d] virtualizationClustersCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationClustersCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_clusters_delete_parameters.go b/netbox/client/virtualization/virtualization_clusters_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ad9cbd6be71cfeffb0b4ff688ae951a3acbf2642 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClustersDeleteParams creates a new VirtualizationClustersDeleteParams object +// with the default values initialized. +func NewVirtualizationClustersDeleteParams() *VirtualizationClustersDeleteParams { + var () + return &VirtualizationClustersDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersDeleteParamsWithTimeout creates a new VirtualizationClustersDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationClustersDeleteParams { + var () + return &VirtualizationClustersDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersDeleteParamsWithContext creates a new VirtualizationClustersDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersDeleteParamsWithContext(ctx context.Context) *VirtualizationClustersDeleteParams { + var () + return &VirtualizationClustersDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersDeleteParamsWithHTTPClient creates a new VirtualizationClustersDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationClustersDeleteParams { + var () + return &VirtualizationClustersDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersDeleteParams contains all the parameters to send to the API endpoint +for the virtualization clusters delete operation typically these are written to a http.Request +*/ +type VirtualizationClustersDeleteParams struct { + + /*ID + A unique integer value identifying this cluster. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationClustersDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) WithContext(ctx context.Context) *VirtualizationClustersDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationClustersDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) WithID(id int64) *VirtualizationClustersDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization clusters delete params +func (o *VirtualizationClustersDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersDeleteParams) 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/virtualization/virtualization_clusters_delete_responses.go b/netbox/client/virtualization/virtualization_clusters_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..8665e9f2d32794c9339db9f97b7a6795d391bea5 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClustersDeleteReader is a Reader for the VirtualizationClustersDelete structure. +type VirtualizationClustersDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationClustersDeleteNoContent() + 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()) + } +} + +// NewVirtualizationClustersDeleteNoContent creates a VirtualizationClustersDeleteNoContent with default headers values +func NewVirtualizationClustersDeleteNoContent() *VirtualizationClustersDeleteNoContent { + return &VirtualizationClustersDeleteNoContent{} +} + +/*VirtualizationClustersDeleteNoContent handles this case with default header values. + +VirtualizationClustersDeleteNoContent virtualization clusters delete no content +*/ +type VirtualizationClustersDeleteNoContent struct { +} + +func (o *VirtualizationClustersDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/clusters/{id}/][%d] virtualizationClustersDeleteNoContent ", 204) +} + +func (o *VirtualizationClustersDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/virtualization/virtualization_clusters_list_parameters.go b/netbox/client/virtualization/virtualization_clusters_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..de245067a79c77190dc8634c6bdfffd370a6a613 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_list_parameters.go @@ -0,0 +1,445 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClustersListParams creates a new VirtualizationClustersListParams object +// with the default values initialized. +func NewVirtualizationClustersListParams() *VirtualizationClustersListParams { + var () + return &VirtualizationClustersListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersListParamsWithTimeout creates a new VirtualizationClustersListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersListParamsWithTimeout(timeout time.Duration) *VirtualizationClustersListParams { + var () + return &VirtualizationClustersListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersListParamsWithContext creates a new VirtualizationClustersListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersListParamsWithContext(ctx context.Context) *VirtualizationClustersListParams { + var () + return &VirtualizationClustersListParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersListParamsWithHTTPClient creates a new VirtualizationClustersListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersListParamsWithHTTPClient(client *http.Client) *VirtualizationClustersListParams { + var () + return &VirtualizationClustersListParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersListParams contains all the parameters to send to the API endpoint +for the virtualization clusters list operation typically these are written to a http.Request +*/ +type VirtualizationClustersListParams struct { + + /*Group*/ + Group *string + /*GroupID*/ + GroupID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Q*/ + Q *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Type*/ + Type *string + /*TypeID*/ + TypeID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithTimeout(timeout time.Duration) *VirtualizationClustersListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithContext(ctx context.Context) *VirtualizationClustersListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithHTTPClient(client *http.Client) *VirtualizationClustersListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithGroup adds the group to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithGroup(group *string) *VirtualizationClustersListParams { + o.SetGroup(group) + return o +} + +// SetGroup adds the group to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetGroup(group *string) { + o.Group = group +} + +// WithGroupID adds the groupID to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithGroupID(groupID *string) *VirtualizationClustersListParams { + o.SetGroupID(groupID) + return o +} + +// SetGroupID adds the groupId to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetGroupID(groupID *string) { + o.GroupID = groupID +} + +// WithIDIn adds the iDIn to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithIDIn(iDIn *float64) *VirtualizationClustersListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithLimit(limit *int64) *VirtualizationClustersListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithName(name *string) *VirtualizationClustersListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithOffset(offset *int64) *VirtualizationClustersListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithQ adds the q to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithQ(q *string) *VirtualizationClustersListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetQ(q *string) { + o.Q = q +} + +// WithSite adds the site to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithSite(site *string) *VirtualizationClustersListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithSiteID(siteID *string) *VirtualizationClustersListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithType adds the typeVar to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithType(typeVar *string) *VirtualizationClustersListParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WithTypeID adds the typeID to the virtualization clusters list params +func (o *VirtualizationClustersListParams) WithTypeID(typeID *string) *VirtualizationClustersListParams { + o.SetTypeID(typeID) + return o +} + +// SetTypeID adds the typeId to the virtualization clusters list params +func (o *VirtualizationClustersListParams) SetTypeID(typeID *string) { + o.TypeID = typeID +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Group != nil { + + // query param group + var qrGroup string + if o.Group != nil { + qrGroup = *o.Group + } + qGroup := qrGroup + if qGroup != "" { + if err := r.SetQueryParam("group", qGroup); err != nil { + return err + } + } + + } + + if o.GroupID != nil { + + // query param group_id + var qrGroupID string + if o.GroupID != nil { + qrGroupID = *o.GroupID + } + qGroupID := qrGroupID + if qGroupID != "" { + if err := r.SetQueryParam("group_id", qGroupID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.Type != nil { + + // query param type + var qrType string + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + + } + + if o.TypeID != nil { + + // query param type_id + var qrTypeID string + if o.TypeID != nil { + qrTypeID = *o.TypeID + } + qTypeID := qrTypeID + if qTypeID != "" { + if err := r.SetQueryParam("type_id", qTypeID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/virtualization/virtualization_clusters_list_responses.go b/netbox/client/virtualization/virtualization_clusters_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..0d93f313aa1cc2a59abc6c530fbaf65730927404 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClustersListReader is a Reader for the VirtualizationClustersList structure. +type VirtualizationClustersListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClustersListOK() + 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()) + } +} + +// NewVirtualizationClustersListOK creates a VirtualizationClustersListOK with default headers values +func NewVirtualizationClustersListOK() *VirtualizationClustersListOK { + return &VirtualizationClustersListOK{} +} + +/*VirtualizationClustersListOK handles this case with default header values. + +VirtualizationClustersListOK virtualization clusters list o k +*/ +type VirtualizationClustersListOK struct { + Payload *models.VirtualizationClustersListOKBody +} + +func (o *VirtualizationClustersListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/clusters/][%d] virtualizationClustersListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClustersListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationClustersListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go b/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..1cbb6c487d81211d904d3ca46b9e1894e28ed1f6 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClustersPartialUpdateParams creates a new VirtualizationClustersPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationClustersPartialUpdateParams() *VirtualizationClustersPartialUpdateParams { + var () + return &VirtualizationClustersPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersPartialUpdateParamsWithTimeout creates a new VirtualizationClustersPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClustersPartialUpdateParams { + var () + return &VirtualizationClustersPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersPartialUpdateParamsWithContext creates a new VirtualizationClustersPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationClustersPartialUpdateParams { + var () + return &VirtualizationClustersPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersPartialUpdateParamsWithHTTPClient creates a new VirtualizationClustersPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClustersPartialUpdateParams { + var () + return &VirtualizationClustersPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization clusters partial update operation typically these are written to a http.Request +*/ +type VirtualizationClustersPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableCluster + /*ID + A unique integer value identifying this cluster. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClustersPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationClustersPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClustersPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithData(data *models.WritableCluster) *VirtualizationClustersPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetData(data *models.WritableCluster) { + o.Data = data +} + +// WithID adds the id to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) WithID(id int64) *VirtualizationClustersPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization clusters partial update params +func (o *VirtualizationClustersPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersPartialUpdateParams) 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/virtualization/virtualization_clusters_partial_update_responses.go b/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..bd52a9c018f4fdfb8842092fbd912e7f57b4070e --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClustersPartialUpdateReader is a Reader for the VirtualizationClustersPartialUpdate structure. +type VirtualizationClustersPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClustersPartialUpdateOK() + 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()) + } +} + +// NewVirtualizationClustersPartialUpdateOK creates a VirtualizationClustersPartialUpdateOK with default headers values +func NewVirtualizationClustersPartialUpdateOK() *VirtualizationClustersPartialUpdateOK { + return &VirtualizationClustersPartialUpdateOK{} +} + +/*VirtualizationClustersPartialUpdateOK handles this case with default header values. + +VirtualizationClustersPartialUpdateOK virtualization clusters partial update o k +*/ +type VirtualizationClustersPartialUpdateOK struct { + Payload *models.WritableCluster +} + +func (o *VirtualizationClustersPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/clusters/{id}/][%d] virtualizationClustersPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClustersPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_clusters_read_parameters.go b/netbox/client/virtualization/virtualization_clusters_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..10b48d23852a0e65cdbfeb0afa7c08926077acd5 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClustersReadParams creates a new VirtualizationClustersReadParams object +// with the default values initialized. +func NewVirtualizationClustersReadParams() *VirtualizationClustersReadParams { + var () + return &VirtualizationClustersReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersReadParamsWithTimeout creates a new VirtualizationClustersReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersReadParamsWithTimeout(timeout time.Duration) *VirtualizationClustersReadParams { + var () + return &VirtualizationClustersReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersReadParamsWithContext creates a new VirtualizationClustersReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersReadParamsWithContext(ctx context.Context) *VirtualizationClustersReadParams { + var () + return &VirtualizationClustersReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersReadParamsWithHTTPClient creates a new VirtualizationClustersReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersReadParamsWithHTTPClient(client *http.Client) *VirtualizationClustersReadParams { + var () + return &VirtualizationClustersReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersReadParams contains all the parameters to send to the API endpoint +for the virtualization clusters read operation typically these are written to a http.Request +*/ +type VirtualizationClustersReadParams struct { + + /*ID + A unique integer value identifying this cluster. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) WithTimeout(timeout time.Duration) *VirtualizationClustersReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) WithContext(ctx context.Context) *VirtualizationClustersReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) WithHTTPClient(client *http.Client) *VirtualizationClustersReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) WithID(id int64) *VirtualizationClustersReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization clusters read params +func (o *VirtualizationClustersReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersReadParams) 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/virtualization/virtualization_clusters_read_responses.go b/netbox/client/virtualization/virtualization_clusters_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..169a3b44b3970f6c50ea3caa76e6b53da78897e0 --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClustersReadReader is a Reader for the VirtualizationClustersRead structure. +type VirtualizationClustersReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClustersReadOK() + 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()) + } +} + +// NewVirtualizationClustersReadOK creates a VirtualizationClustersReadOK with default headers values +func NewVirtualizationClustersReadOK() *VirtualizationClustersReadOK { + return &VirtualizationClustersReadOK{} +} + +/*VirtualizationClustersReadOK handles this case with default header values. + +VirtualizationClustersReadOK virtualization clusters read o k +*/ +type VirtualizationClustersReadOK struct { + Payload *models.Cluster +} + +func (o *VirtualizationClustersReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/clusters/{id}/][%d] virtualizationClustersReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClustersReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Cluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_clusters_update_parameters.go b/netbox/client/virtualization/virtualization_clusters_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..efcf784d315f5d48fecac0adbaf3230a67dd3a7b --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationClustersUpdateParams creates a new VirtualizationClustersUpdateParams object +// with the default values initialized. +func NewVirtualizationClustersUpdateParams() *VirtualizationClustersUpdateParams { + var () + return &VirtualizationClustersUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationClustersUpdateParamsWithTimeout creates a new VirtualizationClustersUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationClustersUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationClustersUpdateParams { + var () + return &VirtualizationClustersUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationClustersUpdateParamsWithContext creates a new VirtualizationClustersUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationClustersUpdateParamsWithContext(ctx context.Context) *VirtualizationClustersUpdateParams { + var () + return &VirtualizationClustersUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationClustersUpdateParamsWithHTTPClient creates a new VirtualizationClustersUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationClustersUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationClustersUpdateParams { + var () + return &VirtualizationClustersUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationClustersUpdateParams contains all the parameters to send to the API endpoint +for the virtualization clusters update operation typically these are written to a http.Request +*/ +type VirtualizationClustersUpdateParams struct { + + /*Data*/ + Data *models.WritableCluster + /*ID + A unique integer value identifying this cluster. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationClustersUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithContext(ctx context.Context) *VirtualizationClustersUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationClustersUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithData(data *models.WritableCluster) *VirtualizationClustersUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetData(data *models.WritableCluster) { + o.Data = data +} + +// WithID adds the id to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) WithID(id int64) *VirtualizationClustersUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization clusters update params +func (o *VirtualizationClustersUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationClustersUpdateParams) 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/virtualization/virtualization_clusters_update_responses.go b/netbox/client/virtualization/virtualization_clusters_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..53606df4798a89a8b979b76d3b2f568564875f8c --- /dev/null +++ b/netbox/client/virtualization/virtualization_clusters_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationClustersUpdateReader is a Reader for the VirtualizationClustersUpdate structure. +type VirtualizationClustersUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationClustersUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationClustersUpdateOK() + 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()) + } +} + +// NewVirtualizationClustersUpdateOK creates a VirtualizationClustersUpdateOK with default headers values +func NewVirtualizationClustersUpdateOK() *VirtualizationClustersUpdateOK { + return &VirtualizationClustersUpdateOK{} +} + +/*VirtualizationClustersUpdateOK handles this case with default header values. + +VirtualizationClustersUpdateOK virtualization clusters update o k +*/ +type VirtualizationClustersUpdateOK struct { + Payload *models.WritableCluster +} + +func (o *VirtualizationClustersUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/clusters/{id}/][%d] virtualizationClustersUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationClustersUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableCluster) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_interfaces_create_parameters.go b/netbox/client/virtualization/virtualization_interfaces_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a6d91be27e335e858c1e7a8bc588471ad3a9b768 --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationInterfacesCreateParams creates a new VirtualizationInterfacesCreateParams object +// with the default values initialized. +func NewVirtualizationInterfacesCreateParams() *VirtualizationInterfacesCreateParams { + var () + return &VirtualizationInterfacesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesCreateParamsWithTimeout creates a new VirtualizationInterfacesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesCreateParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesCreateParams { + var () + return &VirtualizationInterfacesCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesCreateParamsWithContext creates a new VirtualizationInterfacesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesCreateParamsWithContext(ctx context.Context) *VirtualizationInterfacesCreateParams { + var () + return &VirtualizationInterfacesCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesCreateParamsWithHTTPClient creates a new VirtualizationInterfacesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesCreateParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesCreateParams { + var () + return &VirtualizationInterfacesCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesCreateParams contains all the parameters to send to the API endpoint +for the virtualization interfaces create operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesCreateParams struct { + + /*Data*/ + Data *models.WritableInterface + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) WithContext(ctx context.Context) *VirtualizationInterfacesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization interfaces create params +func (o *VirtualizationInterfacesCreateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesCreateParams) 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/virtualization/virtualization_interfaces_create_responses.go b/netbox/client/virtualization/virtualization_interfaces_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..c4dcb5589857d1185a73de210189bebe9e26ba0a --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationInterfacesCreateReader is a Reader for the VirtualizationInterfacesCreate structure. +type VirtualizationInterfacesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationInterfacesCreateCreated() + 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()) + } +} + +// NewVirtualizationInterfacesCreateCreated creates a VirtualizationInterfacesCreateCreated with default headers values +func NewVirtualizationInterfacesCreateCreated() *VirtualizationInterfacesCreateCreated { + return &VirtualizationInterfacesCreateCreated{} +} + +/*VirtualizationInterfacesCreateCreated handles this case with default header values. + +VirtualizationInterfacesCreateCreated virtualization interfaces create created +*/ +type VirtualizationInterfacesCreateCreated struct { + Payload *models.WritableInterface +} + +func (o *VirtualizationInterfacesCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/interfaces/][%d] virtualizationInterfacesCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationInterfacesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go b/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..93a63324574b863512394c74c6757973eeea87cf --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationInterfacesDeleteParams creates a new VirtualizationInterfacesDeleteParams object +// with the default values initialized. +func NewVirtualizationInterfacesDeleteParams() *VirtualizationInterfacesDeleteParams { + var () + return &VirtualizationInterfacesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesDeleteParamsWithTimeout creates a new VirtualizationInterfacesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesDeleteParams { + var () + return &VirtualizationInterfacesDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesDeleteParamsWithContext creates a new VirtualizationInterfacesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesDeleteParamsWithContext(ctx context.Context) *VirtualizationInterfacesDeleteParams { + var () + return &VirtualizationInterfacesDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesDeleteParamsWithHTTPClient creates a new VirtualizationInterfacesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesDeleteParams { + var () + return &VirtualizationInterfacesDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesDeleteParams contains all the parameters to send to the API endpoint +for the virtualization interfaces delete operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesDeleteParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) WithContext(ctx context.Context) *VirtualizationInterfacesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) WithID(id int64) *VirtualizationInterfacesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces delete params +func (o *VirtualizationInterfacesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesDeleteParams) 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/virtualization/virtualization_interfaces_delete_responses.go b/netbox/client/virtualization/virtualization_interfaces_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..dc6b6d2c4193e40dea67b4045ae60ebc1221d9ea --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationInterfacesDeleteReader is a Reader for the VirtualizationInterfacesDelete structure. +type VirtualizationInterfacesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationInterfacesDeleteNoContent() + 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()) + } +} + +// NewVirtualizationInterfacesDeleteNoContent creates a VirtualizationInterfacesDeleteNoContent with default headers values +func NewVirtualizationInterfacesDeleteNoContent() *VirtualizationInterfacesDeleteNoContent { + return &VirtualizationInterfacesDeleteNoContent{} +} + +/*VirtualizationInterfacesDeleteNoContent handles this case with default header values. + +VirtualizationInterfacesDeleteNoContent virtualization interfaces delete no content +*/ +type VirtualizationInterfacesDeleteNoContent struct { +} + +func (o *VirtualizationInterfacesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/interfaces/{id}/][%d] virtualizationInterfacesDeleteNoContent ", 204) +} + +func (o *VirtualizationInterfacesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/virtualization/virtualization_interfaces_list_parameters.go b/netbox/client/virtualization/virtualization_interfaces_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..3571dc2dec3374ec457e9d716ab725e04e1650ee --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_list_parameters.go @@ -0,0 +1,355 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationInterfacesListParams creates a new VirtualizationInterfacesListParams object +// with the default values initialized. +func NewVirtualizationInterfacesListParams() *VirtualizationInterfacesListParams { + var () + return &VirtualizationInterfacesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesListParamsWithTimeout creates a new VirtualizationInterfacesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesListParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesListParams { + var () + return &VirtualizationInterfacesListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesListParamsWithContext creates a new VirtualizationInterfacesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesListParamsWithContext(ctx context.Context) *VirtualizationInterfacesListParams { + var () + return &VirtualizationInterfacesListParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesListParamsWithHTTPClient creates a new VirtualizationInterfacesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesListParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesListParams { + var () + return &VirtualizationInterfacesListParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesListParams contains all the parameters to send to the API endpoint +for the virtualization interfaces list operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesListParams struct { + + /*Enabled*/ + Enabled *string + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*MacAddress*/ + MacAddress *string + /*Mtu*/ + Mtu *float64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*VirtualMachine*/ + VirtualMachine *string + /*VirtualMachineID*/ + VirtualMachineID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithContext(ctx context.Context) *VirtualizationInterfacesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithEnabled adds the enabled to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithEnabled(enabled *string) *VirtualizationInterfacesListParams { + o.SetEnabled(enabled) + return o +} + +// SetEnabled adds the enabled to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetEnabled(enabled *string) { + o.Enabled = enabled +} + +// WithLimit adds the limit to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithLimit(limit *int64) *VirtualizationInterfacesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithMacAddress adds the macAddress to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithMacAddress(macAddress *string) *VirtualizationInterfacesListParams { + o.SetMacAddress(macAddress) + return o +} + +// SetMacAddress adds the macAddress to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetMacAddress(macAddress *string) { + o.MacAddress = macAddress +} + +// WithMtu adds the mtu to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithMtu(mtu *float64) *VirtualizationInterfacesListParams { + o.SetMtu(mtu) + return o +} + +// SetMtu adds the mtu to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetMtu(mtu *float64) { + o.Mtu = mtu +} + +// WithName adds the name to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithName(name *string) *VirtualizationInterfacesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithOffset(offset *int64) *VirtualizationInterfacesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithVirtualMachine adds the virtualMachine to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithVirtualMachine(virtualMachine *string) *VirtualizationInterfacesListParams { + o.SetVirtualMachine(virtualMachine) + return o +} + +// SetVirtualMachine adds the virtualMachine to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetVirtualMachine(virtualMachine *string) { + o.VirtualMachine = virtualMachine +} + +// WithVirtualMachineID adds the virtualMachineID to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) WithVirtualMachineID(virtualMachineID *string) *VirtualizationInterfacesListParams { + o.SetVirtualMachineID(virtualMachineID) + return o +} + +// SetVirtualMachineID adds the virtualMachineId to the virtualization interfaces list params +func (o *VirtualizationInterfacesListParams) SetVirtualMachineID(virtualMachineID *string) { + o.VirtualMachineID = virtualMachineID +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Enabled != nil { + + // query param enabled + var qrEnabled string + if o.Enabled != nil { + qrEnabled = *o.Enabled + } + qEnabled := qrEnabled + if qEnabled != "" { + if err := r.SetQueryParam("enabled", qEnabled); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.MacAddress != nil { + + // query param mac_address + var qrMacAddress string + if o.MacAddress != nil { + qrMacAddress = *o.MacAddress + } + qMacAddress := qrMacAddress + if qMacAddress != "" { + if err := r.SetQueryParam("mac_address", qMacAddress); err != nil { + return err + } + } + + } + + if o.Mtu != nil { + + // query param mtu + var qrMtu float64 + if o.Mtu != nil { + qrMtu = *o.Mtu + } + qMtu := swag.FormatFloat64(qrMtu) + if qMtu != "" { + if err := r.SetQueryParam("mtu", qMtu); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.VirtualMachine != nil { + + // query param virtual_machine + var qrVirtualMachine string + if o.VirtualMachine != nil { + qrVirtualMachine = *o.VirtualMachine + } + qVirtualMachine := qrVirtualMachine + if qVirtualMachine != "" { + if err := r.SetQueryParam("virtual_machine", qVirtualMachine); err != nil { + return err + } + } + + } + + if o.VirtualMachineID != nil { + + // query param virtual_machine_id + var qrVirtualMachineID string + if o.VirtualMachineID != nil { + qrVirtualMachineID = *o.VirtualMachineID + } + qVirtualMachineID := qrVirtualMachineID + if qVirtualMachineID != "" { + if err := r.SetQueryParam("virtual_machine_id", qVirtualMachineID); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/virtualization/virtualization_interfaces_list_responses.go b/netbox/client/virtualization/virtualization_interfaces_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..42fae74a8ca892a43106efa6b6a7cb1fbd29e369 --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationInterfacesListReader is a Reader for the VirtualizationInterfacesList structure. +type VirtualizationInterfacesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationInterfacesListOK() + 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()) + } +} + +// NewVirtualizationInterfacesListOK creates a VirtualizationInterfacesListOK with default headers values +func NewVirtualizationInterfacesListOK() *VirtualizationInterfacesListOK { + return &VirtualizationInterfacesListOK{} +} + +/*VirtualizationInterfacesListOK handles this case with default header values. + +VirtualizationInterfacesListOK virtualization interfaces list o k +*/ +type VirtualizationInterfacesListOK struct { + Payload *models.VirtualizationInterfacesListOKBody +} + +func (o *VirtualizationInterfacesListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/interfaces/][%d] virtualizationInterfacesListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationInterfacesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationInterfacesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go b/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..a568191df7d902c75151f81c95c46c7ebd773ee0 --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationInterfacesPartialUpdateParams creates a new VirtualizationInterfacesPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationInterfacesPartialUpdateParams() *VirtualizationInterfacesPartialUpdateParams { + var () + return &VirtualizationInterfacesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesPartialUpdateParamsWithTimeout creates a new VirtualizationInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesPartialUpdateParams { + var () + return &VirtualizationInterfacesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesPartialUpdateParamsWithContext creates a new VirtualizationInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationInterfacesPartialUpdateParams { + var () + return &VirtualizationInterfacesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesPartialUpdateParamsWithHTTPClient creates a new VirtualizationInterfacesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesPartialUpdateParams { + var () + return &VirtualizationInterfacesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization interfaces partial update operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableInterface + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationInterfacesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WithID adds the id to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) WithID(id int64) *VirtualizationInterfacesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces partial update params +func (o *VirtualizationInterfacesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesPartialUpdateParams) 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/virtualization/virtualization_interfaces_partial_update_responses.go b/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..60cceedae208cb6edf6e909523e5c795190bee05 --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationInterfacesPartialUpdateReader is a Reader for the VirtualizationInterfacesPartialUpdate structure. +type VirtualizationInterfacesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationInterfacesPartialUpdateOK() + 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()) + } +} + +// NewVirtualizationInterfacesPartialUpdateOK creates a VirtualizationInterfacesPartialUpdateOK with default headers values +func NewVirtualizationInterfacesPartialUpdateOK() *VirtualizationInterfacesPartialUpdateOK { + return &VirtualizationInterfacesPartialUpdateOK{} +} + +/*VirtualizationInterfacesPartialUpdateOK handles this case with default header values. + +VirtualizationInterfacesPartialUpdateOK virtualization interfaces partial update o k +*/ +type VirtualizationInterfacesPartialUpdateOK struct { + Payload *models.WritableInterface +} + +func (o *VirtualizationInterfacesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/interfaces/{id}/][%d] virtualizationInterfacesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationInterfacesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_interfaces_read_parameters.go b/netbox/client/virtualization/virtualization_interfaces_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..54e954dfb363b119539950dcdb6322433e02d659 --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationInterfacesReadParams creates a new VirtualizationInterfacesReadParams object +// with the default values initialized. +func NewVirtualizationInterfacesReadParams() *VirtualizationInterfacesReadParams { + var () + return &VirtualizationInterfacesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesReadParamsWithTimeout creates a new VirtualizationInterfacesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesReadParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesReadParams { + var () + return &VirtualizationInterfacesReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesReadParamsWithContext creates a new VirtualizationInterfacesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesReadParamsWithContext(ctx context.Context) *VirtualizationInterfacesReadParams { + var () + return &VirtualizationInterfacesReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesReadParamsWithHTTPClient creates a new VirtualizationInterfacesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesReadParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesReadParams { + var () + return &VirtualizationInterfacesReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesReadParams contains all the parameters to send to the API endpoint +for the virtualization interfaces read operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesReadParams struct { + + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) WithContext(ctx context.Context) *VirtualizationInterfacesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) WithID(id int64) *VirtualizationInterfacesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces read params +func (o *VirtualizationInterfacesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesReadParams) 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/virtualization/virtualization_interfaces_read_responses.go b/netbox/client/virtualization/virtualization_interfaces_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9fd78a55268b9dc319f72ad818ebfef231732086 --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationInterfacesReadReader is a Reader for the VirtualizationInterfacesRead structure. +type VirtualizationInterfacesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationInterfacesReadOK() + 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()) + } +} + +// NewVirtualizationInterfacesReadOK creates a VirtualizationInterfacesReadOK with default headers values +func NewVirtualizationInterfacesReadOK() *VirtualizationInterfacesReadOK { + return &VirtualizationInterfacesReadOK{} +} + +/*VirtualizationInterfacesReadOK handles this case with default header values. + +VirtualizationInterfacesReadOK virtualization interfaces read o k +*/ +type VirtualizationInterfacesReadOK struct { + Payload *models.Interface +} + +func (o *VirtualizationInterfacesReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/interfaces/{id}/][%d] virtualizationInterfacesReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationInterfacesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.Interface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_interfaces_update_parameters.go b/netbox/client/virtualization/virtualization_interfaces_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c6e06c44780152925c513d0405425339536bf4ee --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationInterfacesUpdateParams creates a new VirtualizationInterfacesUpdateParams object +// with the default values initialized. +func NewVirtualizationInterfacesUpdateParams() *VirtualizationInterfacesUpdateParams { + var () + return &VirtualizationInterfacesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationInterfacesUpdateParamsWithTimeout creates a new VirtualizationInterfacesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationInterfacesUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationInterfacesUpdateParams { + var () + return &VirtualizationInterfacesUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationInterfacesUpdateParamsWithContext creates a new VirtualizationInterfacesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationInterfacesUpdateParamsWithContext(ctx context.Context) *VirtualizationInterfacesUpdateParams { + var () + return &VirtualizationInterfacesUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationInterfacesUpdateParamsWithHTTPClient creates a new VirtualizationInterfacesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationInterfacesUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationInterfacesUpdateParams { + var () + return &VirtualizationInterfacesUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationInterfacesUpdateParams contains all the parameters to send to the API endpoint +for the virtualization interfaces update operation typically these are written to a http.Request +*/ +type VirtualizationInterfacesUpdateParams struct { + + /*Data*/ + Data *models.WritableInterface + /*ID + A unique integer value identifying this interface. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationInterfacesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithContext(ctx context.Context) *VirtualizationInterfacesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationInterfacesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithData(data *models.WritableInterface) *VirtualizationInterfacesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetData(data *models.WritableInterface) { + o.Data = data +} + +// WithID adds the id to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) WithID(id int64) *VirtualizationInterfacesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization interfaces update params +func (o *VirtualizationInterfacesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationInterfacesUpdateParams) 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/virtualization/virtualization_interfaces_update_responses.go b/netbox/client/virtualization/virtualization_interfaces_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f8a6b6b94a513ba51645b25234a55cb8fa8bc1d2 --- /dev/null +++ b/netbox/client/virtualization/virtualization_interfaces_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationInterfacesUpdateReader is a Reader for the VirtualizationInterfacesUpdate structure. +type VirtualizationInterfacesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationInterfacesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationInterfacesUpdateOK() + 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()) + } +} + +// NewVirtualizationInterfacesUpdateOK creates a VirtualizationInterfacesUpdateOK with default headers values +func NewVirtualizationInterfacesUpdateOK() *VirtualizationInterfacesUpdateOK { + return &VirtualizationInterfacesUpdateOK{} +} + +/*VirtualizationInterfacesUpdateOK handles this case with default header values. + +VirtualizationInterfacesUpdateOK virtualization interfaces update o k +*/ +type VirtualizationInterfacesUpdateOK struct { + Payload *models.WritableInterface +} + +func (o *VirtualizationInterfacesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/interfaces/{id}/][%d] virtualizationInterfacesUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationInterfacesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableInterface) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..d01952d8ad275ad3f621bf136fa6f240c9cdfd61 --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_create_parameters.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationVirtualMachinesCreateParams creates a new VirtualizationVirtualMachinesCreateParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesCreateParams() *VirtualizationVirtualMachinesCreateParams { + var () + return &VirtualizationVirtualMachinesCreateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesCreateParamsWithTimeout creates a new VirtualizationVirtualMachinesCreateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesCreateParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesCreateParams { + var () + return &VirtualizationVirtualMachinesCreateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesCreateParamsWithContext creates a new VirtualizationVirtualMachinesCreateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesCreateParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesCreateParams { + var () + return &VirtualizationVirtualMachinesCreateParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesCreateParamsWithHTTPClient creates a new VirtualizationVirtualMachinesCreateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesCreateParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesCreateParams { + var () + return &VirtualizationVirtualMachinesCreateParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesCreateParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines create operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesCreateParams struct { + + /*Data*/ + Data *models.WritableVirtualMachine + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesCreateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesCreateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesCreateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesCreateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization virtual machines create params +func (o *VirtualizationVirtualMachinesCreateParams) SetData(data *models.WritableVirtualMachine) { + o.Data = data +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesCreateParams) 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/virtualization/virtualization_virtual_machines_create_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..9b92afc291f4131d915717b3000adebbc83ef59e --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_create_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationVirtualMachinesCreateReader is a Reader for the VirtualizationVirtualMachinesCreate structure. +type VirtualizationVirtualMachinesCreateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesCreateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 201: + result := NewVirtualizationVirtualMachinesCreateCreated() + 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()) + } +} + +// NewVirtualizationVirtualMachinesCreateCreated creates a VirtualizationVirtualMachinesCreateCreated with default headers values +func NewVirtualizationVirtualMachinesCreateCreated() *VirtualizationVirtualMachinesCreateCreated { + return &VirtualizationVirtualMachinesCreateCreated{} +} + +/*VirtualizationVirtualMachinesCreateCreated handles this case with default header values. + +VirtualizationVirtualMachinesCreateCreated virtualization virtual machines create created +*/ +type VirtualizationVirtualMachinesCreateCreated struct { + Payload *models.WritableVirtualMachine +} + +func (o *VirtualizationVirtualMachinesCreateCreated) Error() string { + return fmt.Sprintf("[POST /virtualization/virtual-machines/][%d] virtualizationVirtualMachinesCreateCreated %+v", 201, o.Payload) +} + +func (o *VirtualizationVirtualMachinesCreateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualMachine) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c2617c5de7340e60b8788c1613c2869138b0f41e --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_delete_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationVirtualMachinesDeleteParams creates a new VirtualizationVirtualMachinesDeleteParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesDeleteParams() *VirtualizationVirtualMachinesDeleteParams { + var () + return &VirtualizationVirtualMachinesDeleteParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesDeleteParamsWithTimeout creates a new VirtualizationVirtualMachinesDeleteParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesDeleteParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesDeleteParams { + var () + return &VirtualizationVirtualMachinesDeleteParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesDeleteParamsWithContext creates a new VirtualizationVirtualMachinesDeleteParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesDeleteParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesDeleteParams { + var () + return &VirtualizationVirtualMachinesDeleteParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesDeleteParamsWithHTTPClient creates a new VirtualizationVirtualMachinesDeleteParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesDeleteParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesDeleteParams { + var () + return &VirtualizationVirtualMachinesDeleteParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesDeleteParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines delete operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesDeleteParams struct { + + /*ID + A unique integer value identifying this virtual machine. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesDeleteParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesDeleteParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesDeleteParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) WithID(id int64) *VirtualizationVirtualMachinesDeleteParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines delete params +func (o *VirtualizationVirtualMachinesDeleteParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesDeleteParams) 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/virtualization/virtualization_virtual_machines_delete_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_delete_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..e46e8ace7fa24c4b1a1c295b6de211946291700a --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_delete_responses.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationVirtualMachinesDeleteReader is a Reader for the VirtualizationVirtualMachinesDelete structure. +type VirtualizationVirtualMachinesDeleteReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 204: + result := NewVirtualizationVirtualMachinesDeleteNoContent() + 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()) + } +} + +// NewVirtualizationVirtualMachinesDeleteNoContent creates a VirtualizationVirtualMachinesDeleteNoContent with default headers values +func NewVirtualizationVirtualMachinesDeleteNoContent() *VirtualizationVirtualMachinesDeleteNoContent { + return &VirtualizationVirtualMachinesDeleteNoContent{} +} + +/*VirtualizationVirtualMachinesDeleteNoContent handles this case with default header values. + +VirtualizationVirtualMachinesDeleteNoContent virtualization virtual machines delete no content +*/ +type VirtualizationVirtualMachinesDeleteNoContent struct { +} + +func (o *VirtualizationVirtualMachinesDeleteNoContent) Error() string { + return fmt.Sprintf("[DELETE /virtualization/virtual-machines/{id}/][%d] virtualizationVirtualMachinesDeleteNoContent ", 204) +} + +func (o *VirtualizationVirtualMachinesDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..5cf5c98d08abf2e2507d2e3a7550808755c1ad82 --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_list_parameters.go @@ -0,0 +1,706 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationVirtualMachinesListParams creates a new VirtualizationVirtualMachinesListParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesListParams() *VirtualizationVirtualMachinesListParams { + var () + return &VirtualizationVirtualMachinesListParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesListParamsWithTimeout creates a new VirtualizationVirtualMachinesListParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesListParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesListParams { + var () + return &VirtualizationVirtualMachinesListParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesListParamsWithContext creates a new VirtualizationVirtualMachinesListParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesListParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesListParams { + var () + return &VirtualizationVirtualMachinesListParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesListParamsWithHTTPClient creates a new VirtualizationVirtualMachinesListParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesListParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesListParams { + var () + return &VirtualizationVirtualMachinesListParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesListParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines list operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesListParams struct { + + /*Cluster*/ + Cluster *string + /*ClusterGroup*/ + ClusterGroup *string + /*ClusterGroupID*/ + ClusterGroupID *string + /*ClusterID*/ + ClusterID *string + /*ClusterType*/ + ClusterType *string + /*ClusterTypeID*/ + ClusterTypeID *string + /*IDIn + Multiple values may be separated by commas. + + */ + IDIn *float64 + /*Limit + Number of results to return per page. + + */ + Limit *int64 + /*Name*/ + Name *string + /*Offset + The initial index from which to return the results. + + */ + Offset *int64 + /*Platform*/ + Platform *string + /*PlatformID*/ + PlatformID *string + /*Q*/ + Q *string + /*Role*/ + Role *string + /*RoleID*/ + RoleID *string + /*Site*/ + Site *string + /*SiteID*/ + SiteID *string + /*Status*/ + Status *string + /*Tenant*/ + Tenant *string + /*TenantID*/ + TenantID *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesListParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesListParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesListParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithCluster adds the cluster to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithCluster(cluster *string) *VirtualizationVirtualMachinesListParams { + o.SetCluster(cluster) + return o +} + +// SetCluster adds the cluster to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetCluster(cluster *string) { + o.Cluster = cluster +} + +// WithClusterGroup adds the clusterGroup to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterGroup(clusterGroup *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterGroup(clusterGroup) + return o +} + +// SetClusterGroup adds the clusterGroup to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterGroup(clusterGroup *string) { + o.ClusterGroup = clusterGroup +} + +// WithClusterGroupID adds the clusterGroupID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterGroupID(clusterGroupID *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterGroupID(clusterGroupID) + return o +} + +// SetClusterGroupID adds the clusterGroupId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterGroupID(clusterGroupID *string) { + o.ClusterGroupID = clusterGroupID +} + +// WithClusterID adds the clusterID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterID(clusterID *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterID(clusterID) + return o +} + +// SetClusterID adds the clusterId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterID(clusterID *string) { + o.ClusterID = clusterID +} + +// WithClusterType adds the clusterType to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterType(clusterType *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterType(clusterType) + return o +} + +// SetClusterType adds the clusterType to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterType(clusterType *string) { + o.ClusterType = clusterType +} + +// WithClusterTypeID adds the clusterTypeID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithClusterTypeID(clusterTypeID *string) *VirtualizationVirtualMachinesListParams { + o.SetClusterTypeID(clusterTypeID) + return o +} + +// SetClusterTypeID adds the clusterTypeId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetClusterTypeID(clusterTypeID *string) { + o.ClusterTypeID = clusterTypeID +} + +// WithIDIn adds the iDIn to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithIDIn(iDIn *float64) *VirtualizationVirtualMachinesListParams { + o.SetIDIn(iDIn) + return o +} + +// SetIDIn adds the idIn to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetIDIn(iDIn *float64) { + o.IDIn = iDIn +} + +// WithLimit adds the limit to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithLimit(limit *int64) *VirtualizationVirtualMachinesListParams { + o.SetLimit(limit) + return o +} + +// SetLimit adds the limit to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetLimit(limit *int64) { + o.Limit = limit +} + +// WithName adds the name to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithName(name *string) *VirtualizationVirtualMachinesListParams { + o.SetName(name) + return o +} + +// SetName adds the name to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetName(name *string) { + o.Name = name +} + +// WithOffset adds the offset to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithOffset(offset *int64) *VirtualizationVirtualMachinesListParams { + o.SetOffset(offset) + return o +} + +// SetOffset adds the offset to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetOffset(offset *int64) { + o.Offset = offset +} + +// WithPlatform adds the platform to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithPlatform(platform *string) *VirtualizationVirtualMachinesListParams { + o.SetPlatform(platform) + return o +} + +// SetPlatform adds the platform to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetPlatform(platform *string) { + o.Platform = platform +} + +// WithPlatformID adds the platformID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithPlatformID(platformID *string) *VirtualizationVirtualMachinesListParams { + o.SetPlatformID(platformID) + return o +} + +// SetPlatformID adds the platformId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetPlatformID(platformID *string) { + o.PlatformID = platformID +} + +// WithQ adds the q to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithQ(q *string) *VirtualizationVirtualMachinesListParams { + o.SetQ(q) + return o +} + +// SetQ adds the q to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetQ(q *string) { + o.Q = q +} + +// WithRole adds the role to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithRole(role *string) *VirtualizationVirtualMachinesListParams { + o.SetRole(role) + return o +} + +// SetRole adds the role to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetRole(role *string) { + o.Role = role +} + +// WithRoleID adds the roleID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithRoleID(roleID *string) *VirtualizationVirtualMachinesListParams { + o.SetRoleID(roleID) + return o +} + +// SetRoleID adds the roleId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetRoleID(roleID *string) { + o.RoleID = roleID +} + +// WithSite adds the site to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithSite(site *string) *VirtualizationVirtualMachinesListParams { + o.SetSite(site) + return o +} + +// SetSite adds the site to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetSite(site *string) { + o.Site = site +} + +// WithSiteID adds the siteID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithSiteID(siteID *string) *VirtualizationVirtualMachinesListParams { + o.SetSiteID(siteID) + return o +} + +// SetSiteID adds the siteId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetSiteID(siteID *string) { + o.SiteID = siteID +} + +// WithStatus adds the status to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithStatus(status *string) *VirtualizationVirtualMachinesListParams { + o.SetStatus(status) + return o +} + +// SetStatus adds the status to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetStatus(status *string) { + o.Status = status +} + +// WithTenant adds the tenant to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTenant(tenant *string) *VirtualizationVirtualMachinesListParams { + o.SetTenant(tenant) + return o +} + +// SetTenant adds the tenant to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTenant(tenant *string) { + o.Tenant = tenant +} + +// WithTenantID adds the tenantID to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) WithTenantID(tenantID *string) *VirtualizationVirtualMachinesListParams { + o.SetTenantID(tenantID) + return o +} + +// SetTenantID adds the tenantId to the virtualization virtual machines list params +func (o *VirtualizationVirtualMachinesListParams) SetTenantID(tenantID *string) { + o.TenantID = tenantID +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Cluster != nil { + + // query param cluster + var qrCluster string + if o.Cluster != nil { + qrCluster = *o.Cluster + } + qCluster := qrCluster + if qCluster != "" { + if err := r.SetQueryParam("cluster", qCluster); err != nil { + return err + } + } + + } + + if o.ClusterGroup != nil { + + // query param cluster_group + var qrClusterGroup string + if o.ClusterGroup != nil { + qrClusterGroup = *o.ClusterGroup + } + qClusterGroup := qrClusterGroup + if qClusterGroup != "" { + if err := r.SetQueryParam("cluster_group", qClusterGroup); err != nil { + return err + } + } + + } + + if o.ClusterGroupID != nil { + + // query param cluster_group_id + var qrClusterGroupID string + if o.ClusterGroupID != nil { + qrClusterGroupID = *o.ClusterGroupID + } + qClusterGroupID := qrClusterGroupID + if qClusterGroupID != "" { + if err := r.SetQueryParam("cluster_group_id", qClusterGroupID); err != nil { + return err + } + } + + } + + if o.ClusterID != nil { + + // query param cluster_id + var qrClusterID string + if o.ClusterID != nil { + qrClusterID = *o.ClusterID + } + qClusterID := qrClusterID + if qClusterID != "" { + if err := r.SetQueryParam("cluster_id", qClusterID); err != nil { + return err + } + } + + } + + if o.ClusterType != nil { + + // query param cluster_type + var qrClusterType string + if o.ClusterType != nil { + qrClusterType = *o.ClusterType + } + qClusterType := qrClusterType + if qClusterType != "" { + if err := r.SetQueryParam("cluster_type", qClusterType); err != nil { + return err + } + } + + } + + if o.ClusterTypeID != nil { + + // query param cluster_type_id + var qrClusterTypeID string + if o.ClusterTypeID != nil { + qrClusterTypeID = *o.ClusterTypeID + } + qClusterTypeID := qrClusterTypeID + if qClusterTypeID != "" { + if err := r.SetQueryParam("cluster_type_id", qClusterTypeID); err != nil { + return err + } + } + + } + + if o.IDIn != nil { + + // query param id__in + var qrIDIn float64 + if o.IDIn != nil { + qrIDIn = *o.IDIn + } + qIDIn := swag.FormatFloat64(qrIDIn) + if qIDIn != "" { + if err := r.SetQueryParam("id__in", qIDIn); err != nil { + return err + } + } + + } + + if o.Limit != nil { + + // query param limit + var qrLimit int64 + if o.Limit != nil { + qrLimit = *o.Limit + } + qLimit := swag.FormatInt64(qrLimit) + if qLimit != "" { + if err := r.SetQueryParam("limit", qLimit); err != nil { + return err + } + } + + } + + if o.Name != nil { + + // query param name + var qrName string + if o.Name != nil { + qrName = *o.Name + } + qName := qrName + if qName != "" { + if err := r.SetQueryParam("name", qName); err != nil { + return err + } + } + + } + + if o.Offset != nil { + + // query param offset + var qrOffset int64 + if o.Offset != nil { + qrOffset = *o.Offset + } + qOffset := swag.FormatInt64(qrOffset) + if qOffset != "" { + if err := r.SetQueryParam("offset", qOffset); err != nil { + return err + } + } + + } + + if o.Platform != nil { + + // query param platform + var qrPlatform string + if o.Platform != nil { + qrPlatform = *o.Platform + } + qPlatform := qrPlatform + if qPlatform != "" { + if err := r.SetQueryParam("platform", qPlatform); err != nil { + return err + } + } + + } + + if o.PlatformID != nil { + + // query param platform_id + var qrPlatformID string + if o.PlatformID != nil { + qrPlatformID = *o.PlatformID + } + qPlatformID := qrPlatformID + if qPlatformID != "" { + if err := r.SetQueryParam("platform_id", qPlatformID); err != nil { + return err + } + } + + } + + if o.Q != nil { + + // query param q + var qrQ string + if o.Q != nil { + qrQ = *o.Q + } + qQ := qrQ + if qQ != "" { + if err := r.SetQueryParam("q", qQ); err != nil { + return err + } + } + + } + + if o.Role != nil { + + // query param role + var qrRole string + if o.Role != nil { + qrRole = *o.Role + } + qRole := qrRole + if qRole != "" { + if err := r.SetQueryParam("role", qRole); err != nil { + return err + } + } + + } + + if o.RoleID != nil { + + // query param role_id + var qrRoleID string + if o.RoleID != nil { + qrRoleID = *o.RoleID + } + qRoleID := qrRoleID + if qRoleID != "" { + if err := r.SetQueryParam("role_id", qRoleID); err != nil { + return err + } + } + + } + + if o.Site != nil { + + // query param site + var qrSite string + if o.Site != nil { + qrSite = *o.Site + } + qSite := qrSite + if qSite != "" { + if err := r.SetQueryParam("site", qSite); err != nil { + return err + } + } + + } + + if o.SiteID != nil { + + // query param site_id + var qrSiteID string + if o.SiteID != nil { + qrSiteID = *o.SiteID + } + qSiteID := qrSiteID + if qSiteID != "" { + if err := r.SetQueryParam("site_id", qSiteID); err != nil { + return err + } + } + + } + + if o.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 + 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 len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..f51c5a0af59be07185aecdda2e5d762c2b802258 --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_list_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationVirtualMachinesListReader is a Reader for the VirtualizationVirtualMachinesList structure. +type VirtualizationVirtualMachinesListReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationVirtualMachinesListOK() + 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()) + } +} + +// NewVirtualizationVirtualMachinesListOK creates a VirtualizationVirtualMachinesListOK with default headers values +func NewVirtualizationVirtualMachinesListOK() *VirtualizationVirtualMachinesListOK { + return &VirtualizationVirtualMachinesListOK{} +} + +/*VirtualizationVirtualMachinesListOK handles this case with default header values. + +VirtualizationVirtualMachinesListOK virtualization virtual machines list o k +*/ +type VirtualizationVirtualMachinesListOK struct { + Payload *models.VirtualizationVirtualMachinesListOKBody +} + +func (o *VirtualizationVirtualMachinesListOK) Error() string { + return fmt.Sprintf("[GET /virtualization/virtual-machines/][%d] virtualizationVirtualMachinesListOK %+v", 200, o.Payload) +} + +func (o *VirtualizationVirtualMachinesListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualizationVirtualMachinesListOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..ef01c56439e9d2401416d27ac8099355c15c0fd5 --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_partial_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationVirtualMachinesPartialUpdateParams creates a new VirtualizationVirtualMachinesPartialUpdateParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesPartialUpdateParams() *VirtualizationVirtualMachinesPartialUpdateParams { + var () + return &VirtualizationVirtualMachinesPartialUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesPartialUpdateParamsWithTimeout creates a new VirtualizationVirtualMachinesPartialUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesPartialUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesPartialUpdateParams { + var () + return &VirtualizationVirtualMachinesPartialUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesPartialUpdateParamsWithContext creates a new VirtualizationVirtualMachinesPartialUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesPartialUpdateParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesPartialUpdateParams { + var () + return &VirtualizationVirtualMachinesPartialUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesPartialUpdateParamsWithHTTPClient creates a new VirtualizationVirtualMachinesPartialUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesPartialUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesPartialUpdateParams { + var () + return &VirtualizationVirtualMachinesPartialUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesPartialUpdateParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines partial update operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesPartialUpdateParams struct { + + /*Data*/ + Data *models.WritableVirtualMachine + /*ID + A unique integer value identifying this virtual machine. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetData(data *models.WritableVirtualMachine) { + o.Data = data +} + +// WithID adds the id to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) WithID(id int64) *VirtualizationVirtualMachinesPartialUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines partial update params +func (o *VirtualizationVirtualMachinesPartialUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesPartialUpdateParams) 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/virtualization/virtualization_virtual_machines_partial_update_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..935c34d6bf3e085e57660a74ec56e60efe5730e6 --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_partial_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationVirtualMachinesPartialUpdateReader is a Reader for the VirtualizationVirtualMachinesPartialUpdate structure. +type VirtualizationVirtualMachinesPartialUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesPartialUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationVirtualMachinesPartialUpdateOK() + 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()) + } +} + +// NewVirtualizationVirtualMachinesPartialUpdateOK creates a VirtualizationVirtualMachinesPartialUpdateOK with default headers values +func NewVirtualizationVirtualMachinesPartialUpdateOK() *VirtualizationVirtualMachinesPartialUpdateOK { + return &VirtualizationVirtualMachinesPartialUpdateOK{} +} + +/*VirtualizationVirtualMachinesPartialUpdateOK handles this case with default header values. + +VirtualizationVirtualMachinesPartialUpdateOK virtualization virtual machines partial update o k +*/ +type VirtualizationVirtualMachinesPartialUpdateOK struct { + Payload *models.WritableVirtualMachine +} + +func (o *VirtualizationVirtualMachinesPartialUpdateOK) Error() string { + return fmt.Sprintf("[PATCH /virtualization/virtual-machines/{id}/][%d] virtualizationVirtualMachinesPartialUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationVirtualMachinesPartialUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualMachine) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..c73fc7df49c0fd757accf10c8c434e37ef87b4b6 --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_read_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationVirtualMachinesReadParams creates a new VirtualizationVirtualMachinesReadParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesReadParams() *VirtualizationVirtualMachinesReadParams { + var () + return &VirtualizationVirtualMachinesReadParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesReadParamsWithTimeout creates a new VirtualizationVirtualMachinesReadParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesReadParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesReadParams { + var () + return &VirtualizationVirtualMachinesReadParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesReadParamsWithContext creates a new VirtualizationVirtualMachinesReadParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesReadParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesReadParams { + var () + return &VirtualizationVirtualMachinesReadParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesReadParamsWithHTTPClient creates a new VirtualizationVirtualMachinesReadParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesReadParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesReadParams { + var () + return &VirtualizationVirtualMachinesReadParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesReadParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines read operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesReadParams struct { + + /*ID + A unique integer value identifying this virtual machine. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesReadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesReadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesReadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithID adds the id to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) WithID(id int64) *VirtualizationVirtualMachinesReadParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines read params +func (o *VirtualizationVirtualMachinesReadParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesReadParams) 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/virtualization/virtualization_virtual_machines_read_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..2b830c59df45182df613a9ba8994bf43a81e6e91 --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_read_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationVirtualMachinesReadReader is a Reader for the VirtualizationVirtualMachinesRead structure. +type VirtualizationVirtualMachinesReadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesReadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationVirtualMachinesReadOK() + 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()) + } +} + +// NewVirtualizationVirtualMachinesReadOK creates a VirtualizationVirtualMachinesReadOK with default headers values +func NewVirtualizationVirtualMachinesReadOK() *VirtualizationVirtualMachinesReadOK { + return &VirtualizationVirtualMachinesReadOK{} +} + +/*VirtualizationVirtualMachinesReadOK handles this case with default header values. + +VirtualizationVirtualMachinesReadOK virtualization virtual machines read o k +*/ +type VirtualizationVirtualMachinesReadOK struct { + Payload *models.VirtualMachine +} + +func (o *VirtualizationVirtualMachinesReadOK) Error() string { + return fmt.Sprintf("[GET /virtualization/virtual-machines/{id}/][%d] virtualizationVirtualMachinesReadOK %+v", 200, o.Payload) +} + +func (o *VirtualizationVirtualMachinesReadOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.VirtualMachine) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go b/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go new file mode 100644 index 0000000000000000000000000000000000000000..00e18dfb271cfc883ae0e9d463ea1628995f141d --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_update_parameters.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// NewVirtualizationVirtualMachinesUpdateParams creates a new VirtualizationVirtualMachinesUpdateParams object +// with the default values initialized. +func NewVirtualizationVirtualMachinesUpdateParams() *VirtualizationVirtualMachinesUpdateParams { + var () + return &VirtualizationVirtualMachinesUpdateParams{ + + timeout: cr.DefaultTimeout, + } +} + +// NewVirtualizationVirtualMachinesUpdateParamsWithTimeout creates a new VirtualizationVirtualMachinesUpdateParams object +// with the default values initialized, and the ability to set a timeout on a request +func NewVirtualizationVirtualMachinesUpdateParamsWithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesUpdateParams { + var () + return &VirtualizationVirtualMachinesUpdateParams{ + + timeout: timeout, + } +} + +// NewVirtualizationVirtualMachinesUpdateParamsWithContext creates a new VirtualizationVirtualMachinesUpdateParams object +// with the default values initialized, and the ability to set a context for a request +func NewVirtualizationVirtualMachinesUpdateParamsWithContext(ctx context.Context) *VirtualizationVirtualMachinesUpdateParams { + var () + return &VirtualizationVirtualMachinesUpdateParams{ + + Context: ctx, + } +} + +// NewVirtualizationVirtualMachinesUpdateParamsWithHTTPClient creates a new VirtualizationVirtualMachinesUpdateParams object +// with the default values initialized, and the ability to set a custom HTTPClient for a request +func NewVirtualizationVirtualMachinesUpdateParamsWithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesUpdateParams { + var () + return &VirtualizationVirtualMachinesUpdateParams{ + HTTPClient: client, + } +} + +/*VirtualizationVirtualMachinesUpdateParams contains all the parameters to send to the API endpoint +for the virtualization virtual machines update operation typically these are written to a http.Request +*/ +type VirtualizationVirtualMachinesUpdateParams struct { + + /*Data*/ + Data *models.WritableVirtualMachine + /*ID + A unique integer value identifying this virtual machine. + + */ + ID int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithTimeout adds the timeout to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithTimeout(timeout time.Duration) *VirtualizationVirtualMachinesUpdateParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithContext(ctx context.Context) *VirtualizationVirtualMachinesUpdateParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithHTTPClient(client *http.Client) *VirtualizationVirtualMachinesUpdateParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithData adds the data to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithData(data *models.WritableVirtualMachine) *VirtualizationVirtualMachinesUpdateParams { + o.SetData(data) + return o +} + +// SetData adds the data to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetData(data *models.WritableVirtualMachine) { + o.Data = data +} + +// WithID adds the id to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) WithID(id int64) *VirtualizationVirtualMachinesUpdateParams { + o.SetID(id) + return o +} + +// SetID adds the id to the virtualization virtual machines update params +func (o *VirtualizationVirtualMachinesUpdateParams) SetID(id int64) { + o.ID = id +} + +// WriteToRequest writes these params to a swagger request +func (o *VirtualizationVirtualMachinesUpdateParams) 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/virtualization/virtualization_virtual_machines_update_responses.go b/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go new file mode 100644 index 0000000000000000000000000000000000000000..66c8c1a8375148edd3e9fdb9fa1b7e4cb9b1fbfb --- /dev/null +++ b/netbox/client/virtualization/virtualization_virtual_machines_update_responses.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package virtualization + +// 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" +) + +// VirtualizationVirtualMachinesUpdateReader is a Reader for the VirtualizationVirtualMachinesUpdate structure. +type VirtualizationVirtualMachinesUpdateReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *VirtualizationVirtualMachinesUpdateReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + + case 200: + result := NewVirtualizationVirtualMachinesUpdateOK() + 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()) + } +} + +// NewVirtualizationVirtualMachinesUpdateOK creates a VirtualizationVirtualMachinesUpdateOK with default headers values +func NewVirtualizationVirtualMachinesUpdateOK() *VirtualizationVirtualMachinesUpdateOK { + return &VirtualizationVirtualMachinesUpdateOK{} +} + +/*VirtualizationVirtualMachinesUpdateOK handles this case with default header values. + +VirtualizationVirtualMachinesUpdateOK virtualization virtual machines update o k +*/ +type VirtualizationVirtualMachinesUpdateOK struct { + Payload *models.WritableVirtualMachine +} + +func (o *VirtualizationVirtualMachinesUpdateOK) Error() string { + return fmt.Sprintf("[PUT /virtualization/virtual-machines/{id}/][%d] virtualizationVirtualMachinesUpdateOK %+v", 200, o.Payload) +} + +func (o *VirtualizationVirtualMachinesUpdateOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(models.WritableVirtualMachine) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/netbox/client_test.go b/netbox/client_test.go deleted file mode 100644 index c97d88a6188ff05e8db97e964dd7ca46e1c8808f..0000000000000000000000000000000000000000 --- a/netbox/client_test.go +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "net/http" - "net/http/httptest" - "net/url" - "reflect" - "strconv" - "testing" -) - -func TestClientBadJSON(t *testing.T) { - c, done := testClient(t, func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("foo")) - }) - defer done() - - req, err := c.NewRequest(http.MethodGet, "/", nil) - if err != nil { - t.Fatal("expected no error, but an error returned") - } - - // Pass empty struct to trigger JSON unmarshaling path - var v struct{} - - err = c.Do(req, &v) - if _, ok := err.(*json.SyntaxError); !ok { - t.Fatalf("unexpected error type: %T", err) - } -} - -func TestClientBadStatusCode(t *testing.T) { - var tests = []struct { - desc string - data []byte - statusCode int - want error - }{ - { - desc: "403, but no json result", - data: []byte("foo"), - statusCode: http.StatusForbidden, - want: errors.New("403 - foo"), - }, - { - desc: "403, with json, but without detail", - data: []byte(`{"error_msg": "some error occurred"}`), - statusCode: http.StatusForbidden, - want: errors.New(`403 - {"error_msg": "some error occurred"}`), - }, - { - desc: "500, but correct json", - data: []byte(`{"detail": "some error occurred"}`), - statusCode: http.StatusInternalServerError, - want: errors.New("500 - some error occurred"), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(tt.statusCode) - w.Write(tt.data) - }) - defer done() - - req, err := c.NewRequest(http.MethodGet, "/", nil) - if err != nil { - t.Fatal("expected no error, but an error returned") - } - - var v struct{} - err = c.Do(req, &v) - if want, got := tt.want, err; !reflect.DeepEqual(want, got) { - t.Fatalf("expected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestNewJSONRequest(t *testing.T) { - c, done := testClient(t, func(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("foo")) - }) - defer done() - wantBody := "{\"id\":1,\"name\":\"Test 1\"}\n" - wantHeader := "application/json; charset=utf-8" - - req, err := c.NewJSONRequest(http.MethodPost, "/", nil, &struct { - ID int `json:"id"` - Name string `json:"name"` - }{ - ID: 1, - Name: "Test 1", - }) - if err != nil { - t.Fatal("expected no error, but an error returned") - } - - res, err := ioutil.ReadAll(req.Body) - if err != nil { - t.Fatal("expected no error, but an error returned") - } - if want, got := wantBody, string(res); got != want { - t.Fatalf("unexpected body:\n- want: %v\n- got: %v", want, got) - } - - if want, got := wantHeader, req.Header.Get("Content-Type"); got != want { - t.Fatalf("unexpected body:\n- want: %v\n- got: %v", want, got) - } - - req, err = c.NewJSONRequest(http.MethodPost, "/", nil, nil) - if err == nil { - t.Fatal("expected an error, but there was none") - } - if req != nil { - t.Fatalf("expected a nil request, but got %v", req) - } -} - -func TestClientQueryParameters(t *testing.T) { - c := &Client{ - u: &url.URL{}, - client: &http.Client{}, - } - - const ( - wantFoo = "foo" - wantBar = 1 - ) - - req, err := c.NewRequest(http.MethodGet, "/", testValuer{ - Foo: wantFoo, - Bar: wantBar, - }) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - q := req.URL.Query() - if want, got := 2, len(q); want != got { - t.Fatalf("unexpected number of query parameters:\n- want: %v\n- got: %v", - want, got) - } - - if want, got := wantFoo, q.Get("foo"); want != got { - t.Fatalf("unexpected foo:\n- want: %v\n- got: %v", want, got) - } - - if want, got := strconv.Itoa(wantBar), q.Get("bar"); want != got { - t.Fatalf("unexpected bar:\n- want: %v\n- got: %v", want, got) - } -} - -func TestClientPrependBaseURLPath(t *testing.T) { - u, err := url.Parse("http://example.com/netbox/") - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - c := &Client{ - u: u, - client: &http.Client{}, - } - - req, err := c.NewRequest(http.MethodGet, "/api/ipam/vlans", nil) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - if want, got := "/netbox/api/ipam/vlans", req.URL.Path; want != got { - t.Fatalf("unexpected URL path:\n- want: %q\n- got: %q", - want, got) - } -} - -func TestAuthenticatingClientAddsHeader(t *testing.T) { - c, err := NewClient("localhost", "auth-token", nil) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - req, err := c.NewRequest(http.MethodGet, "/api/ipam/vlans", nil) - if err != nil { - t.Fatalf("unexpected error: %v", err) - } - - if want, got := "Token auth-token", req.Header.Get("Authorization"); want != got { - t.Fatalf("unexpected Authorization header:\n- want: %q\n- got: %q", - want, got) - } -} - -type testValuer struct { - Foo string - Bar int -} - -func (q testValuer) Values() (url.Values, error) { - v := url.Values{} - - if q.Foo != "" { - v.Set("foo", q.Foo) - } - - if q.Bar != 0 { - v.Set("bar", strconv.Itoa(q.Bar)) - } - - return v, nil -} - -func testClient(t *testing.T, fn func(w http.ResponseWriter, r *http.Request)) (*Client, func()) { - s := httptest.NewServer(http.HandlerFunc(fn)) - - c, err := NewClient(s.URL, "", nil) - if err != nil { - t.Fatalf("error creating Client: %v", err) - } - - return c, func() { s.Close() } -} - -func testHandler(t *testing.T, method string, path string, v interface{}) http.HandlerFunc { - return testStatusHandler(t, method, path, v, 0) -} - -func testStatusHandler(t *testing.T, method string, path string, v interface{}, statusCode int) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - if want, got := method, r.Method; want != got { - t.Fatalf("unexpected HTTP method:\n- want: %v\n- got: %v", want, got) - } - - if want, got := path, r.URL.Path; want != got { - t.Fatalf("unexpected URL path:\n- want: %v\n- got: %v", want, got) - } - - if statusCode > 0 { - w.WriteHeader(statusCode) - } - - if err := json.NewEncoder(w).Encode(v); err != nil { - t.Fatalf("error while encoding JSON: %v", err) - } - } -} - -func testTenantGroupCreate(n int) *TenantGroup { - return &TenantGroup{ - Name: fmt.Sprintf("Tenant Group %d", n), - Slug: fmt.Sprintf("tenant-group-%d", n), - } -} - -func testTenantGroup(n int) *TenantGroup { - return &TenantGroup{ - ID: n, - Name: fmt.Sprintf("Tenant Group %d", n), - Slug: fmt.Sprintf("tenant-group-%d", n), - } -} - -func testTenant(n int) *Tenant { - return testTenantWithGroup(n, testTenantGroup(n)) -} - -func testTenantCreate(n int) *Tenant { - return testTenantWithGroupCreate(n, testTenantGroup(n)) -} - -func testTenantWithGroupCreate(n int, t *TenantGroup) *Tenant { - return &Tenant{ - Name: fmt.Sprintf("Tenant %d", n), - Slug: fmt.Sprintf("tenant-%d", n), - Description: fmt.Sprintf("Tenant %d Description", n), - Comments: fmt.Sprintf("Tenant %d Comments", n), - Group: t, - } -} - -func testTenantWithGroup(n int, t *TenantGroup) *Tenant { - return &Tenant{ - ID: n, - Name: fmt.Sprintf("Tenant %d", n), - Slug: fmt.Sprintf("tenant-%d", n), - Description: fmt.Sprintf("Tenant %d Description", n), - Comments: fmt.Sprintf("Tenant %d Comments", n), - Group: t, - } -} - -func testTenantIdentifier(n int) *Tenant { - return &Tenant{ - ID: n, - Name: fmt.Sprintf("Tenant %d", n), - Slug: fmt.Sprintf("tenant-%d", n), - } -} - -func testVRF(n int) *VRF { - return &VRF{ - ID: n, - Name: fmt.Sprintf("VRF %d", n), - RD: fmt.Sprintf("vrf-%d", n), - EnforceUnique: true, - Description: fmt.Sprintf("VRF %d Description", n), - Tenant: testTenantWithGroup(n, nil), - } -} - -func testVRFCreate(n int) *VRF { - return &VRF{ - Name: fmt.Sprintf("VRF %d", n), - RD: fmt.Sprintf("vrf-%d", n), - EnforceUnique: true, - Description: fmt.Sprintf("VRF %d Description", n), - Tenant: testTenantWithGroup(n, nil), - } -} - -func testVRFWithTenant(n int, tenant *Tenant) *VRF { - return &VRF{ - ID: n, - Name: fmt.Sprintf("VRF %d", n), - RD: fmt.Sprintf("vrf-%d", n), - EnforceUnique: true, - Description: fmt.Sprintf("VRF %d Description", n), - Tenant: tenant, - } -} diff --git a/netbox/dcim.go b/netbox/dcim.go deleted file mode 100644 index 28f88d28074682a0f78e80cb39f02fb6819aafb4..0000000000000000000000000000000000000000 --- a/netbox/dcim.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -// A DCIMService is used in a Client to access NetBox's DCIM API methods. -type DCIMService struct { - c *Client - InventoryItems *InventoryItemsService - Devices *DevicesService -} - -// NewDCIMService returns a DCIMService initialized with all sub-services. -func NewDCIMService(client *Client) *DCIMService { - return &DCIMService{ - c: client, - InventoryItems: &InventoryItemsService{ - c: client, - }, - Devices: &DevicesService{ - c: client, - }, - } -} - -// SimpleIdentifier represents a simple object that consists of only an ID, -// name, and slug. -type SimpleIdentifier struct { - ID int `json:"id"` - Name string `json:"name"` - Slug string `json:"slug"` -} diff --git a/netbox/dcim_devices.go b/netbox/dcim_devices.go deleted file mode 100644 index 61912044db771ea2ab454d8c0576949374a9a3d1..0000000000000000000000000000000000000000 --- a/netbox/dcim_devices.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_functions.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// DevicesService is used in a Client to access NetBox's dcim/devices API methods. -type DevicesService struct { - c *Client -} - -// Get retrieves an Device object from NetBox by its ID. -func (s *DevicesService) Get(id int) (*Device, error) { - req, err := s.c.NewRequest( - http.MethodGet, - fmt.Sprintf("api/dcim/devices/%d/", id), - nil, - ) - if err != nil { - return nil, err - } - - t := new(Device) - err = s.c.Do(req, t) - if err != nil { - return nil, err - } - return t, nil -} - -// List returns a Page associated with an NetBox API Endpoint. -func (s *DevicesService) List(options *ListDeviceOptions) *Page { - return NewPage(s.c, "api/dcim/devices/", options) -} - -// Extract retrives a list of Device objects from page. -func (s *DevicesService) Extract(page *Page) ([]*Device, error) { - if err := page.Err(); err != nil { - return nil, err - } - - var groups []*Device - if err := json.Unmarshal(page.data.Results, &groups); err != nil { - return nil, err - } - return groups, nil -} - -// Create creates a new Device object in NetBox and returns the ID of the new object. -func (s *DevicesService) Create(data *Device) (int, error) { - req, err := s.c.NewJSONRequest(http.MethodPost, "api/dcim/devices/", nil, data) - if err != nil { - return 0, err - } - - g := new(writableDevice) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Update changes an existing Device object in NetBox, and returns the ID of the new object. -func (s *DevicesService) Update(data *Device) (int, error) { - req, err := s.c.NewJSONRequest( - http.MethodPatch, - fmt.Sprintf("api/dcim/devices/%d/", data.ID), - nil, - data, - ) - if err != nil { - return 0, err - } - - // g is just used to verify correct api result. - // data is not changed, because the g is not the full representation that one would - // get with Get. But if the response was unmarshaled into writableDevice correctly, - // everything went fine, and we do not need to update data. - g := new(writableDevice) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Delete deletes an existing Device object from NetBox. -func (s *DevicesService) Delete(data *Device) error { - req, err := s.c.NewRequest( - http.MethodDelete, - fmt.Sprintf("api/dcim/devices/%d/", data.ID), - nil, - ) - if err != nil { - return err - } - - return s.c.Do(req, nil) -} diff --git a/netbox/dcim_devices_basic_test.go b/netbox/dcim_devices_basic_test.go deleted file mode 100644 index fe7ef3d53ac980ecfd930ae27854bba384ad86c5..0000000000000000000000000000000000000000 --- a/netbox/dcim_devices_basic_test.go +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_basic_tests.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "errors" - "fmt" - "net/http" - "reflect" - "testing" -) - -// Using this to override MarshalJSON -// In all cases when posting data to netbox-API, the Device.MarshalJSON is what you want, -// but not here as a return in testHandler -type serverDataDevice Device - -func convertToServerDataDevice(data []*Device) []*serverDataDevice { - dataWant := make([]*serverDataDevice, len(data)) - for i := range data { - tmp := serverDataDevice(*data[i]) - dataWant[i] = &tmp - } - return dataWant -} - -func TestBasicDeviceGet(t *testing.T) { - var tests = []struct { - desc string - want *Device - }{ - { - desc: "Simple Device", - want: testDevice(1), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - serverData := serverDataDevice(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/dcim/devices/1/", &serverData)) - defer done() - - res, err := c.DCIM.Devices.Get(1) - if err != nil { - t.Fatalf("unexpected error from Client.DCIM.Devices.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Device:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicDeviceGet404(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodGet, "/api/dcim/devices/1/", &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - http.StatusNotFound)) - defer done() - - res, err := c.DCIM.Devices.Get(1) - errstr := "404 - Not found." - if want, got := errors.New(errstr), err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error from Client.DCIM.Devices.Get:\n- want: %v\n- got: %v", want, got) - } - - if res != nil { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", nil, res) - } -} - -func TestBasicListExtractDevice(t *testing.T) { - want := []*Device{ - testDevice(1), - testDevice(2), - } - serverWant := convertToServerDataDevice(want) - serverData, _ := json.Marshal(serverWant) - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/dcim/devices/", &pageData{ - Count: 2, - NextURL: "", - PreviousURL: "", - Results: serverData, - })) - defer done() - - page := c.DCIM.Devices.List(nil) - - if page == nil { - t.Fatalf("unexpexted result from c.DCIM.Devices.List.") - } - - got := []*Device{} - counter := 0 - for page.Next() { - var err error - got, err = c.DCIM.Devices.Extract(page) - if err != nil { - t.Fatalf("unexpected error from c.DCIM.Devices.Extract: %v", err) - } - counter = counter + 1 - if counter > 2 { // Safe guard - break - } - } - if counter != 1 { - t.Fatalf("unexpected page count:\n- want: 1\n- got: %d", counter) - } - - if !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", want, got) - } - - if page.Err() != nil { - t.Fatalf("unexpected error from page:\n- want: %v\n- got: %v", want, got) - } -} - -func TestBasicCreateDevice(t *testing.T) { - var tests = []struct { - desc string - data *Device - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Create with ID 0", - data: testDeviceCreate(1), - want: 1, - status: 0, - errstr: "", - serverData: testDevice(1), - }, - { - desc: "Create duplicate", - data: testDeviceCreate(1), - want: 0, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"DevicesService with this name already exists.\"]}\n", - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"DevicesService with this name already exists."}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPost, "/api/dcim/devices/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.DCIM.Devices.Create(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Device:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicUpdateDevice(t *testing.T) { - var tests = []struct { - desc string - data *Device - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Update with ID 1", - data: testDevice(1), - want: 1, - serverData: testDevice(1), - status: 0, - errstr: "", - }, - { - desc: "Update not found", - data: testDevice(1), - want: 0, - serverData: &struct { - Detail string - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - { - desc: "Update to duplicate", - data: testDevice(1), - want: 0, - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"DevicesService with this name already exists."}, - }, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"DevicesService with this name already exists.\"]}\n", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPatch, "/api/dcim/devices/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.DCIM.Devices.Update(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Device:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicDeleteDevice(t *testing.T) { - var tests = []struct { - desc string - data *Device - serverData interface{} - status int - errstr string - }{ - { - desc: "Delete ID 1", - data: testDevice(1), - serverData: testDevice(1), - status: 0, - errstr: "", - }, - { - desc: "Delete not Found", - data: testDevice(1), - serverData: &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodDelete, "/api/dcim/devices/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - err := c.DCIM.Devices.Delete(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} diff --git a/netbox/dcim_devices_test.go b/netbox/dcim_devices_test.go deleted file mode 100644 index bbf809ea7ea2d083696bae793b5764659d98e3af..0000000000000000000000000000000000000000 --- a/netbox/dcim_devices_test.go +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "bytes" - "encoding/json" - "fmt" - "net/http" - _ "net/url" - "reflect" - "testing" -) - -func TestDeviceGet(t *testing.T) { - var tests = []struct { - desc string - want *Device - }{ - { - desc: "Device with Platform", - want: testDevice(1), - }, - } - - for idx, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", idx, tt.desc), func(t *testing.T) { - serverData := serverDataDevice(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/dcim/devices/1/", &serverData)) - defer done() - - res, err := c.DCIM.Devices.Get(1) - if err != nil { - t.Fatalf("unexpected error from c.DCIM.Devices.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Device\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestDeviceUnmarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data []byte - want *Device - }{ - { - desc: "Minimum device", - data: []byte(`{"id": 1, "name": "Device 1", "display_name": "Device 1", "device_type": { "id": 11, "url": "http://localhost/api/dcim/device-types/11/", "manufacturer": { "id": 21, "url": "http://localhost/api/dcim/manufacturers/21/", "name": "Manufacturer Name", "slug": "mfg-name"}, "model": "Device Type Model", "slug": "device-type-model"}, "device_role": { "id": 31, "url": "http://localhost/api/dcim/device-roles/31/", "name": "Device Role Name", "slug": "device-role-name"}, "site": { "id": 61, "url": "http://localhost/api/dcim/sites/61/", "name": "Site Name", "slug": "site-name" }, "status": { "value": 1, "label": "Active" } }`), - want: &Device{ - ID: 1, - Name: "Device 1", - DisplayName: "Device 1", - DeviceType: &NestedDeviceType{ID: 11, - URL: "http://localhost/api/dcim/device-types/11/", - Manufacturer: &NestedManufacturer{ - ID: 21, URL: "http://localhost/api/dcim/manufacturers/21/", - Name: "Manufacturer Name", - Slug: "mfg-name", - }, - Model: "Device Type Model", - Slug: "device-type-model", - }, - DeviceRole: &NestedDeviceRole{ - ID: 31, - URL: "http://localhost/api/dcim/device-roles/31/", - Name: "Device Role Name", - Slug: "device-role-name", - }, - Site: &NestedSite{ - ID: 61, - URL: "http://localhost/api/dcim/sites/61/", - Name: "Site Name", - Slug: "site-name", - }, - Status: &StatusType{ - Value: 1, - Label: "Active", - }, - }, - }, - { - desc: "Maximum device", - data: []byte(`{"id": 1, "name": "Device 1", "display_name": "Device 1", "device_type": { "id": 11, "url": "http://localhost/api/dcim/device-types/11/", "manufacturer": { "id": 21, "url": "http://localhost/api/dcim/manufacturers/21/", "name": "Manufacturer Name", "slug": "mfg-name"}, "model": "Device Type Model", "slug": "device-type-model"}, "device_role": { "id": 31, "url": "http://localhost/api/dcim/device-roles/31/", "name": "Device Role Name", "slug": "device-role-name"}, "tenant": { "id": 41, "url": "http://localhost/api/tenancy/tenants/41/", "name": "Tenant Name", "slug": "tenant-name" }, "platform": { "id": 51, "url": "http://localhost/api/dcim/platforms/51", "name": "Platform Name", "slug": "platform-name" }, "serial": "Serial", "asset_tag": "Tag", "site": { "id": 61, "url": "http://localhost/api/dcim/sites/61/", "name": "Site Name", "slug": "site-name" }, "rack": { "id": 71, "url": "http://localhost/api/dcim/racks/71/", "name": "Rack Name", "display_name": "Rack Name" }, "position": 81, "face": { "value": 0, "label": "Front" }, "status": { "value": 1, "label": "Active" } }`), - want: &Device{ - ID: 1, - Name: "Device 1", - DisplayName: "Device 1", - DeviceType: &NestedDeviceType{ - ID: 11, - URL: "http://localhost/api/dcim/device-types/11/", - Manufacturer: &NestedManufacturer{ - ID: 21, - URL: "http://localhost/api/dcim/manufacturers/21/", - Name: "Manufacturer Name", - Slug: "mfg-name", - }, - Model: "Device Type Model", - Slug: "device-type-model", - }, - DeviceRole: &NestedDeviceRole{ - ID: 31, - URL: "http://localhost/api/dcim/device-roles/31/", - Name: "Device Role Name", - Slug: "device-role-name", - }, - Tenant: &NestedTenant{ - ID: 41, - URL: "http://localhost/api/tenancy/tenants/41/", - Name: "Tenant Name", - Slug: "tenant-name", - }, - Platform: &NestedPlatform{ - ID: 51, - URL: "http://localhost/api/dcim/platforms/51", - Name: "Platform Name", - Slug: "platform-name", - }, - Serial: "Serial", - AssetTag: "Tag", - Site: &NestedSite{ - ID: 61, - URL: "http://localhost/api/dcim/sites/61/", - Name: "Site Name", - Slug: "site-name", - }, - Rack: &NestedRack{ - ID: 71, - URL: "http://localhost/api/dcim/racks/71/", - Name: "Rack Name", - DisplayName: "Rack Name", - }, - Position: 81, - Face: &FaceType{ - Value: 0, - Label: "Front", - }, - Status: &StatusType{ - Value: 1, - Label: "Active", - }, - }, - }, - } - - for idx, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", idx, tt.desc), func(t *testing.T) { - result := new(Device) - err := json.Unmarshal(tt.data, result) - if err != nil { - t.Fatalf("unexpected error from Device.UnmarshalJSON: %v", err) - } - - if want, got := tt.want, result; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Device:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestDeviceMarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data *Device - want []byte - }{ - { - desc: "Sample Device", - data: testDevice(1), - want: []byte(`{"id":1,"name":"Device 1","display_name":"Device 1","device_type":2001,"device_role":1001,"tenant":3001,"platform":4001,"site":5001,"rack":6001}`), - }, - } - - for idx, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", idx, tt.desc), func(t *testing.T) { - result, err := json.Marshal(tt.data) - if err != nil { - t.Fatalf("unexpected error from writableDevice.MarshalJSON: %v", err) - } - if want, got := tt.want, result; bytes.Compare(want, got) != 0 { - t.Fatalf("unexpected JSON:\n- want: %v\n- got: %v", string(want), string(got)) - } - }) - } -} - -func testNestedDeviceRole(id int) *NestedDeviceRole { - return &NestedDeviceRole{ - ID: id, - URL: fmt.Sprintf("http://localhost/api/dcim/device-roles/%d/", id), - Name: fmt.Sprintf("Device Role %d", id), - Slug: fmt.Sprintf("device-role-%d", id), - } -} - -func testNestedPlatform(id int) *NestedPlatform { - return &NestedPlatform{ - ID: id, - URL: fmt.Sprintf("http://localhost/api/dcim/platforms/%d/", id), - Name: fmt.Sprintf("Platform %d", id), - Slug: fmt.Sprintf("platform-%d", id), - } -} - -func testNestedTenant(id int) *NestedTenant { - return &NestedTenant{ - ID: id, - URL: fmt.Sprintf("http://localhost/api/tenancy/tenants/%d/", id), - Name: fmt.Sprintf("Tenant %d", id), - Slug: fmt.Sprintf("tenant-%d", id), - } -} - -func testNestedSite(id int) *NestedSite { - return &NestedSite{ - ID: id, - URL: fmt.Sprintf("http://localhost/api/dcim/sites/%d/", id), - Name: fmt.Sprintf("Site %d", id), - Slug: fmt.Sprintf("site-%d", id), - } -} - -func testNestedRack(id int) *NestedRack { - return &NestedRack{ - ID: id, - URL: fmt.Sprintf("http://localhost/api/dcim/racks/%d/", id), - Name: fmt.Sprintf("Rack %d", id), - DisplayName: fmt.Sprintf("Rack %d", id), - } -} - -func testNestedDeviceType(id int) *NestedDeviceType { - manufacturerID := id + 1000 - return &NestedDeviceType{ - ID: id, - URL: fmt.Sprintf("http://localhost/api/dcim/device-types/%d/", id), - Manufacturer: testNestedManufacturer(manufacturerID), - Model: fmt.Sprintf("Device Type Model of %d", id), - Slug: fmt.Sprintf("test-device-type-model-%d", id), - } -} - -func testDevice(id int) *Device { - roleID := id + 1000 - typeID := id + 2000 - tenantID := id + 3000 - platformID := id + 4000 - siteID := id + 5000 - rackID := id + 6000 - - return testDeviceHelper(id, false, testNestedDeviceType(typeID), testNestedDeviceRole(roleID), testNestedTenant(tenantID), testNestedPlatform(platformID), testNestedSite(siteID), testNestedRack(rackID)) -} - -func testDeviceCreate(id int) *Device { - roleID := id + 1000 - typeID := id + 2000 - tenantID := id + 3000 - platformID := id + 4000 - siteID := id + 5000 - rackID := id + 6000 - return testDeviceHelper(id, true, testNestedDeviceType(typeID), testNestedDeviceRole(roleID), testNestedTenant(tenantID), testNestedPlatform(platformID), testNestedSite(siteID), testNestedRack(rackID)) -} - -func testDeviceHelper(id int, create bool, devicetype *NestedDeviceType, role *NestedDeviceRole, tenant *NestedTenant, platform *NestedPlatform, site *NestedSite, rack *NestedRack) *Device { - deviceID := id - - if create { - deviceID = 0 - } - - return &Device{ - ID: deviceID, - Name: fmt.Sprintf("Device %d", id), - DisplayName: fmt.Sprintf("Device %d", id), - DeviceType: devicetype, - DeviceRole: role, - Tenant: tenant, - Platform: platform, - Site: site, - Rack: rack, - } -} diff --git a/netbox/dcim_devices_types.go b/netbox/dcim_devices_types.go deleted file mode 100644 index d130921c1ed8943f73776a47930dfddb10476190..0000000000000000000000000000000000000000 --- a/netbox/dcim_devices_types.go +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "encoding/json" - "net/url" - "strconv" -) - -type nestedBase struct { - ID int `json:"id"` - URL string `json:"url"` - Name string `json:"name"` - Slug string `json:"slug"` -} - -type simpleValueLabel struct { - Value int `json:"value"` - Label string `json:"label"` -} - -// ShortDeviceBay represent the short form of a Device Bay -// when a Device Bay appears in a parent device of -// another object. -type ShortDeviceBay struct { - ID int `json:"id"` - Name string `json:"name"` -} - -// ShortDevice corresponds to the simple form of -// a Device, when a Device appears as a -// parent device of another object -type ShortDevice struct { - DeviceBay *ShortDeviceBay `json:"device_bay"` - ID int `json:"id"` - Name string `json:"name"` -} - -// FaceType represent the face of a Device in a Rack (Front/Rear) -type FaceType simpleValueLabel - -// StatusType represent status of a Device in Netbox API. -type StatusType simpleValueLabel - -// A NestedDeviceRole corresponds to the Netbox API's -// nested serializer, when a DeviceRole appears as a -// parent of another object -type NestedDeviceRole nestedBase - -// A NestedPlatform corresponds to the Netbox API's -// nested serializer, when a Platform appears as a -// parent of another object -type NestedPlatform nestedBase - -// A NestedTenant corresponds to the Netbox API's -// nested serializer, when a Tenant appears as a -// parent of another object -type NestedTenant nestedBase - -// A NestedSite corresponds to the Netbox API's -// nested serializer, when a Site appears as a -// parent of another object -type NestedSite nestedBase - -// A NestedDeviceType corresponds to the Netbox API's -// nested serializer, when a DeviceType appears as a -// parent of another object -type NestedDeviceType struct { - ID int `json:"id"` - URL string `json:"url"` - Manufacturer *NestedManufacturer `json:"manufacturer"` - Model string `json:"model"` - Slug string `json:"slug"` -} - -// A NestedRack correspondes to the Netbox API's -// nested serializer, when a Rack appears as a -// parent of another object -type NestedRack struct { - ID int `json:"id"` - URL string `json:"url"` - Name string `json:"name"` - DisplayName string `json:"display_name"` -} - -// A NestedIP will be used as nested serializer for -// IPv4, IPv6 ip address -type NestedIP struct { - ID int `json:"id"` - URL string `json:"url"` - Family int `json:"family"` - Address string `json:"address"` -} - -// A Device corresponds to the Netbox API's -// base serializer for Device -type Device struct { - ID int `json:"id,omitempty"` - Name string `json:"name"` - DisplayName string `json:"display_name"` - DeviceType *NestedDeviceType `json:"device_type"` - DeviceRole *NestedDeviceRole `json:"device_role"` - Tenant *NestedTenant `json:"tenant,omitempty"` - Platform *NestedPlatform `json:"platform,omitempty"` - Serial string `json:"serial,omitempty"` - AssetTag string `json:"asset_tag,omitempty"` - Site *NestedSite `json:"site"` - Rack *NestedRack `json:"rack,omitempty"` - Position int `json:"position,omitempty"` - Face *FaceType `json:"face,omitempty"` - Parent *ShortDevice `json:"parent_device,omitempty"` - Status *StatusType `json:"status"` - PrimaryIP *NestedIP `json:"primary_ip,omitempty"` - PrimaryIPv4 *NestedIP `json:"primary_ip4,omitempty"` - PrimaryIPv6 *NestedIP `json:"primary_ip6,omitempty"` - Comments string `json:"comments,omitempty"` -} - -// A writableDevice corresponds to the Netbox API's -// writable serializer for a Device. It is used transparently -// when Devices are serialize into JSON. -type writableDevice struct { - ID int `json:"id,omitempty"` - Name string `json:"name"` - DisplayName string `json:"display_name"` - DeviceType int `json:"device_type"` - DeviceRole int `json:"device_role"` - Tenant int `json:"tenant,omitempty"` - Platform int `json:"platform,omitempty"` - Serial string `json:"serial,omitempty"` - AssetTag string `json:"asset_tag,omitempty"` - Site int `json:"site"` - Rack int `json:"rack,omitempty"` - Position int `json:"position,omitempty"` - Face string `json:"face,omitempty"` - Parent int `json:"parent_device,omitempty"` - Status string `json:"status,omitempty"` - PrimaryIP int `json:"primary_ip,omitempty"` - PrimaryIPv4 int `json:"primary_ip4,omitempty"` - PrimaryIPv6 int `json:"primary_ip6,omitempty"` - Comments string `json:"comments,omitempty"` -} - -// MarshalJSON marshals a Device into JSON bytes, -// and is used by the standard json package. -func (d *Device) MarshalJSON() ([]byte, error) { - var typeID, roleID, tenantID, platformID, siteID, rackID, parentID, primaryIPID, primaryIPv4ID, primaryIPv6ID int - var status, face string - - if d.DeviceType != nil { - typeID = d.DeviceType.ID - } - - if d.DeviceRole != nil { - roleID = d.DeviceRole.ID - } - - if d.Tenant != nil { - tenantID = d.Tenant.ID - } - - if d.Platform != nil { - platformID = d.Platform.ID - } - - if d.Site != nil { - siteID = d.Site.ID - } - - if d.Rack != nil { - rackID = d.Rack.ID - } - - if d.PrimaryIP != nil { - primaryIPID = d.PrimaryIP.ID - } - - if d.PrimaryIPv4 != nil { - primaryIPv4ID = d.PrimaryIPv4.ID - } - - if d.PrimaryIPv6 != nil { - primaryIPv6ID = d.PrimaryIPv6.ID - } - - if d.Face != nil { - face = d.Face.Label - } - - if d.Parent != nil { - parentID = d.Parent.ID - } - - if d.Status != nil { - status = d.Status.Label - } - - return json.Marshal(writableDevice{ - ID: d.ID, - Name: d.Name, - DisplayName: d.DisplayName, - DeviceType: typeID, - DeviceRole: roleID, - Tenant: tenantID, - Platform: platformID, - Serial: d.Serial, - AssetTag: d.AssetTag, - Site: siteID, - Rack: rackID, - Position: d.Position, - Face: face, - Parent: parentID, - Status: status, - PrimaryIP: primaryIPID, - PrimaryIPv4: primaryIPv4ID, - PrimaryIPv6: primaryIPv6ID, - Comments: d.Comments, - }) - -} - -// ListDeviceOptions is used as an argument for Client.DCIM.Devices.List. -// Integer fileds with an *ID suffix are preferred over their string -// counterparts, and if both are set, only the *ID filed will be used. -type ListDeviceOptions struct { - Name string - Serial string - AssetTag string - MacAddress string - IDIn int - SiteID int - Site string - RackGroupID int - RackID int - RoleID int - Role string - TenantID int - Tenant string - DeviceTypeID int - ManufacturerID int - Manufacturer string - DeviceModel string - PlatformID int - Platform string - Status string - IsConsoleServer *bool - IsPDU *bool - IsNetworkDevice *bool - HasPrimaryIP *bool - - Query string -} - -// Values generates a url.Values map from the data in ListDeviceOptions. -func (o *ListDeviceOptions) Values() (url.Values, error) { - if o == nil { - return nil, nil - } - - v := url.Values{} - - status := map[string]int{ - "Offline": 0, - "Active": 1, - "Planned": 2, - "Staged": 3, - "Failed": 4, - "Inventory": 5, - } - - switch { - case o.SiteID != 0: - v.Set("site_id", strconv.Itoa(o.SiteID)) - case o.Site != "": - v.Set("site", o.Site) - } - - switch { - case o.TenantID != 0: - v.Set("tenant_id", strconv.Itoa(o.TenantID)) - case o.Tenant != "": - v.Set("tenant", o.Tenant) - } - - switch { - case o.ManufacturerID != 0: - v.Set("manufacturer_id", strconv.Itoa(o.ManufacturerID)) - case o.Manufacturer != "": - v.Set("manufacturer", o.Manufacturer) - } - - switch { - case o.PlatformID != 0: - v.Set("platform_id", strconv.Itoa(o.PlatformID)) - case o.Platform != "": - v.Set("platform", o.Platform) - } - - switch { - case o.RoleID != 0: - v.Set("role_id", strconv.Itoa(o.RoleID)) - case o.Role != "": - v.Set("role", o.Role) - } - - if o.Name != "" { - v.Set("name", o.Name) - } - - if o.Serial != "" { - v.Set("serial", o.Serial) - } - - if o.AssetTag != "" { - v.Set("asset_tag", o.AssetTag) - } - - if o.MacAddress != "" { - v.Set("mac_address", o.MacAddress) - } - - if o.IDIn != 0 { - v.Set("id__in", strconv.Itoa(o.IDIn)) - } - - if o.RackGroupID != 0 { - v.Set("rack_group_id", strconv.Itoa(o.RackGroupID)) - } - - if o.RackID != 0 { - v.Set("rack_id", strconv.Itoa(o.RackID)) - } - - if o.DeviceTypeID != 0 { - v.Set("device_type_id", strconv.Itoa(o.DeviceTypeID)) - } - - if o.DeviceModel != "" { - v.Set("model", o.DeviceModel) - } - - if o.Status != "" { - v.Set("status", strconv.Itoa(status[o.Status])) - } - - if o.IsConsoleServer != nil { - v.Set("is_console_server", strconv.FormatBool(*o.IsConsoleServer)) - } - - if o.IsPDU != nil { - v.Set("is_pdu", strconv.FormatBool(*o.IsPDU)) - } - - if o.IsNetworkDevice != nil { - v.Set("is_network_device", strconv.FormatBool(*o.IsNetworkDevice)) - } - - if o.HasPrimaryIP != nil { - v.Set("has_primary_ip", strconv.FormatBool(*o.HasPrimaryIP)) - } - - if o.Query != "" { - v.Set("q", o.Query) - } - - return v, nil -} - -//go:generate go run generate_functions.go -endpoint dcim -service devices -service-name DevicesService -type-name Device -update-type-name writableDevice -//go:generate go run generate_basic_tests.go -client-endpoint DCIM -client-service Devices -endpoint dcim -service devices -service-name DevicesService -type-name Device diff --git a/netbox/dcim_inventory-items.go b/netbox/dcim_inventory-items.go deleted file mode 100644 index 73a9ff4eaa92be178e1f01d4275ca27c61dd264e..0000000000000000000000000000000000000000 --- a/netbox/dcim_inventory-items.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_functions.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// InventoryItemsService is used in a Client to access NetBox's dcim/inventory-items API methods. -type InventoryItemsService struct { - c *Client -} - -// Get retrieves an InventoryItem object from NetBox by its ID. -func (s *InventoryItemsService) Get(id int) (*InventoryItem, error) { - req, err := s.c.NewRequest( - http.MethodGet, - fmt.Sprintf("api/dcim/inventory-items/%d/", id), - nil, - ) - if err != nil { - return nil, err - } - - t := new(InventoryItem) - err = s.c.Do(req, t) - if err != nil { - return nil, err - } - return t, nil -} - -// List returns a Page associated with an NetBox API Endpoint. -func (s *InventoryItemsService) List(options *ListInventoryItemOptions) *Page { - return NewPage(s.c, "api/dcim/inventory-items/", options) -} - -// Extract retrives a list of InventoryItem objects from page. -func (s *InventoryItemsService) Extract(page *Page) ([]*InventoryItem, error) { - if err := page.Err(); err != nil { - return nil, err - } - - var groups []*InventoryItem - if err := json.Unmarshal(page.data.Results, &groups); err != nil { - return nil, err - } - return groups, nil -} - -// Create creates a new InventoryItem object in NetBox and returns the ID of the new object. -func (s *InventoryItemsService) Create(data *InventoryItem) (int, error) { - req, err := s.c.NewJSONRequest(http.MethodPost, "api/dcim/inventory-items/", nil, data) - if err != nil { - return 0, err - } - - g := new(writableInventoryItem) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Update changes an existing InventoryItem object in NetBox, and returns the ID of the new object. -func (s *InventoryItemsService) Update(data *InventoryItem) (int, error) { - req, err := s.c.NewJSONRequest( - http.MethodPatch, - fmt.Sprintf("api/dcim/inventory-items/%d/", data.ID), - nil, - data, - ) - if err != nil { - return 0, err - } - - // g is just used to verify correct api result. - // data is not changed, because the g is not the full representation that one would - // get with Get. But if the response was unmarshaled into writableInventoryItem correctly, - // everything went fine, and we do not need to update data. - g := new(writableInventoryItem) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Delete deletes an existing InventoryItem object from NetBox. -func (s *InventoryItemsService) Delete(data *InventoryItem) error { - req, err := s.c.NewRequest( - http.MethodDelete, - fmt.Sprintf("api/dcim/inventory-items/%d/", data.ID), - nil, - ) - if err != nil { - return err - } - - return s.c.Do(req, nil) -} diff --git a/netbox/dcim_inventory-items_basic_test.go b/netbox/dcim_inventory-items_basic_test.go deleted file mode 100644 index fbf62e8f9a7c3e5924fb019d56b0eabf57181022..0000000000000000000000000000000000000000 --- a/netbox/dcim_inventory-items_basic_test.go +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_basic_tests.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "errors" - "fmt" - "net/http" - "reflect" - "testing" -) - -// Using this to override MarshalJSON -// In all cases when posting data to netbox-API, the InventoryItem.MarshalJSON is what you want, -// but not here as a return in testHandler -type serverDataInventoryItem InventoryItem - -func convertToServerDataInventoryItem(data []*InventoryItem) []*serverDataInventoryItem { - dataWant := make([]*serverDataInventoryItem, len(data)) - for i := range data { - tmp := serverDataInventoryItem(*data[i]) - dataWant[i] = &tmp - } - return dataWant -} - -func TestBasicInventoryItemGet(t *testing.T) { - var tests = []struct { - desc string - want *InventoryItem - }{ - { - desc: "Simple InventoryItem", - want: testInventoryItem(1), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - serverData := serverDataInventoryItem(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/dcim/inventory-items/1/", &serverData)) - defer done() - - res, err := c.DCIM.InventoryItems.Get(1) - if err != nil { - t.Fatalf("unexpected error from Client.DCIM.InventoryItems.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected InventoryItem:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicInventoryItemGet404(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodGet, "/api/dcim/inventory-items/1/", &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - http.StatusNotFound)) - defer done() - - res, err := c.DCIM.InventoryItems.Get(1) - errstr := "404 - Not found." - if want, got := errors.New(errstr), err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error from Client.DCIM.InventoryItems.Get:\n- want: %v\n- got: %v", want, got) - } - - if res != nil { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", nil, res) - } -} - -func TestBasicListExtractInventoryItem(t *testing.T) { - want := []*InventoryItem{ - testInventoryItem(1), - testInventoryItem(2), - } - serverWant := convertToServerDataInventoryItem(want) - serverData, _ := json.Marshal(serverWant) - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/dcim/inventory-items/", &pageData{ - Count: 2, - NextURL: "", - PreviousURL: "", - Results: serverData, - })) - defer done() - - page := c.DCIM.InventoryItems.List(nil) - - if page == nil { - t.Fatalf("unexpexted result from c.DCIM.InventoryItems.List.") - } - - got := []*InventoryItem{} - counter := 0 - for page.Next() { - var err error - got, err = c.DCIM.InventoryItems.Extract(page) - if err != nil { - t.Fatalf("unexpected error from c.DCIM.InventoryItems.Extract: %v", err) - } - counter = counter + 1 - if counter > 2 { // Safe guard - break - } - } - if counter != 1 { - t.Fatalf("unexpected page count:\n- want: 1\n- got: %d", counter) - } - - if !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", want, got) - } - - if page.Err() != nil { - t.Fatalf("unexpected error from page:\n- want: %v\n- got: %v", want, got) - } -} - -func TestBasicCreateInventoryItem(t *testing.T) { - var tests = []struct { - desc string - data *InventoryItem - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Create with ID 0", - data: testInventoryItemCreate(1), - want: 1, - status: 0, - errstr: "", - serverData: testInventoryItem(1), - }, - { - desc: "Create duplicate", - data: testInventoryItemCreate(1), - want: 0, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"InventoryItemsService with this name already exists.\"]}\n", - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"InventoryItemsService with this name already exists."}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPost, "/api/dcim/inventory-items/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.DCIM.InventoryItems.Create(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected InventoryItem:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicUpdateInventoryItem(t *testing.T) { - var tests = []struct { - desc string - data *InventoryItem - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Update with ID 1", - data: testInventoryItem(1), - want: 1, - serverData: testInventoryItem(1), - status: 0, - errstr: "", - }, - { - desc: "Update not found", - data: testInventoryItem(1), - want: 0, - serverData: &struct { - Detail string - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - { - desc: "Update to duplicate", - data: testInventoryItem(1), - want: 0, - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"InventoryItemsService with this name already exists."}, - }, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"InventoryItemsService with this name already exists.\"]}\n", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPatch, "/api/dcim/inventory-items/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.DCIM.InventoryItems.Update(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected InventoryItem:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicDeleteInventoryItem(t *testing.T) { - var tests = []struct { - desc string - data *InventoryItem - serverData interface{} - status int - errstr string - }{ - { - desc: "Delete ID 1", - data: testInventoryItem(1), - serverData: testInventoryItem(1), - status: 0, - errstr: "", - }, - { - desc: "Delete not Found", - data: testInventoryItem(1), - serverData: &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodDelete, "/api/dcim/inventory-items/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - err := c.DCIM.InventoryItems.Delete(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} diff --git a/netbox/dcim_inventory-items_test.go b/netbox/dcim_inventory-items_test.go deleted file mode 100644 index 5f5c5a2e1fd3cf0ee2201b19171ee048c2e060df..0000000000000000000000000000000000000000 --- a/netbox/dcim_inventory-items_test.go +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "bytes" - "encoding/json" - "fmt" - "net/http" - "net/url" - "reflect" - "testing" -) - -func TestInventoryItemGet(t *testing.T) { - var tests = []struct { - desc string - want *InventoryItem - wantManufacturer *NestedManufacturer - }{ - { - desc: "InventoryItem without Manufacturer", - want: testInventoryItem(1), - }, - { - desc: "InventoryItem with Manufacturer", - want: testInventoryItemWithManufacturer(1), - }, - } - - for idx, ii := range tests { - t.Run(fmt.Sprintf("[%d] %s", idx, ii.desc), func(t *testing.T) { - serverData := serverDataInventoryItem(*ii.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/dcim/inventory-items/1/", &serverData)) - defer done() - - res, err := c.DCIM.InventoryItems.Get(1) - if err != nil { - t.Fatalf("unexpected error from c.DCIM.InventoryItems.Get: %v", err) - } - - if want, got := ii.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected InventoryItem\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestInventoryItemUnmarshalJSON(t *testing.T) { - parentID := 4 - var tests = []struct { - desc string - data []byte - want *InventoryItem - }{ - { - desc: "Minimal inventory item", - data: []byte(`{ "id": 4, "device": { "id": 1, "url": "http://localhost:8000/api/dcim/devices/1/", "name": "Test Device 1", "display_name": "Test Device 1"}, "parent": null, "name": "device name", "manufacturer": null }`), - want: &InventoryItem{ - ID: 4, - Device: NestedDevice{ - ID: 1, - URL: "http://localhost:8000/api/dcim/devices/1/", - Name: "Test Device 1", - DisplayName: "Test Device 1", - }, - Name: "device name", - Parent: nil, - Manufacturer: nil, - }, - }, - { - desc: "Maximal inventory item", - data: []byte(`{ "id": 2, "device": { "id": 1, "url": "http://localhost:8000/api/dcim/devices/1/", "name": "Test Device 1", "display_name": "Test Device 1" }, "parent": 4, "name": "the device name", "manufacturer": { "id": 10, "url": "http://localhost:8000/api/dcim/manufacturers/10/", "name": "manufacturer name", "slug": "mfg-name" }, "part_id": "the part ID", "serial": "the serial", "discovered": true }`), - want: &InventoryItem{ - ID: 2, - Device: NestedDevice{ - ID: 1, - URL: "http://localhost:8000/api/dcim/devices/1/", - Name: "Test Device 1", - DisplayName: "Test Device 1", - }, - Parent: &parentID, - Name: "the device name", - Manufacturer: &NestedManufacturer{ - ID: 10, - URL: "http://localhost:8000/api/dcim/manufacturers/10/", - Name: "manufacturer name", - Slug: "mfg-name", - }, - PartID: "the part ID", - Serial: "the serial", - Discovered: true, - }, - }, - } - - for idx, ii := range tests { - t.Run(fmt.Sprintf("[%d] %s", idx, ii.desc), func(t *testing.T) { - result := new(InventoryItem) - err := json.Unmarshal(ii.data, result) - if err != nil { - t.Fatalf("unexpected error from InventoryItem.UnmarshalJSON: %v", err) - } - - if want, got := ii.want, result; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected InventoryItem:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestInventoryItemMarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data *InventoryItem - want []byte - }{ - { - desc: "Inventory item without manufacturer", - data: testInventoryItem(1), - want: []byte(`{"id":1,"device":10001,"parent":null,"name":"Inventory Item 1","part_id":"Part ID 1","serial":"Serial 1","discovered":true}`), - }, - { - desc: "Inventory item with manufacturer", - data: testInventoryItemWithManufacturer(2), - want: []byte(`{"device":10002,"parent":null,"name":"Inventory Item 2","manufacturer":20002,"part_id":"Part ID 2","serial":"Serial 2","discovered":true}`), - }, - } - - for idx, ii := range tests { - t.Run(fmt.Sprintf("[%d] %s", idx, ii.desc), func(t *testing.T) { - result, err := json.Marshal(ii.data) - if err != nil { - t.Fatalf("unexpected error from writableInventoryItem.MarshalJSON: %v", err) - } - - if want, got := ii.want, result; bytes.Compare(want, got) != 0 { - t.Fatalf("unexpected JSON:\n- want: %v\n- got: %v", string(want), string(got)) - } - }) - } -} - -func TestWritableInventoryItemUnmarshalJSON(t *testing.T) { - parentID := 4 - manufacturerID := 6 - var tests = []struct { - desc string - data []byte - want *writableInventoryItem - }{ - { - desc: "Minimal inventory item", - data: []byte(`{ "device": 1, "parent": null, "name": "device name" }`), - want: &writableInventoryItem{Device: 1, Name: "device name"}, - }, - { - desc: "Maximal inventory item", - data: []byte(`{ "id": 2, "device": 3, "parent": 4, "name": "the device name", "manufacturer": 6, "part_id": "the part ID", "serial": "the serial", "discovered": true }`), - want: &writableInventoryItem{ - ID: 2, - Device: 3, - Parent: &parentID, - Name: "the device name", - Manufacturer: &manufacturerID, - PartID: "the part ID", - Serial: "the serial", - Discovered: true, - }, - }, - } - - for idx, ii := range tests { - t.Run(fmt.Sprintf("[%d] %s", idx, ii.desc), func(t *testing.T) { - result := new(writableInventoryItem) - err := json.Unmarshal(ii.data, result) - if err != nil { - t.Fatalf("unexpected error from writableInventoryItem.UnmarshalJSON: %v", err) - } - - if want, got := ii.want, result; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected writableInventoryItem:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestListInventoryItemOptions(t *testing.T) { - var tests = []struct { - desc string - o *ListInventoryItemOptions - v url.Values - }{ - { - desc: "empty options", - }, - { - desc: "full options", - o: &ListInventoryItemOptions{ - Name: "Hello", - DeviceID: 1, - Device: "node_name_1", - }, - v: url.Values{ - "name": []string{"Hello"}, - "device_id": []string{"1"}, - }, - }, - { - desc: "device name", - o: &ListInventoryItemOptions{ - Name: "Hello", - Device: "node_name_1", - }, - v: url.Values{ - "name": []string{"Hello"}, - "device": []string{"node_name_1"}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - v, err := tt.o.Values() - if err != nil { - t.Fatalf("unexpected Values error: %v", err) - } - - if want, got := tt.v, v; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected url.Values map:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func testInventoryItem(id int) *InventoryItem { - return testInventoryItemHelper(id, false, nil) -} - -func testInventoryItemCreate(id int) *InventoryItem { - return testInventoryItemHelper(id, true, nil) -} - -func testInventoryItemWithManufacturer(id int) *InventoryItem { - return testInventoryItemHelper(id, true, testNestedManufacturer(id+20000)) -} - -func testNestedManufacturer(id int) *NestedManufacturer { - return &NestedManufacturer{ - ID: id, - URL: fmt.Sprintf("http://localhost:8000/api/dcim/manufacturers/%d/", id), - Name: fmt.Sprintf("Test nested manufacturer %d", id), - Slug: fmt.Sprintf("test-nested-manufacturer-%d", id), - } -} - -func testInventoryItemHelper(id int, create bool, manufacturer *NestedManufacturer) *InventoryItem { - deviceID := id + 10000 - device := NestedDevice{ - ID: deviceID, - URL: fmt.Sprintf("http://example.host/api/dcim/devices/%d/", deviceID), - Name: fmt.Sprintf("Device %d", deviceID), - DisplayName: fmt.Sprintf("Display Device %d", deviceID), - } - - itemID := id - if create { - itemID = 0 - } - return &InventoryItem{ - ID: itemID, - Device: device, - Parent: nil, - Name: fmt.Sprintf("Inventory Item %d", id), - Manufacturer: manufacturer, - PartID: fmt.Sprintf("Part ID %d", id), - Serial: fmt.Sprintf("Serial %d", id), - Discovered: true, - } -} diff --git a/netbox/dcim_inventory-items_types.go b/netbox/dcim_inventory-items_types.go deleted file mode 100644 index bdc4c8c74603ae37c12757f30218652661559d05..0000000000000000000000000000000000000000 --- a/netbox/dcim_inventory-items_types.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "encoding/json" - "net/url" - "strconv" -) - -// A NestedManufacturer corresponds to the Netbox API's -// nested serializer, when a manufacturer appears as a -// parent of another object. -// -// https://netbox.readthedocs.io/en/stable/api/overview/#serialization -type NestedManufacturer struct { - ID int `json:"id"` - URL string `json:"url"` - Name string `json:"name"` - Slug string `json:"slug"` -} - -// A NestedDevice corresponds to the Netbox API's -// nested serializer, when a device appears as a -// parent of another object. -type NestedDevice struct { - ID int `json:"id"` - URL string `json:"url"` - Name string `json:"name"` - DisplayName string `json:"display_name"` -} - -// An InventoryItem corresponds to the Netbox API's -// base serializer for Inventory Items. -type InventoryItem struct { - ID int `json:"id,omitempty"` - Device NestedDevice `json:"device"` - Parent *int `json:"parent"` - Name string `json:"name"` - Manufacturer *NestedManufacturer `json:"manufacturer,omitempty"` - PartID string `json:"part_id,omitempty"` - Serial string `json:"serial,omitempty"` - Discovered bool `json:"discovered,omitempty"` -} - -// A writableInventoryItem corresponds to the Netbox API's -// writable serializer for an InventoryItem. It is used transparently -// when IventoryItems are serialized in to JSON. -type writableInventoryItem struct { - ID int `json:"id,omitempty"` - Device int `json:"device"` - Parent *int `json:"parent"` - Name string `json:"name"` - Manufacturer *int `json:"manufacturer,omitempty"` - PartID string `json:"part_id,omitempty"` - Serial string `json:"serial,omitempty"` - Discovered bool `json:"discovered,omitempty"` -} - -// MarshalJSON marshals an InventoryItem into JSON bytes, -// and is used by the standard json package. -func (i *InventoryItem) MarshalJSON() ([]byte, error) { - var manufacturerID *int - if i.Manufacturer != nil { - manufacturerID = &i.Manufacturer.ID - } - return json.Marshal(writableInventoryItem{ - ID: i.ID, - Device: i.Device.ID, - Parent: i.Parent, - Name: i.Name, - Manufacturer: manufacturerID, - PartID: i.PartID, - Serial: i.Serial, - Discovered: i.Discovered, - }) -} - -// ListInventoryItemOptions is used as an argument for Client.DCIM.InventoryItems.List. -// Integer fields with an *ID suffix are preferred over their string -// counterparts, and if both are set, only the *ID field will be used. -type ListInventoryItemOptions struct { - Name string - DeviceID int - Device string -} - -// Values generates a url.Values map from the data in ListTenantOptions. -func (o *ListInventoryItemOptions) Values() (url.Values, error) { - if o == nil { - return nil, nil - } - - v := url.Values{} - - if o.Name != "" { - v.Set("name", o.Name) - } - - switch { - case o.DeviceID != 0: - v.Set("device_id", strconv.Itoa(o.DeviceID)) - case o.Device != "": - v.Set("device", o.Device) - } - - return v, nil -} - -//go:generate go run generate_functions.go -type-name InventoryItem -update-type-name writableInventoryItem -service-name InventoryItemsService -endpoint dcim -service inventory-items -//go:generate go run generate_basic_tests.go -type-name InventoryItem -service-name InventoryItemsService -endpoint dcim -service inventory-items -client-endpoint DCIM -client-service InventoryItems diff --git a/netbox/doc.go b/netbox/doc.go deleted file mode 100644 index 558f7233145bec714e06b8eb29a7d28d999827fb..0000000000000000000000000000000000000000 --- a/netbox/doc.go +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package netbox provides an API 2.0 client for DigitalOcean's NetBox IPAM -// and DCIM service. -package netbox diff --git a/netbox/generate_basic_tests.go b/netbox/generate_basic_tests.go deleted file mode 100644 index 80d879b73416b7dbfdba24b4e68b82c80ef04028..0000000000000000000000000000000000000000 --- a/netbox/generate_basic_tests.go +++ /dev/null @@ -1,383 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//+build ignore - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "log" - "os" - "text/template" - "time" -) - -func main() { - typeName := flag.String("type-name", "Example", "Name of the type to use (e.g. TenantGroup).") - serviceName := flag.String("service-name", "ExampleService", "Name of the service to create (e.g. TenantGroupsService).") - endpoint := flag.String("endpoint", "tenancy", "Name of the endpoint (e.g. dcim, ipam, tenancy).") - service := flag.String("service", "example", "Name of the service below endpoint (e.g. tenant-groups).") - clientEndpoint := flag.String("client-endpoint", "Tenancy", "Name of the client endpoint (e.g. DCIM, IPAM, Tenancy).") - clientService := flag.String("client-service", "TenantGroups", "Name of the client service (e.g. TenantGroups, Tenants).") - withoutListOpts := flag.Bool("without-list-opts", false, "Disable list options for this endpoint.") - - flag.Parse() - - b := &bytes.Buffer{} - functionsTemplate.Execute(b, struct { - Timestamp time.Time - TypeName string - ServiceName string - Endpoint string - Service string - ClientEndpoint string - ClientService string - ListOpts bool - JSONTag func(string) string - }{ - Timestamp: time.Now(), - TypeName: *typeName, - ServiceName: *serviceName, - Endpoint: *endpoint, - Service: *service, - ClientEndpoint: *clientEndpoint, - ClientService: *clientService, - ListOpts: !*withoutListOpts, - JSONTag: func(name string) string { return "`json:\"" + name + "\"`" }, - }) - - // go fmt - res, err := format.Source(b.Bytes()) - if err != nil { - log.Fatal(err) - } - - f, err := os.Create(fmt.Sprintf("%s_%s_basic_test.go", *endpoint, *service)) - if err != nil { - log.Fatal(err) - } - defer f.Close() - _, err = f.Write(res) - if err != nil { - log.Fatal(err) - } -} - -var functionsTemplate = template.Must(template.New("").Parse(`// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_basic_tests.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "errors" - "fmt" - "net/http" - "reflect" - "testing" -) - -// Using this to override MarshalJSON -// In all cases when posting data to netbox-API, the {{ .TypeName }}.MarshalJSON is what you want, -// but not here as a return in testHandler -type serverData{{ .TypeName }} {{ .TypeName }} - -func convertToServerData{{ .TypeName }}(data []*{{ .TypeName }}) []*serverData{{ .TypeName }} { - dataWant := make([]*serverData{{ .TypeName }}, len(data)) - for i := range data { - tmp := serverData{{ .TypeName }}(*data[i]) - dataWant[i] = &tmp - } - return dataWant -} - -func TestBasic{{ .TypeName }}Get(t *testing.T) { - var tests = []struct { - desc string - want *{{ .TypeName }} - }{ - { - desc: "Simple {{ .TypeName }}", - want: test{{ .TypeName }}(1), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - serverData := serverData{{ .TypeName }}(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/{{ .Endpoint }}/{{ .Service }}/1/", &serverData)) - defer done() - - res, err := c.{{ .ClientEndpoint }}.{{ .ClientService }}.Get(1) - if err != nil { - t.Fatalf("unexpected error from Client.{{ .ClientEndpoint }}.{{ .ClientService }}.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected {{ .TypeName }}:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasic{{ .TypeName }}Get404(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodGet, "/api/{{ .Endpoint }}/{{ .Service }}/1/", &struct { - Detail string {{ call .JSONTag "detail" }} - }{ - Detail: "Not found.", - }, - http.StatusNotFound)) - defer done() - - res, err := c.{{ .ClientEndpoint }}.{{ .ClientService }}.Get(1) - errstr := "404 - Not found." - if want, got := errors.New(errstr), err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error from Client.{{ .ClientEndpoint }}.{{ .ClientService }}.Get:\n- want: %v\n- got: %v", want, got) - } - - if res != nil { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", nil, res) - } -} - -func TestBasicListExtract{{ .TypeName }}(t *testing.T) { - want := []*{{ .TypeName }}{ - test{{ .TypeName }}(1), - test{{ .TypeName }}(2), - } - serverWant := convertToServerData{{ .TypeName }}(want) - serverData, _ := json.Marshal(serverWant) - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/{{ .Endpoint }}/{{ .Service }}/", &pageData{ - Count: 2, - NextURL: "", - PreviousURL: "", - Results: serverData, - })) - defer done() - - {{ if .ListOpts -}} - page := c.{{ .ClientEndpoint }}.{{ .ClientService }}.List(nil) - {{ else }} - page := c.{{ .ClientEndpoint }}.{{ .ClientService }}.List() - {{ end }} - if page == nil { - t.Fatalf("unexpexted result from c.{{ .ClientEndpoint }}.{{ .ClientService }}.List.") - } - - got := []*{{ .TypeName }}{} - counter := 0 - for page.Next() { - var err error - got, err = c.{{ .ClientEndpoint }}.{{ .ClientService }}.Extract(page) - if err != nil { - t.Fatalf("unexpected error from c.{{ .ClientEndpoint }}.{{ .ClientService }}.Extract: %v", err) - } - counter = counter + 1 - if counter > 2 { // Safe guard - break - } - } - if counter != 1 { - t.Fatalf("unexpected page count:\n- want: 1\n- got: %d", counter) - } - - if !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", want, got) - } - - if page.Err() != nil { - t.Fatalf("unexpected error from page:\n- want: %v\n- got: %v", want, got) - } -} - -func TestBasicCreate{{ .TypeName }}(t *testing.T) { - var tests = []struct { - desc string - data *{{ .TypeName }} - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Create with ID 0", - data: test{{ .TypeName }}Create(1), - want: 1, - status: 0, - errstr: "", - serverData: test{{ .TypeName }}(1), - }, - { - desc: "Create duplicate", - data: test{{ .TypeName }}Create(1), - want: 0, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"{{ .ServiceName }} with this name already exists.\"]}\n", - serverData: &struct { - Name []string {{ call .JSONTag "name" }} - }{ - Name: []string{"{{ .ServiceName }} with this name already exists."}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPost, "/api/{{ .Endpoint }}/{{ .Service }}/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.{{ .ClientEndpoint }}.{{ .ClientService }}.Create(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected {{ .TypeName }}:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicUpdate{{ .TypeName }}(t *testing.T) { - var tests = []struct { - desc string - data *{{ .TypeName }} - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Update with ID 1", - data: test{{ .TypeName }}(1), - want: 1, - serverData: test{{ .TypeName }}(1), - status: 0, - errstr: "", - }, - { - desc: "Update not found", - data: test{{ .TypeName }}(1), - want: 0, - serverData: &struct { - Detail string - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - { - desc: "Update to duplicate", - data: test{{ .TypeName }}(1), - want: 0, - serverData: &struct { - Name []string {{ call .JSONTag "name" }} - }{ - Name: []string{"{{ .ServiceName }} with this name already exists."}, - }, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"{{ .ServiceName }} with this name already exists.\"]}\n", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPatch, "/api/{{ .Endpoint }}/{{ .Service }}/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.{{ .ClientEndpoint }}.{{ .ClientService }}.Update(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected {{ .TypeName }}:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicDelete{{ .TypeName }}(t *testing.T) { - var tests = []struct { - desc string - data *{{ .TypeName }} - serverData interface{} - status int - errstr string - }{ - { - desc: "Delete ID 1", - data: test{{ .TypeName }}(1), - serverData: test{{ .TypeName }}(1), - status: 0, - errstr: "", - }, - { - desc: "Delete not Found", - data: test{{ .TypeName }}(1), - serverData: &struct { - Detail string {{ call .JSONTag "detail" }} - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodDelete, "/api/{{ .Endpoint }}/{{ .Service }}/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - err := c.{{ .ClientEndpoint }}.{{ .ClientService }}.Delete(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} -`)) diff --git a/netbox/generate_functions.go b/netbox/generate_functions.go deleted file mode 100644 index 9411f8c3b8c218d65d1319d8d8bed90f6d907839..0000000000000000000000000000000000000000 --- a/netbox/generate_functions.go +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//+build ignore - -package main - -import ( - "bytes" - "flag" - "fmt" - "go/format" - "log" - "os" - "text/template" - "time" -) - -func main() { - typeName := flag.String("type-name", "Example", "Name of the type to use (e.g. TenantGroup).") - serviceName := flag.String("service-name", "ExampleService", "Name of the service to create (e.g. TenantGroupsService).") - endpoint := flag.String("endpoint", "tenancy", "Name of the endpoint (e.g. dcim, ipam, tenancy).") - service := flag.String("service", "example", "Name of the service below endpoint (e.g. tenant-groups).") - updateTypeName := flag.String("update-type-name", "", "Name of the type to use for creates and updates, to change the marshal behavior. Default typeName.") - withoutListOpts := flag.Bool("without-list-opts", false, "Disable list options for this endpoint.") - - flag.Parse() - - if *updateTypeName == "" { - *updateTypeName = *typeName - } - - b := &bytes.Buffer{} - functionsTemplate.Execute(b, struct { - Timestamp time.Time - TypeName string - UpdateTypeName string - ServiceName string - Endpoint string - Service string - ListOpts bool - }{ - Timestamp: time.Now(), - TypeName: *typeName, - UpdateTypeName: *updateTypeName, - ServiceName: *serviceName, - Endpoint: *endpoint, - Service: *service, - ListOpts: !*withoutListOpts, - }) - - // go fmt - res, err := format.Source(b.Bytes()) - if err != nil { - log.Fatal(err) - } - - f, err := os.Create(fmt.Sprintf("%s_%s.go", *endpoint, *service)) - if err != nil { - log.Fatal(err) - } - defer f.Close() - _, err = f.Write(res) - if err != nil { - log.Fatal(err) - } -} - -var functionsTemplate = template.Must(template.New("").Parse(`// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_functions.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// {{ .ServiceName }} is used in a Client to access NetBox's {{ .Endpoint }}/{{ .Service }} API methods. -type {{ .ServiceName }} struct { - c *Client -} - -// Get retrieves an {{ .TypeName }} object from NetBox by its ID. -func (s *{{ .ServiceName }}) Get(id int) (*{{ .TypeName }}, error) { - req, err := s.c.NewRequest( - http.MethodGet, - fmt.Sprintf("api/{{ .Endpoint }}/{{ .Service }}/%d/", id), - nil, - ) - if err != nil { - return nil, err - } - - t := new({{ .TypeName }}) - err = s.c.Do(req, t) - if err != nil { - return nil, err - } - return t, nil -} - -// List returns a Page associated with an NetBox API Endpoint. -{{ if .ListOpts -}} -func (s *{{ .ServiceName }}) List(options *List{{ .TypeName }}Options) *Page { - return NewPage(s.c, "api/{{ .Endpoint }}/{{ .Service }}/", options) -} -{{ else -}} -func (s *{{ .ServiceName }}) List() *Page { - return NewPage(s.c, "api/{{ .Endpoint }}/{{ .Service }}/", nil) -} -{{ end }} - -// Extract retrives a list of {{ .TypeName }} objects from page. -func (s *{{ .ServiceName }}) Extract(page *Page) ([]*{{ .TypeName }}, error) { - if err := page.Err(); err != nil { - return nil, err - } - - var groups []*{{ .TypeName }} - if err := json.Unmarshal(page.data.Results, &groups); err != nil { - return nil, err - } - return groups, nil -} - -// Create creates a new {{ .TypeName }} object in NetBox and returns the ID of the new object. -func (s *{{ .ServiceName }}) Create(data *{{ .TypeName }}) (int, error) { - req, err := s.c.NewJSONRequest(http.MethodPost, "api/{{ .Endpoint }}/{{ .Service }}/", nil, data) - if err != nil { - return 0, err - } - - g := new({{ .UpdateTypeName }}) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Update changes an existing {{ .TypeName }} object in NetBox, and returns the ID of the new object. -func (s *{{ .ServiceName }}) Update(data *{{ .TypeName }}) (int, error) { - req, err := s.c.NewJSONRequest( - http.MethodPatch, - fmt.Sprintf("api/{{ .Endpoint }}/{{ .Service }}/%d/", data.ID), - nil, - data, - ) - if err != nil { - return 0, err - } - - // g is just used to verify correct api result. - // data is not changed, because the g is not the full representation that one would - // get with Get. But if the response was unmarshaled into {{ .UpdateTypeName }} correctly, - // everything went fine, and we do not need to update data. - g := new({{ .UpdateTypeName }}) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Delete deletes an existing {{ .TypeName }} object from NetBox. -func (s *{{ .ServiceName }}) Delete(data *{{ .TypeName }}) error { - req, err := s.c.NewRequest( - http.MethodDelete, - fmt.Sprintf("api/{{ .Endpoint }}/{{ .Service }}/%d/", data.ID), - nil, - ) - if err != nil { - return err - } - - return s.c.Do(req, nil) -} -`)) diff --git a/netbox/ipam.go b/netbox/ipam.go deleted file mode 100644 index a5abb11e23acac08735f1e81aa7c3466d9e478e8..0000000000000000000000000000000000000000 --- a/netbox/ipam.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -// An IPAMService is used in a Client to access NetBox's IPAM API methods. -type IPAMService struct { - c *Client - VRFs *VRFsService -} - -// NewIPAMService returns a IPAMService initialized with all sub-services. -func NewIPAMService(client *Client) *IPAMService { - return &IPAMService{ - c: client, - VRFs: &VRFsService{ - c: client, - }, - } -} diff --git a/netbox/ipam_vrfs.go b/netbox/ipam_vrfs.go deleted file mode 100644 index 7524da87f9300d86ea6cacc7e91da5276d1de0d1..0000000000000000000000000000000000000000 --- a/netbox/ipam_vrfs.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_functions.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// VRFsService is used in a Client to access NetBox's ipam/vrfs API methods. -type VRFsService struct { - c *Client -} - -// Get retrieves an VRF object from NetBox by its ID. -func (s *VRFsService) Get(id int) (*VRF, error) { - req, err := s.c.NewRequest( - http.MethodGet, - fmt.Sprintf("api/ipam/vrfs/%d/", id), - nil, - ) - if err != nil { - return nil, err - } - - t := new(VRF) - err = s.c.Do(req, t) - if err != nil { - return nil, err - } - return t, nil -} - -// List returns a Page associated with an NetBox API Endpoint. -func (s *VRFsService) List(options *ListVRFOptions) *Page { - return NewPage(s.c, "api/ipam/vrfs/", options) -} - -// Extract retrives a list of VRF objects from page. -func (s *VRFsService) Extract(page *Page) ([]*VRF, error) { - if err := page.Err(); err != nil { - return nil, err - } - - var groups []*VRF - if err := json.Unmarshal(page.data.Results, &groups); err != nil { - return nil, err - } - return groups, nil -} - -// Create creates a new VRF object in NetBox and returns the ID of the new object. -func (s *VRFsService) Create(data *VRF) (int, error) { - req, err := s.c.NewJSONRequest(http.MethodPost, "api/ipam/vrfs/", nil, data) - if err != nil { - return 0, err - } - - g := new(writableVRF) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Update changes an existing VRF object in NetBox, and returns the ID of the new object. -func (s *VRFsService) Update(data *VRF) (int, error) { - req, err := s.c.NewJSONRequest( - http.MethodPatch, - fmt.Sprintf("api/ipam/vrfs/%d/", data.ID), - nil, - data, - ) - if err != nil { - return 0, err - } - - // g is just used to verify correct api result. - // data is not changed, because the g is not the full representation that one would - // get with Get. But if the response was unmarshaled into writableVRF correctly, - // everything went fine, and we do not need to update data. - g := new(writableVRF) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Delete deletes an existing VRF object from NetBox. -func (s *VRFsService) Delete(data *VRF) error { - req, err := s.c.NewRequest( - http.MethodDelete, - fmt.Sprintf("api/ipam/vrfs/%d/", data.ID), - nil, - ) - if err != nil { - return err - } - - return s.c.Do(req, nil) -} diff --git a/netbox/ipam_vrfs_basic_test.go b/netbox/ipam_vrfs_basic_test.go deleted file mode 100644 index 101530e60a90cc9b54b7a6b2083ea1fe175d9fa1..0000000000000000000000000000000000000000 --- a/netbox/ipam_vrfs_basic_test.go +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_basic_tests.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "errors" - "fmt" - "net/http" - "reflect" - "testing" -) - -// Using this to override MarshalJSON -// In all cases when posting data to netbox-API, the VRF.MarshalJSON is what you want, -// but not here as a return in testHandler -type serverDataVRF VRF - -func convertToServerDataVRF(data []*VRF) []*serverDataVRF { - dataWant := make([]*serverDataVRF, len(data)) - for i := range data { - tmp := serverDataVRF(*data[i]) - dataWant[i] = &tmp - } - return dataWant -} - -func TestBasicVRFGet(t *testing.T) { - var tests = []struct { - desc string - want *VRF - }{ - { - desc: "Simple VRF", - want: testVRF(1), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - serverData := serverDataVRF(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/ipam/vrfs/1/", &serverData)) - defer done() - - res, err := c.IPAM.VRFs.Get(1) - if err != nil { - t.Fatalf("unexpected error from Client.IPAM.VRFs.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected VRF:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicVRFGet404(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodGet, "/api/ipam/vrfs/1/", &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - http.StatusNotFound)) - defer done() - - res, err := c.IPAM.VRFs.Get(1) - errstr := "404 - Not found." - if want, got := errors.New(errstr), err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error from Client.IPAM.VRFs.Get:\n- want: %v\n- got: %v", want, got) - } - - if res != nil { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", nil, res) - } -} - -func TestBasicListExtractVRF(t *testing.T) { - want := []*VRF{ - testVRF(1), - testVRF(2), - } - serverWant := convertToServerDataVRF(want) - serverData, _ := json.Marshal(serverWant) - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/ipam/vrfs/", &pageData{ - Count: 2, - NextURL: "", - PreviousURL: "", - Results: serverData, - })) - defer done() - - page := c.IPAM.VRFs.List(nil) - - if page == nil { - t.Fatalf("unexpexted result from c.IPAM.VRFs.List.") - } - - got := []*VRF{} - counter := 0 - for page.Next() { - var err error - got, err = c.IPAM.VRFs.Extract(page) - if err != nil { - t.Fatalf("unexpected error from c.IPAM.VRFs.Extract: %v", err) - } - counter = counter + 1 - if counter > 2 { // Safe guard - break - } - } - if counter != 1 { - t.Fatalf("unexpected page count:\n- want: 1\n- got: %d", counter) - } - - if !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", want, got) - } - - if page.Err() != nil { - t.Fatalf("unexpected error from page:\n- want: %v\n- got: %v", want, got) - } -} - -func TestBasicCreateVRF(t *testing.T) { - var tests = []struct { - desc string - data *VRF - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Create with ID 0", - data: testVRFCreate(1), - want: 1, - status: 0, - errstr: "", - serverData: testVRF(1), - }, - { - desc: "Create duplicate", - data: testVRFCreate(1), - want: 0, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"IpamVRFService with this name already exists.\"]}\n", - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"IpamVRFService with this name already exists."}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPost, "/api/ipam/vrfs/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.IPAM.VRFs.Create(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected VRF:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicUpdateVRF(t *testing.T) { - var tests = []struct { - desc string - data *VRF - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Update with ID 1", - data: testVRF(1), - want: 1, - serverData: testVRF(1), - status: 0, - errstr: "", - }, - { - desc: "Update not found", - data: testVRF(1), - want: 0, - serverData: &struct { - Detail string - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - { - desc: "Update to duplicate", - data: testVRF(1), - want: 0, - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"IpamVRFService with this name already exists."}, - }, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"IpamVRFService with this name already exists.\"]}\n", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPatch, "/api/ipam/vrfs/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.IPAM.VRFs.Update(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected VRF:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicDeleteVRF(t *testing.T) { - var tests = []struct { - desc string - data *VRF - serverData interface{} - status int - errstr string - }{ - { - desc: "Delete ID 1", - data: testVRF(1), - serverData: testVRF(1), - status: 0, - errstr: "", - }, - { - desc: "Delete not Found", - data: testVRF(1), - serverData: &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodDelete, "/api/ipam/vrfs/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - err := c.IPAM.VRFs.Delete(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} diff --git a/netbox/ipam_vrfs_test.go b/netbox/ipam_vrfs_test.go deleted file mode 100644 index 3d00c622c2ffa1128e72f77256e7cc05e0c7e40e..0000000000000000000000000000000000000000 --- a/netbox/ipam_vrfs_test.go +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "bytes" - "encoding/json" - "fmt" - "net/http" - "net/url" - "reflect" - "testing" -) - -func TestVRFGet(t *testing.T) { - var tests = []struct { - desc string - want *VRF - }{ - { - desc: "Without Tenant", - want: testVRFWithTenant(1, nil), - }, - { - desc: "With Tenant", - want: testVRFWithTenant(1, testTenantWithGroup(1, nil)), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - serverData := serverDataVRF(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/ipam/vrfs/1/", &serverData)) - defer done() - - res, err := c.IPAM.VRFs.Get(1) - if err != nil { - t.Fatalf("unexpected error from Client.IPAM.VRFs.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Tenant:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestVRFUnmarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data []byte - want *VRF - }{ - { - desc: "Nil Group", - data: []byte(`{ "id": 1, "name": "VRF 1", "rd": "vrf-1", "tenant": null, "enforce_unique": true, "description": "VRF 1 Description", "custom_fields": {} }`), - want: testVRFWithTenant(1, nil), - }, - { - desc: "With Group", - data: []byte(`{ "id": 1, "name": "VRF 1", "rd": "vrf-1", "tenant": { "id": 1, "name": "Tenant 1", "slug": "tenant-1" }, "enforce_unique": true, "description": "VRF 1 Description", "custom_fields": {} }`), - want: testVRFWithTenant(1, testTenantIdentifier(1)), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - result := new(VRF) - err := json.Unmarshal(tt.data, result) - if err != nil { - t.Fatalf("unexpected error from Tenant.UnmarshalJSON: %v", err) - } - - if want, got := tt.want, result; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Tenant:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestVRFMarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data *VRF - want []byte - }{ - { - desc: "Nil Group", - data: testVRFWithTenant(1, nil), - want: []byte(`{"id":1,"name":"VRF 1","rd":"vrf-1","enforce_unique":true,"description":"VRF 1 Description"}`), - }, - { - desc: "With Group", - data: testVRFWithTenant(1, testTenantIdentifier(1)), - want: []byte(`{"id":1,"name":"VRF 1","rd":"vrf-1","enforce_unique":true,"description":"VRF 1 Description","tenant":1}`), - }, - { - desc: "No VRF.ID", - data: testVRFWithTenant(0, nil), - want: []byte(`{"name":"VRF 0","rd":"vrf-0","enforce_unique":true,"description":"VRF 0 Description"}`), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - result, err := json.Marshal(tt.data) - if err != nil { - t.Fatalf("unexpected error from VRF.MarshalJSON: %v", err) - } - - if want, got := tt.want, result; bytes.Compare(want, got) != 0 { - t.Fatalf("unexpected VRF:\n- want: %s\n- got: %s", want, got) - } - }) - } -} - -func TestListVRFOptions(t *testing.T) { - enforceUniqueTrue := true - enforceUniqueFalse := false - var tests = []struct { - desc string - o *ListVRFOptions - v url.Values - }{ - { - desc: "empty options", - }, - { - desc: "full options", - o: &ListVRFOptions{ - Name: "Hello", - RD: "hello", - EnforceUnique: &enforceUniqueTrue, - IDIn: []uint64{1, 2, 3}, - TenantID: 1, - Query: "World", - }, - v: url.Values{ - "name": []string{"Hello"}, - "rd": []string{"hello"}, - "id__in": []string{"1,2,3"}, - "enforce_unique": []string{"True"}, - "tenant_id": []string{"1"}, - "q": []string{"World"}, - }, - }, - { - desc: "tenant vs tenant_id", - o: &ListVRFOptions{ - TenantID: 1, - Tenant: "Tenant 1", - }, - v: url.Values{ - "tenant_id": []string{"1"}, - }, - }, - { - desc: "tenant name", - o: &ListVRFOptions{ - Tenant: "Tenant 1", - }, - v: url.Values{ - "tenant": []string{"Tenant 1"}, - }, - }, - { - desc: "enforce_unique default value", - o: &ListVRFOptions{}, - v: url.Values{}, - }, - { - desc: "enforce_unique true", - o: &ListVRFOptions{ - EnforceUnique: &enforceUniqueTrue, - }, - v: url.Values{ - "enforce_unique": []string{"True"}, - }, - }, - { - desc: "enforce_unique false", - o: &ListVRFOptions{ - EnforceUnique: &enforceUniqueFalse, - }, - v: url.Values{ - "enforce_unique": []string{"False"}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - v, err := tt.o.Values() - if err != nil { - t.Fatalf("unexpected Values error: %v", err) - } - - if want, got := tt.v, v; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected url.Values map:\n- want: %v\n- got: %v", want, got) - } - }) - } -} diff --git a/netbox/ipam_vrfs_types.go b/netbox/ipam_vrfs_types.go deleted file mode 100644 index f699efc851cedb6a57d29c7cd181db976594a602..0000000000000000000000000000000000000000 --- a/netbox/ipam_vrfs_types.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "encoding/json" - "net/url" - "strconv" - "strings" -) - -// A VRF is a representation of netbox vrf -type VRF struct { - ID int `json:"id,omitempty"` - Name string `json:"name"` - RD string `json:"rd"` - EnforceUnique bool `json:"enforce_unique"` - Description string `json:"description"` - Tenant *Tenant `json:"tenant,omitempty"` -} - -// A writableVRF corresponds to the Netbox API's -// writable serializer for an VRF. It is used transparently -// when VRF are serialized in to JSON. -type writableVRF struct { - ID int `json:"id,omitempty"` - Name string `json:"name"` - RD string `json:"rd"` - EnforceUnique bool `json:"enforce_unique"` - Description string `json:"description"` - Tenant *int `json:"tenant,omitempty"` -} - -// MarshalJSON marshals an VRF into JSON bytes, -// and is used by the standard json package. -func (v *VRF) MarshalJSON() ([]byte, error) { - var tenantID *int - if v.Tenant != nil { - tenantID = &v.Tenant.ID - } - return json.Marshal(writableVRF{ - ID: v.ID, - Name: v.Name, - RD: v.RD, - EnforceUnique: v.EnforceUnique, - Description: v.Description, - Tenant: tenantID, - }) -} - -// ListVRFOptions is used as an argument for Client.IPAM.VRFs.List. -type ListVRFOptions struct { - Name string - RD string - EnforceUnique *bool - IDIn []uint64 - TenantID int - Tenant string - Query string -} - -// Values generates a url.Values map from the data in ListVRFOptions. -func (o *ListVRFOptions) Values() (url.Values, error) { - if o == nil { - return nil, nil - } - - v := url.Values{} - - if o.Name != "" { - v.Set("name", o.Name) - } - - if o.RD != "" { - v.Set("rd", o.RD) - } - - if o.EnforceUnique != nil { - if *o.EnforceUnique { - v.Set("enforce_unique", "True") - } else { - v.Set("enforce_unique", "False") - } - } - - if len(o.IDIn) > 0 { - vals := make([]string, len(o.IDIn)) - for i, k := range o.IDIn { - vals[i] = strconv.FormatUint(k, 10) - } - v.Set("id__in", strings.Join(vals, ",")) - } - - switch { - case o.TenantID != 0: - v.Set("tenant_id", strconv.Itoa(o.TenantID)) - case o.Tenant != "": - v.Set("tenant", o.Tenant) - } - - if o.Query != "" { - v.Set("q", o.Query) - } - - return v, nil -} - -//go:generate go run generate_functions.go -type-name VRF -update-type-name writableVRF -service-name VRFsService -endpoint ipam -service vrfs -//go:generate go run generate_basic_tests.go -type-name VRF -service-name IpamVRFService -endpoint ipam -service vrfs -client-endpoint IPAM -client-service VRFs diff --git a/netbox/models/aggregate.go b/netbox/models/aggregate.go new file mode 100644 index 0000000000000000000000000000000000000000..39b9643b2d9607a02d1ad364514981c206f693d7 --- /dev/null +++ b/netbox/models/aggregate.go @@ -0,0 +1,170 @@ +// 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" +) + +// Aggregate aggregate +// swagger:model Aggregate +type Aggregate struct { + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Date added + DateAdded strfmt.Date `json:"date_added,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Family + // Required: true + Family *int64 `json:"family"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Prefix + // Required: true + Prefix *string `json:"prefix"` + + // rir + // Required: true + Rir *NestedRIR `json:"rir"` +} + +// Validate validates this aggregate +func (m *Aggregate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFamily(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRir(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Aggregate) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +var aggregateTypeFamilyPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[4,6]`), &res); err != nil { + panic(err) + } + for _, v := range res { + aggregateTypeFamilyPropEnum = append(aggregateTypeFamilyPropEnum, v) + } +} + +// prop value enum +func (m *Aggregate) validateFamilyEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, aggregateTypeFamilyPropEnum); err != nil { + return err + } + return nil +} + +func (m *Aggregate) validateFamily(formats strfmt.Registry) error { + + if err := validate.Required("family", "body", m.Family); err != nil { + return err + } + + // value enum + if err := m.validateFamilyEnum("family", "body", *m.Family); err != nil { + return err + } + + return nil +} + +func (m *Aggregate) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +func (m *Aggregate) validateRir(formats strfmt.Registry) error { + + if err := validate.Required("rir", "body", m.Rir); err != nil { + return err + } + + if m.Rir != nil { + + if err := m.Rir.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rir") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Aggregate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Aggregate) UnmarshalBinary(b []byte) error { + var res Aggregate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuit.go b/netbox/models/circuit.go new file mode 100644 index 0000000000000000000000000000000000000000..6b3ca4efec5c088bc43d9bae09211b232d09eb90 --- /dev/null +++ b/netbox/models/circuit.go @@ -0,0 +1,216 @@ +// 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" +) + +// Circuit circuit +// swagger:model Circuit +type Circuit struct { + + // Circuit ID + // Required: true + // Max Length: 50 + Cid *string `json:"cid"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Commit rate (Kbps) + // Maximum: 2.147483647e+09 + // Minimum: 0 + CommitRate *int64 `json:"commit_rate,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Date installed + InstallDate strfmt.Date `json:"install_date,omitempty"` + + // provider + // Required: true + Provider *NestedProvider `json:"provider"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // type + // Required: true + Type *NestedCircuitType `json:"type"` +} + +// Validate validates this circuit +func (m *Circuit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateCommitRate(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateProvider(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Circuit) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return err + } + + return nil +} + +func (m *Circuit) validateCommitRate(formats strfmt.Registry) error { + + if swag.IsZero(m.CommitRate) { // not required + return nil + } + + if err := validate.MinimumInt("commit_rate", "body", int64(*m.CommitRate), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("commit_rate", "body", int64(*m.CommitRate), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Circuit) 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 *Circuit) validateProvider(formats strfmt.Registry) error { + + if err := validate.Required("provider", "body", m.Provider); err != nil { + return err + } + + if m.Provider != nil { + + if err := m.Provider.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("provider") + } + return err + } + } + + return nil +} + +func (m *Circuit) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if 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 *Circuit) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Circuit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Circuit) UnmarshalBinary(b []byte) error { + var res Circuit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuit_termination.go b/netbox/models/circuit_termination.go new file mode 100644 index 0000000000000000000000000000000000000000..cd046ee39982ef5a8a4c430910bb744b9d465cf5 --- /dev/null +++ b/netbox/models/circuit_termination.go @@ -0,0 +1,288 @@ +// 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" +) + +// CircuitTermination circuit termination +// swagger:model CircuitTermination +type CircuitTermination struct { + + // circuit + // Required: true + Circuit *NestedCircuit `json:"circuit"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // interface + // Required: true + Interface *Interface `json:"interface"` + + // Port speed (Kbps) + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + PortSpeed *int64 `json:"port_speed"` + + // Patch panel/port(s) + // Max Length: 100 + PpInfo string `json:"pp_info,omitempty"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // Termination + // Required: true + TermSide *string `json:"term_side"` + + // Upstream speed (Kbps) + // + // Upstream speed, if different from port speed + // Maximum: 2.147483647e+09 + // Minimum: 0 + UpstreamSpeed *int64 `json:"upstream_speed,omitempty"` + + // Cross-connect ID + // Max Length: 50 + XconnectID string `json:"xconnect_id,omitempty"` +} + +// Validate validates this circuit termination +func (m *CircuitTermination) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCircuit(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterface(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePpInfo(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTermSide(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUpstreamSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateXconnectID(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitTermination) validateCircuit(formats strfmt.Registry) error { + + if err := validate.Required("circuit", "body", m.Circuit); err != nil { + return err + } + + if m.Circuit != nil { + + if err := m.Circuit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuit") + } + return err + } + } + + return nil +} + +func (m *CircuitTermination) validateInterface(formats strfmt.Registry) error { + + if err := validate.Required("interface", "body", m.Interface); err != nil { + return err + } + + if m.Interface != nil { + + if err := m.Interface.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface") + } + return err + } + } + + return nil +} + +func (m *CircuitTermination) validatePortSpeed(formats strfmt.Registry) error { + + if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { + return err + } + + if err := validate.MinimumInt("port_speed", "body", int64(*m.PortSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("port_speed", "body", int64(*m.PortSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) validatePpInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.PpInfo) { // not required + return nil + } + + if err := validate.MaxLength("pp_info", "body", string(m.PpInfo), 100); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +var circuitTerminationTypeTermSidePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["A","Z"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + circuitTerminationTypeTermSidePropEnum = append(circuitTerminationTypeTermSidePropEnum, v) + } +} + +const ( + // CircuitTerminationTermSideA captures enum value "A" + CircuitTerminationTermSideA string = "A" + // CircuitTerminationTermSideZ captures enum value "Z" + CircuitTerminationTermSideZ string = "Z" +) + +// prop value enum +func (m *CircuitTermination) validateTermSideEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, circuitTerminationTypeTermSidePropEnum); err != nil { + return err + } + return nil +} + +func (m *CircuitTermination) validateTermSide(formats strfmt.Registry) error { + + if err := validate.Required("term_side", "body", m.TermSide); err != nil { + return err + } + + // value enum + if err := m.validateTermSideEnum("term_side", "body", *m.TermSide); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) validateUpstreamSpeed(formats strfmt.Registry) error { + + if swag.IsZero(m.UpstreamSpeed) { // not required + return nil + } + + if err := validate.MinimumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *CircuitTermination) validateXconnectID(formats strfmt.Registry) error { + + if swag.IsZero(m.XconnectID) { // not required + return nil + } + + if err := validate.MaxLength("xconnect_id", "body", string(m.XconnectID), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitTermination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitTermination) UnmarshalBinary(b []byte) error { + var res CircuitTermination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuit_type.go b/netbox/models/circuit_type.go new file mode 100644 index 0000000000000000000000000000000000000000..4e50161503e2db86a08e6154974d61f0efb16783 --- /dev/null +++ b/netbox/models/circuit_type.go @@ -0,0 +1,102 @@ +// 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" +) + +// CircuitType circuit type +// swagger:model CircuitType +type CircuitType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this circuit type +func (m *CircuitType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitType) 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 *CircuitType) 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 *CircuitType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitType) UnmarshalBinary(b []byte) error { + var res CircuitType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuits_circuit_terminations_list_okbody.go b/netbox/models/circuits_circuit_terminations_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..b97924c532b411610cbdecabaee9cd2de32aa8b6 --- /dev/null +++ b/netbox/models/circuits_circuit_terminations_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" +) + +// CircuitsCircuitTerminationsListOKBody circuits circuit terminations list o k body +// swagger:model circuitsCircuitTerminationsListOKBody +type CircuitsCircuitTerminationsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results CircuitsCircuitTerminationsListOKBodyResults `json:"results"` +} + +// Validate validates this circuits circuit terminations list o k body +func (m *CircuitsCircuitTerminationsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitsCircuitTerminationsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CircuitsCircuitTerminationsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitsCircuitTerminationsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitsCircuitTerminationsListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitTerminationsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuits_circuit_terminations_list_okbody_results.go b/netbox/models/circuits_circuit_terminations_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..103e8bcc38e1f1dfa6e41449da38626fb4eabe19 --- /dev/null +++ b/netbox/models/circuits_circuit_terminations_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" +) + +// CircuitsCircuitTerminationsListOKBodyResults circuits circuit terminations list o k body results +// swagger:model circuitsCircuitTerminationsListOKBodyResults +type CircuitsCircuitTerminationsListOKBodyResults []*CircuitTermination + +// Validate validates this circuits circuit terminations list o k body results +func (m CircuitsCircuitTerminationsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/circuits_circuit_types_list_okbody.go b/netbox/models/circuits_circuit_types_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..662273fb28bf61b064f1fffef9c4602c85616978 --- /dev/null +++ b/netbox/models/circuits_circuit_types_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" +) + +// CircuitsCircuitTypesListOKBody circuits circuit types list o k body +// swagger:model circuitsCircuitTypesListOKBody +type CircuitsCircuitTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results CircuitsCircuitTypesListOKBodyResults `json:"results"` +} + +// Validate validates this circuits circuit types list o k body +func (m *CircuitsCircuitTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitsCircuitTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CircuitsCircuitTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitsCircuitTypesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitsCircuitTypesListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuits_circuit_types_list_okbody_results.go b/netbox/models/circuits_circuit_types_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..86bd9bd64abe96beaef5f41bdf88ca480d7ef127 --- /dev/null +++ b/netbox/models/circuits_circuit_types_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" +) + +// CircuitsCircuitTypesListOKBodyResults circuits circuit types list o k body results +// swagger:model circuitsCircuitTypesListOKBodyResults +type CircuitsCircuitTypesListOKBodyResults []*CircuitType + +// Validate validates this circuits circuit types list o k body results +func (m CircuitsCircuitTypesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/circuits_circuits_list_okbody.go b/netbox/models/circuits_circuits_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..45b3cafc43fbb5efd96d402dc624ed2c7e8146b7 --- /dev/null +++ b/netbox/models/circuits_circuits_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" +) + +// CircuitsCircuitsListOKBody circuits circuits list o k body +// swagger:model circuitsCircuitsListOKBody +type CircuitsCircuitsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results CircuitsCircuitsListOKBodyResults `json:"results"` +} + +// Validate validates this circuits circuits list o k body +func (m *CircuitsCircuitsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitsCircuitsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CircuitsCircuitsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitsCircuitsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitsCircuitsListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsCircuitsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuits_circuits_list_okbody_results.go b/netbox/models/circuits_circuits_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..b788b138bb584d86f9c01de3c341255850e7c680 --- /dev/null +++ b/netbox/models/circuits_circuits_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" +) + +// CircuitsCircuitsListOKBodyResults circuits circuits list o k body results +// swagger:model circuitsCircuitsListOKBodyResults +type CircuitsCircuitsListOKBodyResults []*Circuit + +// Validate validates this circuits circuits list o k body results +func (m CircuitsCircuitsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/circuits_providers_list_okbody.go b/netbox/models/circuits_providers_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..81d1291db308c2470fb6c6a7c9d0ad5f3003d955 --- /dev/null +++ b/netbox/models/circuits_providers_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" +) + +// CircuitsProvidersListOKBody circuits providers list o k body +// swagger:model circuitsProvidersListOKBody +type CircuitsProvidersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results CircuitsProvidersListOKBodyResults `json:"results"` +} + +// Validate validates this circuits providers list o k body +func (m *CircuitsProvidersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CircuitsProvidersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *CircuitsProvidersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CircuitsProvidersListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CircuitsProvidersListOKBody) UnmarshalBinary(b []byte) error { + var res CircuitsProvidersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/circuits_providers_list_okbody_results.go b/netbox/models/circuits_providers_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..bae68c9fac19448c8461663146d131df0f968a83 --- /dev/null +++ b/netbox/models/circuits_providers_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" +) + +// CircuitsProvidersListOKBodyResults circuits providers list o k body results +// swagger:model circuitsProvidersListOKBodyResults +type CircuitsProvidersListOKBodyResults []*Provider + +// Validate validates this circuits providers list o k body results +func (m CircuitsProvidersListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/cluster.go b/netbox/models/cluster.go new file mode 100644 index 0000000000000000000000000000000000000000..1d52003a1c610d248bc87b17ce73e8297ad9b724 --- /dev/null +++ b/netbox/models/cluster.go @@ -0,0 +1,164 @@ +// 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" +) + +// Cluster cluster +// swagger:model Cluster +type Cluster struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // group + // Required: true + Group *NestedClusterGroup `json:"group"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // type + // Required: true + Type *NestedClusterType `json:"type"` +} + +// Validate validates this cluster +func (m *Cluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGroup(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Cluster) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + if m.Group != nil { + + if err := m.Group.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *Cluster) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *Cluster) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *Cluster) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Cluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Cluster) UnmarshalBinary(b []byte) error { + var res Cluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/cluster_group.go b/netbox/models/cluster_group.go new file mode 100644 index 0000000000000000000000000000000000000000..ee23588f88589d9108da4c44ac968e4265d40c3f --- /dev/null +++ b/netbox/models/cluster_group.go @@ -0,0 +1,102 @@ +// 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" +) + +// ClusterGroup cluster group +// swagger:model ClusterGroup +type ClusterGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this cluster group +func (m *ClusterGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterGroup) 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 *ClusterGroup) 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 *ClusterGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterGroup) UnmarshalBinary(b []byte) error { + var res ClusterGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/cluster_type.go b/netbox/models/cluster_type.go new file mode 100644 index 0000000000000000000000000000000000000000..e0323bf7c03773111a3b934ec70b537a84d8f18e --- /dev/null +++ b/netbox/models/cluster_type.go @@ -0,0 +1,102 @@ +// 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" +) + +// ClusterType cluster type +// swagger:model ClusterType +type ClusterType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this cluster type +func (m *ClusterType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClusterType) 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 *ClusterType) 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 *ClusterType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClusterType) UnmarshalBinary(b []byte) error { + var res ClusterType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/console_port.go b/netbox/models/console_port.go new file mode 100644 index 0000000000000000000000000000000000000000..9e7a36292bee58b8e135f1f6b5550bb97f0a34a7 --- /dev/null +++ b/netbox/models/console_port.go @@ -0,0 +1,133 @@ +// 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" +) + +// ConsolePort console port +// swagger:model ConsolePort +type ConsolePort struct { + + // Connection status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // cs port + // Required: true + CsPort *ConsoleServerPort `json:"cs_port"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this console port +func (m *ConsolePort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCsPort(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsolePort) validateCsPort(formats strfmt.Registry) error { + + if err := validate.Required("cs_port", "body", m.CsPort); err != nil { + return err + } + + if m.CsPort != nil { + + if err := m.CsPort.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cs_port") + } + return err + } + } + + return nil +} + +func (m *ConsolePort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *ConsolePort) 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 +} + +// MarshalBinary interface implementation +func (m *ConsolePort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsolePort) UnmarshalBinary(b []byte) error { + var res ConsolePort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/console_port_template.go b/netbox/models/console_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..a4492a003283e4889b406128932b9ead7cb63a77 --- /dev/null +++ b/netbox/models/console_port_template.go @@ -0,0 +1,102 @@ +// 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" +) + +// ConsolePortTemplate console port template +// swagger:model ConsolePortTemplate +type ConsolePortTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this console port template +func (m *ConsolePortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsolePortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *ConsolePortTemplate) 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 +} + +// MarshalBinary interface implementation +func (m *ConsolePortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsolePortTemplate) UnmarshalBinary(b []byte) error { + var res ConsolePortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/console_server_port.go b/netbox/models/console_server_port.go new file mode 100644 index 0000000000000000000000000000000000000000..8ce01ea44c2885de21bbc9220da5e0b1a036c989 --- /dev/null +++ b/netbox/models/console_server_port.go @@ -0,0 +1,106 @@ +// 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" +) + +// ConsoleServerPort Cs port +// swagger:model ConsoleServerPort +type ConsoleServerPort struct { + + // Connected console + // Read Only: true + ConnectedConsole string `json:"connected_console,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this console server port +func (m *ConsoleServerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsoleServerPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *ConsoleServerPort) 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 +} + +// MarshalBinary interface implementation +func (m *ConsoleServerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsoleServerPort) UnmarshalBinary(b []byte) error { + var res ConsoleServerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/console_server_port_template.go b/netbox/models/console_server_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..6644f314abea645fba1de1c2df4a5df8bc67fde2 --- /dev/null +++ b/netbox/models/console_server_port_template.go @@ -0,0 +1,102 @@ +// 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" +) + +// ConsoleServerPortTemplate console server port template +// swagger:model ConsoleServerPortTemplate +type ConsoleServerPortTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this console server port template +func (m *ConsoleServerPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ConsoleServerPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *ConsoleServerPortTemplate) 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 +} + +// MarshalBinary interface implementation +func (m *ConsoleServerPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ConsoleServerPortTemplate) UnmarshalBinary(b []byte) error { + var res ConsoleServerPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_console_connections_list_okbody.go b/netbox/models/dcim_console_connections_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..6b8766dfb0b76ef4a0b61a58eb976418e7270066 --- /dev/null +++ b/netbox/models/dcim_console_connections_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" +) + +// DcimConsoleConnectionsListOKBody dcim console connections list o k body +// swagger:model dcimConsoleConnectionsListOKBody +type DcimConsoleConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsoleConnectionsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console connections list o k body +func (m *DcimConsoleConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsoleConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsoleConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsoleConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsoleConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_console_connections_list_okbody_results.go b/netbox/models/dcim_console_connections_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..f9ba3c71bdf9260d5cd9f16fe4dbc7d185a26ac6 --- /dev/null +++ b/netbox/models/dcim_console_connections_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" +) + +// DcimConsoleConnectionsListOKBodyResults dcim console connections list o k body results +// swagger:model dcimConsoleConnectionsListOKBodyResults +type DcimConsoleConnectionsListOKBodyResults []*ConsolePort + +// Validate validates this dcim console connections list o k body results +func (m DcimConsoleConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_console_port_templates_list_okbody.go b/netbox/models/dcim_console_port_templates_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..df326e7cf5ade24478c07081391fb9378f8347be --- /dev/null +++ b/netbox/models/dcim_console_port_templates_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" +) + +// DcimConsolePortTemplatesListOKBody dcim console port templates list o k body +// swagger:model dcimConsolePortTemplatesListOKBody +type DcimConsolePortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsolePortTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console port templates list o k body +func (m *DcimConsolePortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsolePortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsolePortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsolePortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsolePortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsolePortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_console_port_templates_list_okbody_results.go b/netbox/models/dcim_console_port_templates_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..09f35143abaa87686f869f7f295e387cce3f8984 --- /dev/null +++ b/netbox/models/dcim_console_port_templates_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" +) + +// DcimConsolePortTemplatesListOKBodyResults dcim console port templates list o k body results +// swagger:model dcimConsolePortTemplatesListOKBodyResults +type DcimConsolePortTemplatesListOKBodyResults []*ConsolePortTemplate + +// Validate validates this dcim console port templates list o k body results +func (m DcimConsolePortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_console_ports_list_okbody.go b/netbox/models/dcim_console_ports_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..bb9aa6729d6bb0e95a89ca12593899990ea232a0 --- /dev/null +++ b/netbox/models/dcim_console_ports_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" +) + +// DcimConsolePortsListOKBody dcim console ports list o k body +// swagger:model dcimConsolePortsListOKBody +type DcimConsolePortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsolePortsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console ports list o k body +func (m *DcimConsolePortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsolePortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsolePortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsolePortsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsolePortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsolePortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_console_ports_list_okbody_results.go b/netbox/models/dcim_console_ports_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..fa5a3a98b7bf0ccff2087f64c6bfcbcf7fde6b52 --- /dev/null +++ b/netbox/models/dcim_console_ports_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" +) + +// DcimConsolePortsListOKBodyResults dcim console ports list o k body results +// swagger:model dcimConsolePortsListOKBodyResults +type DcimConsolePortsListOKBodyResults []*ConsolePort + +// Validate validates this dcim console ports list o k body results +func (m DcimConsolePortsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_console_server_port_templates_list_okbody.go b/netbox/models/dcim_console_server_port_templates_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..51ba333e1a7357d2cfb5e0edd390fa6078e86073 --- /dev/null +++ b/netbox/models/dcim_console_server_port_templates_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" +) + +// DcimConsoleServerPortTemplatesListOKBody dcim console server port templates list o k body +// swagger:model dcimConsoleServerPortTemplatesListOKBody +type DcimConsoleServerPortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsoleServerPortTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console server port templates list o k body +func (m *DcimConsoleServerPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsoleServerPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsoleServerPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsoleServerPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsoleServerPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleServerPortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_console_server_port_templates_list_okbody_results.go b/netbox/models/dcim_console_server_port_templates_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..26570d34264898127e01869c545088cfd4ea99d1 --- /dev/null +++ b/netbox/models/dcim_console_server_port_templates_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" +) + +// DcimConsoleServerPortTemplatesListOKBodyResults dcim console server port templates list o k body results +// swagger:model dcimConsoleServerPortTemplatesListOKBodyResults +type DcimConsoleServerPortTemplatesListOKBodyResults []*ConsoleServerPortTemplate + +// Validate validates this dcim console server port templates list o k body results +func (m DcimConsoleServerPortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_console_server_ports_list_okbody.go b/netbox/models/dcim_console_server_ports_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..c788b6ca248ff6eacff64c162a27984a60082502 --- /dev/null +++ b/netbox/models/dcim_console_server_ports_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" +) + +// DcimConsoleServerPortsListOKBody dcim console server ports list o k body +// swagger:model dcimConsoleServerPortsListOKBody +type DcimConsoleServerPortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimConsoleServerPortsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim console server ports list o k body +func (m *DcimConsoleServerPortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimConsoleServerPortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimConsoleServerPortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimConsoleServerPortsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimConsoleServerPortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimConsoleServerPortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_console_server_ports_list_okbody_results.go b/netbox/models/dcim_console_server_ports_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..ad8320df5c88781c1cc412263feead2550055330 --- /dev/null +++ b/netbox/models/dcim_console_server_ports_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" +) + +// DcimConsoleServerPortsListOKBodyResults dcim console server ports list o k body results +// swagger:model dcimConsoleServerPortsListOKBodyResults +type DcimConsoleServerPortsListOKBodyResults []*ConsoleServerPort + +// Validate validates this dcim console server ports list o k body results +func (m DcimConsoleServerPortsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_device_bay_templates_list_okbody.go b/netbox/models/dcim_device_bay_templates_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..c3a50a7619efbcf72313cf9ddf08668703ce2698 --- /dev/null +++ b/netbox/models/dcim_device_bay_templates_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" +) + +// DcimDeviceBayTemplatesListOKBody dcim device bay templates list o k body +// swagger:model dcimDeviceBayTemplatesListOKBody +type DcimDeviceBayTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDeviceBayTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim device bay templates list o k body +func (m *DcimDeviceBayTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDeviceBayTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDeviceBayTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDeviceBayTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDeviceBayTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceBayTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_device_bay_templates_list_okbody_results.go b/netbox/models/dcim_device_bay_templates_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..6da22bb8a1884a8c930061c5fb7b18977a651a6a --- /dev/null +++ b/netbox/models/dcim_device_bay_templates_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" +) + +// DcimDeviceBayTemplatesListOKBodyResults dcim device bay templates list o k body results +// swagger:model dcimDeviceBayTemplatesListOKBodyResults +type DcimDeviceBayTemplatesListOKBodyResults []*DeviceBayTemplate + +// Validate validates this dcim device bay templates list o k body results +func (m DcimDeviceBayTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_device_bays_list_okbody.go b/netbox/models/dcim_device_bays_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..ec72c38af63a9c0178e6e6f2118bb71c1f5d72c1 --- /dev/null +++ b/netbox/models/dcim_device_bays_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" +) + +// DcimDeviceBaysListOKBody dcim device bays list o k body +// swagger:model dcimDeviceBaysListOKBody +type DcimDeviceBaysListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDeviceBaysListOKBodyResults `json:"results"` +} + +// Validate validates this dcim device bays list o k body +func (m *DcimDeviceBaysListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDeviceBaysListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDeviceBaysListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDeviceBaysListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDeviceBaysListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceBaysListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_device_bays_list_okbody_results.go b/netbox/models/dcim_device_bays_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..c3e31131ecc64b205925aa6ddf82dd71c548036f --- /dev/null +++ b/netbox/models/dcim_device_bays_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" +) + +// DcimDeviceBaysListOKBodyResults dcim device bays list o k body results +// swagger:model dcimDeviceBaysListOKBodyResults +type DcimDeviceBaysListOKBodyResults []*DeviceBay + +// Validate validates this dcim device bays list o k body results +func (m DcimDeviceBaysListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_device_roles_list_okbody.go b/netbox/models/dcim_device_roles_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..808d47625f196aac2c076cccbea83c81cb95fb91 --- /dev/null +++ b/netbox/models/dcim_device_roles_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" +) + +// DcimDeviceRolesListOKBody dcim device roles list o k body +// swagger:model dcimDeviceRolesListOKBody +type DcimDeviceRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDeviceRolesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim device roles list o k body +func (m *DcimDeviceRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDeviceRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDeviceRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDeviceRolesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDeviceRolesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_device_roles_list_okbody_results.go b/netbox/models/dcim_device_roles_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..169522bdb3d6175368d5827ecdc6fd00c26b54f2 --- /dev/null +++ b/netbox/models/dcim_device_roles_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" +) + +// DcimDeviceRolesListOKBodyResults dcim device roles list o k body results +// swagger:model dcimDeviceRolesListOKBodyResults +type DcimDeviceRolesListOKBodyResults []*DeviceRole + +// Validate validates this dcim device roles list o k body results +func (m DcimDeviceRolesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_device_types_list_okbody.go b/netbox/models/dcim_device_types_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..ebfc8671bfe24a88c5bd67c3c8ec71c52c8e3af8 --- /dev/null +++ b/netbox/models/dcim_device_types_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" +) + +// DcimDeviceTypesListOKBody dcim device types list o k body +// swagger:model dcimDeviceTypesListOKBody +type DcimDeviceTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDeviceTypesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim device types list o k body +func (m *DcimDeviceTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDeviceTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDeviceTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDeviceTypesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDeviceTypesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDeviceTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_device_types_list_okbody_results.go b/netbox/models/dcim_device_types_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..5dbb7b5acd7e47975fa07886eb6ee58bb1336119 --- /dev/null +++ b/netbox/models/dcim_device_types_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" +) + +// DcimDeviceTypesListOKBodyResults dcim device types list o k body results +// swagger:model dcimDeviceTypesListOKBodyResults +type DcimDeviceTypesListOKBodyResults []*DeviceType + +// Validate validates this dcim device types list o k body results +func (m DcimDeviceTypesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_devices_list_okbody.go b/netbox/models/dcim_devices_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..87add8ae2aa39e9509f6bfbfb4ef57554629a457 --- /dev/null +++ b/netbox/models/dcim_devices_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" +) + +// DcimDevicesListOKBody dcim devices list o k body +// swagger:model dcimDevicesListOKBody +type DcimDevicesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimDevicesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim devices list o k body +func (m *DcimDevicesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimDevicesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimDevicesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimDevicesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimDevicesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimDevicesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_devices_list_okbody_results.go b/netbox/models/dcim_devices_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..37a46286b09d725408438dd945115ce62d6a2db7 --- /dev/null +++ b/netbox/models/dcim_devices_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" +) + +// DcimDevicesListOKBodyResults dcim devices list o k body results +// swagger:model dcimDevicesListOKBodyResults +type DcimDevicesListOKBodyResults []*Device + +// Validate validates this dcim devices list o k body results +func (m DcimDevicesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_interface_connections_list_okbody.go b/netbox/models/dcim_interface_connections_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..5be2674d2965eb383bcf1f71a507c6e08484eb47 --- /dev/null +++ b/netbox/models/dcim_interface_connections_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" +) + +// DcimInterfaceConnectionsListOKBody dcim interface connections list o k body +// swagger:model dcimInterfaceConnectionsListOKBody +type DcimInterfaceConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimInterfaceConnectionsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim interface connections list o k body +func (m *DcimInterfaceConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimInterfaceConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimInterfaceConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimInterfaceConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimInterfaceConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfaceConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_interface_connections_list_okbody_results.go b/netbox/models/dcim_interface_connections_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..48ffb5110bb37b6ed3e4c1daa8ae22b4bde5a29d --- /dev/null +++ b/netbox/models/dcim_interface_connections_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" +) + +// DcimInterfaceConnectionsListOKBodyResults dcim interface connections list o k body results +// swagger:model dcimInterfaceConnectionsListOKBodyResults +type DcimInterfaceConnectionsListOKBodyResults []*InterfaceConnection + +// Validate validates this dcim interface connections list o k body results +func (m DcimInterfaceConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_interface_templates_list_okbody.go b/netbox/models/dcim_interface_templates_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..525f3c8b945a15ad09209a1109c6e6a5527cda02 --- /dev/null +++ b/netbox/models/dcim_interface_templates_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" +) + +// DcimInterfaceTemplatesListOKBody dcim interface templates list o k body +// swagger:model dcimInterfaceTemplatesListOKBody +type DcimInterfaceTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimInterfaceTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim interface templates list o k body +func (m *DcimInterfaceTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimInterfaceTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimInterfaceTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimInterfaceTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimInterfaceTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfaceTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_interface_templates_list_okbody_results.go b/netbox/models/dcim_interface_templates_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..404c2584b92cba985eddfb24f9434f0cef555e55 --- /dev/null +++ b/netbox/models/dcim_interface_templates_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" +) + +// DcimInterfaceTemplatesListOKBodyResults dcim interface templates list o k body results +// swagger:model dcimInterfaceTemplatesListOKBodyResults +type DcimInterfaceTemplatesListOKBodyResults []*InterfaceTemplate + +// Validate validates this dcim interface templates list o k body results +func (m DcimInterfaceTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_interfaces_list_okbody.go b/netbox/models/dcim_interfaces_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..9e7083985fa7d59d6d485d5a2018dca0e9ba9a73 --- /dev/null +++ b/netbox/models/dcim_interfaces_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" +) + +// DcimInterfacesListOKBody dcim interfaces list o k body +// swagger:model dcimInterfacesListOKBody +type DcimInterfacesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimInterfacesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim interfaces list o k body +func (m *DcimInterfacesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimInterfacesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimInterfacesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimInterfacesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimInterfacesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInterfacesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_interfaces_list_okbody_results.go b/netbox/models/dcim_interfaces_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..c76175869df61a9fd3a765afe266a7d0437383ef --- /dev/null +++ b/netbox/models/dcim_interfaces_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" +) + +// DcimInterfacesListOKBodyResults dcim interfaces list o k body results +// swagger:model dcimInterfacesListOKBodyResults +type DcimInterfacesListOKBodyResults []*Interface + +// Validate validates this dcim interfaces list o k body results +func (m DcimInterfacesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_inventory_items_list_okbody.go b/netbox/models/dcim_inventory_items_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..f221b2ec5345700ad547cbbd920f1d215d1e62c3 --- /dev/null +++ b/netbox/models/dcim_inventory_items_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" +) + +// DcimInventoryItemsListOKBody dcim inventory items list o k body +// swagger:model dcimInventoryItemsListOKBody +type DcimInventoryItemsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimInventoryItemsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim inventory items list o k body +func (m *DcimInventoryItemsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimInventoryItemsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimInventoryItemsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimInventoryItemsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimInventoryItemsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimInventoryItemsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_inventory_items_list_okbody_results.go b/netbox/models/dcim_inventory_items_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..c68cb2f9bfdc51f70eaa68d259cd473a27ce815e --- /dev/null +++ b/netbox/models/dcim_inventory_items_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" +) + +// DcimInventoryItemsListOKBodyResults dcim inventory items list o k body results +// swagger:model dcimInventoryItemsListOKBodyResults +type DcimInventoryItemsListOKBodyResults []*InventoryItem + +// Validate validates this dcim inventory items list o k body results +func (m DcimInventoryItemsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_manufacturers_list_okbody.go b/netbox/models/dcim_manufacturers_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..2ca82b75d1097ef1b5b64ccbff0cd7ee58edd2e0 --- /dev/null +++ b/netbox/models/dcim_manufacturers_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" +) + +// DcimManufacturersListOKBody dcim manufacturers list o k body +// swagger:model dcimManufacturersListOKBody +type DcimManufacturersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimManufacturersListOKBodyResults `json:"results"` +} + +// Validate validates this dcim manufacturers list o k body +func (m *DcimManufacturersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimManufacturersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimManufacturersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimManufacturersListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimManufacturersListOKBody) UnmarshalBinary(b []byte) error { + var res DcimManufacturersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_manufacturers_list_okbody_results.go b/netbox/models/dcim_manufacturers_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..8b1c987447343ae0baf00ea4ed4488676d1e30fa --- /dev/null +++ b/netbox/models/dcim_manufacturers_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" +) + +// DcimManufacturersListOKBodyResults dcim manufacturers list o k body results +// swagger:model dcimManufacturersListOKBodyResults +type DcimManufacturersListOKBodyResults []*Manufacturer + +// Validate validates this dcim manufacturers list o k body results +func (m DcimManufacturersListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_platforms_list_okbody.go b/netbox/models/dcim_platforms_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..84e8f098cc56fc87d31b2f11399482429b8f7f96 --- /dev/null +++ b/netbox/models/dcim_platforms_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" +) + +// DcimPlatformsListOKBody dcim platforms list o k body +// swagger:model dcimPlatformsListOKBody +type DcimPlatformsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPlatformsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim platforms list o k body +func (m *DcimPlatformsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPlatformsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPlatformsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPlatformsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPlatformsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPlatformsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_platforms_list_okbody_results.go b/netbox/models/dcim_platforms_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..adf91bc170fd8e3dffa4b7daaa19bab8c91ae168 --- /dev/null +++ b/netbox/models/dcim_platforms_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" +) + +// DcimPlatformsListOKBodyResults dcim platforms list o k body results +// swagger:model dcimPlatformsListOKBodyResults +type DcimPlatformsListOKBodyResults []*Platform + +// Validate validates this dcim platforms list o k body results +func (m DcimPlatformsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_power_connections_list_okbody.go b/netbox/models/dcim_power_connections_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..58255caa71bc0df7b87f35ea681f4c9d452c01c7 --- /dev/null +++ b/netbox/models/dcim_power_connections_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" +) + +// DcimPowerConnectionsListOKBody dcim power connections list o k body +// swagger:model dcimPowerConnectionsListOKBody +type DcimPowerConnectionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerConnectionsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power connections list o k body +func (m *DcimPowerConnectionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerConnectionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerConnectionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerConnectionsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerConnectionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerConnectionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_power_connections_list_okbody_results.go b/netbox/models/dcim_power_connections_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..f9eee543cf76f6ce8c87c5b7a3a1781b1d7ab798 --- /dev/null +++ b/netbox/models/dcim_power_connections_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" +) + +// DcimPowerConnectionsListOKBodyResults dcim power connections list o k body results +// swagger:model dcimPowerConnectionsListOKBodyResults +type DcimPowerConnectionsListOKBodyResults []*PowerPort + +// Validate validates this dcim power connections list o k body results +func (m DcimPowerConnectionsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_power_outlet_templates_list_okbody.go b/netbox/models/dcim_power_outlet_templates_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..d0a9c9361213b4b8cac643272c582c058d775aa9 --- /dev/null +++ b/netbox/models/dcim_power_outlet_templates_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" +) + +// DcimPowerOutletTemplatesListOKBody dcim power outlet templates list o k body +// swagger:model dcimPowerOutletTemplatesListOKBody +type DcimPowerOutletTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerOutletTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power outlet templates list o k body +func (m *DcimPowerOutletTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerOutletTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerOutletTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerOutletTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerOutletTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerOutletTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_power_outlet_templates_list_okbody_results.go b/netbox/models/dcim_power_outlet_templates_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..4b107db37351facd2b1be85ddeefab39b27db052 --- /dev/null +++ b/netbox/models/dcim_power_outlet_templates_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" +) + +// DcimPowerOutletTemplatesListOKBodyResults dcim power outlet templates list o k body results +// swagger:model dcimPowerOutletTemplatesListOKBodyResults +type DcimPowerOutletTemplatesListOKBodyResults []*PowerOutletTemplate + +// Validate validates this dcim power outlet templates list o k body results +func (m DcimPowerOutletTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_power_outlets_list_okbody.go b/netbox/models/dcim_power_outlets_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..237827dc13ea1f97742ee0076e0f08cfe229b9c8 --- /dev/null +++ b/netbox/models/dcim_power_outlets_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" +) + +// DcimPowerOutletsListOKBody dcim power outlets list o k body +// swagger:model dcimPowerOutletsListOKBody +type DcimPowerOutletsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerOutletsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power outlets list o k body +func (m *DcimPowerOutletsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerOutletsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerOutletsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerOutletsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerOutletsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerOutletsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_power_outlets_list_okbody_results.go b/netbox/models/dcim_power_outlets_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..c0bffb140c00fc2d5873b119b04540cb240ee00e --- /dev/null +++ b/netbox/models/dcim_power_outlets_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" +) + +// DcimPowerOutletsListOKBodyResults dcim power outlets list o k body results +// swagger:model dcimPowerOutletsListOKBodyResults +type DcimPowerOutletsListOKBodyResults []*PowerOutlet + +// Validate validates this dcim power outlets list o k body results +func (m DcimPowerOutletsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_power_port_templates_list_okbody.go b/netbox/models/dcim_power_port_templates_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..10dd01aa1df1ddde8b3e42541b549054584f6e2e --- /dev/null +++ b/netbox/models/dcim_power_port_templates_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" +) + +// DcimPowerPortTemplatesListOKBody dcim power port templates list o k body +// swagger:model dcimPowerPortTemplatesListOKBody +type DcimPowerPortTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerPortTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power port templates list o k body +func (m *DcimPowerPortTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerPortTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerPortTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerPortTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerPortTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerPortTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_power_port_templates_list_okbody_results.go b/netbox/models/dcim_power_port_templates_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..27294ca4745829b012ff6606dc0ced85c77581a3 --- /dev/null +++ b/netbox/models/dcim_power_port_templates_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" +) + +// DcimPowerPortTemplatesListOKBodyResults dcim power port templates list o k body results +// swagger:model dcimPowerPortTemplatesListOKBodyResults +type DcimPowerPortTemplatesListOKBodyResults []*PowerPortTemplate + +// Validate validates this dcim power port templates list o k body results +func (m DcimPowerPortTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_power_ports_list_okbody.go b/netbox/models/dcim_power_ports_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..6dbbe3ab1666e1fa573c0f54ec21846e145b06b7 --- /dev/null +++ b/netbox/models/dcim_power_ports_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" +) + +// DcimPowerPortsListOKBody dcim power ports list o k body +// swagger:model dcimPowerPortsListOKBody +type DcimPowerPortsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimPowerPortsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim power ports list o k body +func (m *DcimPowerPortsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimPowerPortsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimPowerPortsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimPowerPortsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimPowerPortsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimPowerPortsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_power_ports_list_okbody_results.go b/netbox/models/dcim_power_ports_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..5591705731bf9edea552a63451fffe68172bbe58 --- /dev/null +++ b/netbox/models/dcim_power_ports_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" +) + +// DcimPowerPortsListOKBodyResults dcim power ports list o k body results +// swagger:model dcimPowerPortsListOKBodyResults +type DcimPowerPortsListOKBodyResults []*PowerPort + +// Validate validates this dcim power ports list o k body results +func (m DcimPowerPortsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_rack_groups_list_okbody.go b/netbox/models/dcim_rack_groups_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..7f10eaee62d466447d539feac9ee444efb8f24b5 --- /dev/null +++ b/netbox/models/dcim_rack_groups_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" +) + +// DcimRackGroupsListOKBody dcim rack groups list o k body +// swagger:model dcimRackGroupsListOKBody +type DcimRackGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRackGroupsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim rack groups list o k body +func (m *DcimRackGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRackGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRackGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRackGroupsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRackGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_rack_groups_list_okbody_results.go b/netbox/models/dcim_rack_groups_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..a0f800137ad7626c333d63ff2f2c7d6f908cca6d --- /dev/null +++ b/netbox/models/dcim_rack_groups_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" +) + +// DcimRackGroupsListOKBodyResults dcim rack groups list o k body results +// swagger:model dcimRackGroupsListOKBodyResults +type DcimRackGroupsListOKBodyResults []*RackGroup + +// Validate validates this dcim rack groups list o k body results +func (m DcimRackGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_rack_reservations_list_okbody.go b/netbox/models/dcim_rack_reservations_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..9c7f5b446de4f1e959398e2041719b261689293e --- /dev/null +++ b/netbox/models/dcim_rack_reservations_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" +) + +// DcimRackReservationsListOKBody dcim rack reservations list o k body +// swagger:model dcimRackReservationsListOKBody +type DcimRackReservationsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRackReservationsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim rack reservations list o k body +func (m *DcimRackReservationsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRackReservationsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRackReservationsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRackReservationsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRackReservationsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackReservationsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_rack_reservations_list_okbody_results.go b/netbox/models/dcim_rack_reservations_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..1129a2b7c617c230761fa17a812aec6870e81bf8 --- /dev/null +++ b/netbox/models/dcim_rack_reservations_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" +) + +// DcimRackReservationsListOKBodyResults dcim rack reservations list o k body results +// swagger:model dcimRackReservationsListOKBodyResults +type DcimRackReservationsListOKBodyResults []*RackReservation + +// Validate validates this dcim rack reservations list o k body results +func (m DcimRackReservationsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_rack_roles_list_okbody.go b/netbox/models/dcim_rack_roles_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..24f24217c6785bdd86aceac815bca5175d50c403 --- /dev/null +++ b/netbox/models/dcim_rack_roles_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" +) + +// DcimRackRolesListOKBody dcim rack roles list o k body +// swagger:model dcimRackRolesListOKBody +type DcimRackRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRackRolesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim rack roles list o k body +func (m *DcimRackRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRackRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRackRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRackRolesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRackRolesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRackRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_rack_roles_list_okbody_results.go b/netbox/models/dcim_rack_roles_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..7e02254eb257a8076683d78efc211134b59a94de --- /dev/null +++ b/netbox/models/dcim_rack_roles_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" +) + +// DcimRackRolesListOKBodyResults dcim rack roles list o k body results +// swagger:model dcimRackRolesListOKBodyResults +type DcimRackRolesListOKBodyResults []*RackRole + +// Validate validates this dcim rack roles list o k body results +func (m DcimRackRolesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_racks_list_okbody.go b/netbox/models/dcim_racks_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..2ee1cfb62e6a4f68f37c7af19d6dea81b6ee0748 --- /dev/null +++ b/netbox/models/dcim_racks_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" +) + +// DcimRacksListOKBody dcim racks list o k body +// swagger:model dcimRacksListOKBody +type DcimRacksListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRacksListOKBodyResults `json:"results"` +} + +// Validate validates this dcim racks list o k body +func (m *DcimRacksListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRacksListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRacksListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRacksListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRacksListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRacksListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_racks_list_okbody_results.go b/netbox/models/dcim_racks_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..667b88c5cfcdcfbc630231256a7a7a9fb989120b --- /dev/null +++ b/netbox/models/dcim_racks_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" +) + +// DcimRacksListOKBodyResults dcim racks list o k body results +// swagger:model dcimRacksListOKBodyResults +type DcimRacksListOKBodyResults []*Rack + +// Validate validates this dcim racks list o k body results +func (m DcimRacksListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_regions_list_okbody.go b/netbox/models/dcim_regions_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..d57afb61cc7cecdfec689d2c1a51bf1af4c88aaa --- /dev/null +++ b/netbox/models/dcim_regions_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" +) + +// DcimRegionsListOKBody dcim regions list o k body +// swagger:model dcimRegionsListOKBody +type DcimRegionsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimRegionsListOKBodyResults `json:"results"` +} + +// Validate validates this dcim regions list o k body +func (m *DcimRegionsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimRegionsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimRegionsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimRegionsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimRegionsListOKBody) UnmarshalBinary(b []byte) error { + var res DcimRegionsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_regions_list_okbody_results.go b/netbox/models/dcim_regions_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..67d7193c22e1cc991f7716eb6e5cbfa325ed3bbe --- /dev/null +++ b/netbox/models/dcim_regions_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" +) + +// DcimRegionsListOKBodyResults dcim regions list o k body results +// swagger:model dcimRegionsListOKBodyResults +type DcimRegionsListOKBodyResults []*Region + +// Validate validates this dcim regions list o k body results +func (m DcimRegionsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/dcim_sites_list_okbody.go b/netbox/models/dcim_sites_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..106a85e5854546b3d10723e1cc7b2a4bfb43fc32 --- /dev/null +++ b/netbox/models/dcim_sites_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" +) + +// DcimSitesListOKBody dcim sites list o k body +// swagger:model dcimSitesListOKBody +type DcimSitesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results DcimSitesListOKBodyResults `json:"results"` +} + +// Validate validates this dcim sites list o k body +func (m *DcimSitesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DcimSitesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *DcimSitesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DcimSitesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DcimSitesListOKBody) UnmarshalBinary(b []byte) error { + var res DcimSitesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/dcim_sites_list_okbody_results.go b/netbox/models/dcim_sites_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..5c9ac70151f727aff0e743366485e85a0292e724 --- /dev/null +++ b/netbox/models/dcim_sites_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" +) + +// DcimSitesListOKBodyResults dcim sites list o k body results +// swagger:model dcimSitesListOKBodyResults +type DcimSitesListOKBodyResults []*Site + +// Validate validates this dcim sites list o k body results +func (m DcimSitesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/device.go b/netbox/models/device.go new file mode 100644 index 0000000000000000000000000000000000000000..fe3ce41ebe6eea4023685411d5a5968db890614c --- /dev/null +++ b/netbox/models/device.go @@ -0,0 +1,499 @@ +// 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" +) + +// Device device +// swagger:model Device +type Device struct { + + // Asset tag + // + // A unique tag used to identify this device + // Max Length: 50 + AssetTag string `json:"asset_tag,omitempty"` + + // cluster + // Required: true + Cluster *NestedCluster `json:"cluster"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // device role + // Required: true + DeviceRole *NestedDeviceRole `json:"device_role"` + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // face + // Required: true + Face *DeviceFace `json:"face"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Max Length: 64 + Name string `json:"name,omitempty"` + + // Parent device + // Read Only: true + ParentDevice string `json:"parent_device,omitempty"` + + // platform + // Required: true + Platform *NestedPlatform `json:"platform"` + + // Position (U) + // + // The lowest-numbered unit occupied by the device + // Required: true + // Maximum: 32767 + // Minimum: 1 + Position *int64 `json:"position"` + + // primary ip + // Required: true + PrimaryIP *DeviceIPAddress `json:"primary_ip"` + + // primary ip4 + // Required: true + PrimaryIp4 *DeviceIPAddress `json:"primary_ip4"` + + // primary ip6 + // Required: true + PrimaryIp6 *DeviceIPAddress `json:"primary_ip6"` + + // rack + // Required: true + Rack *NestedRack `json:"rack"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // status + // Required: true + Status *DeviceStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` +} + +// Validate validates this device +func (m *Device) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateCluster(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDeviceRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFace(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePlatform(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePosition(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIP(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIp4(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIp6(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRack(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Device) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *Device) validateCluster(formats strfmt.Registry) error { + + if err := validate.Required("cluster", "body", m.Cluster); err != nil { + return err + } + + if m.Cluster != nil { + + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +func (m *Device) validateDeviceRole(formats strfmt.Registry) error { + + if err := validate.Required("device_role", "body", m.DeviceRole); err != nil { + return err + } + + if m.DeviceRole != nil { + + if err := m.DeviceRole.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_role") + } + return err + } + } + + return nil +} + +func (m *Device) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *Device) validateFace(formats strfmt.Registry) error { + + if err := validate.Required("face", "body", m.Face); err != nil { + return err + } + + if m.Face != nil { + + if err := m.Face.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("face") + } + return err + } + } + + return nil +} + +func (m *Device) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *Device) validatePlatform(formats strfmt.Registry) error { + + if err := validate.Required("platform", "body", m.Platform); err != nil { + return err + } + + if m.Platform != nil { + + if err := m.Platform.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("platform") + } + return err + } + } + + return nil +} + +func (m *Device) validatePosition(formats strfmt.Registry) error { + + if err := validate.Required("position", "body", m.Position); err != nil { + return err + } + + if err := validate.MinimumInt("position", "body", int64(*m.Position), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("position", "body", int64(*m.Position), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *Device) validatePrimaryIP(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip", "body", m.PrimaryIP); err != nil { + return err + } + + if m.PrimaryIP != nil { + + if err := m.PrimaryIP.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip") + } + return err + } + } + + return nil +} + +func (m *Device) validatePrimaryIp4(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip4", "body", m.PrimaryIp4); err != nil { + return err + } + + if m.PrimaryIp4 != nil { + + if err := m.PrimaryIp4.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip4") + } + return err + } + } + + return nil +} + +func (m *Device) validatePrimaryIp6(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip6", "body", m.PrimaryIp6); err != nil { + return err + } + + if m.PrimaryIp6 != nil { + + if err := m.PrimaryIp6.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip6") + } + return err + } + } + + return nil +} + +func (m *Device) validateRack(formats strfmt.Registry) error { + + if err := validate.Required("rack", "body", m.Rack); err != nil { + return err + } + + if m.Rack != nil { + + if err := m.Rack.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rack") + } + return err + } + } + + return nil +} + +func (m *Device) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *Device) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *Device) 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 *Device) 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 +} + +// MarshalBinary interface implementation +func (m *Device) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Device) UnmarshalBinary(b []byte) error { + var res Device + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_bay.go b/netbox/models/device_bay.go new file mode 100644 index 0000000000000000000000000000000000000000..49a111a95fe88f5db1d2ef7ffb9ef55e60a58178 --- /dev/null +++ b/netbox/models/device_bay.go @@ -0,0 +1,130 @@ +// 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" +) + +// DeviceBay device bay +// swagger:model DeviceBay +type DeviceBay struct { + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // installed device + // Required: true + InstalledDevice *NestedDevice `json:"installed_device"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this device bay +func (m *DeviceBay) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInstalledDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceBay) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *DeviceBay) validateInstalledDevice(formats strfmt.Registry) error { + + if err := validate.Required("installed_device", "body", m.InstalledDevice); err != nil { + return err + } + + if m.InstalledDevice != nil { + + if err := m.InstalledDevice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("installed_device") + } + return err + } + } + + return nil +} + +func (m *DeviceBay) 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 +} + +// MarshalBinary interface implementation +func (m *DeviceBay) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceBay) UnmarshalBinary(b []byte) error { + var res DeviceBay + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_bay_template.go b/netbox/models/device_bay_template.go new file mode 100644 index 0000000000000000000000000000000000000000..4811ff948846d52a2828f363672401e6e8031407 --- /dev/null +++ b/netbox/models/device_bay_template.go @@ -0,0 +1,102 @@ +// 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" +) + +// DeviceBayTemplate device bay template +// swagger:model DeviceBayTemplate +type DeviceBayTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this device bay template +func (m *DeviceBayTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceBayTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *DeviceBayTemplate) 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 +} + +// MarshalBinary interface implementation +func (m *DeviceBayTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceBayTemplate) UnmarshalBinary(b []byte) error { + var res DeviceBayTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_face.go b/netbox/models/device_face.go new file mode 100644 index 0000000000000000000000000000000000000000..0808cff25887b0f7cd104b835f74cc91acddcc93 --- /dev/null +++ b/netbox/models/device_face.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" +) + +// DeviceFace Face +// swagger:model deviceFace +type DeviceFace struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this device face +func (m *DeviceFace) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceFace) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceFace) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceFace) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceFace) UnmarshalBinary(b []byte) error { + var res DeviceFace + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_ip_address.go b/netbox/models/device_ip_address.go new file mode 100644 index 0000000000000000000000000000000000000000..6ae3efb73de632bfdf5a4d6723f4468478f9155e --- /dev/null +++ b/netbox/models/device_ip_address.go @@ -0,0 +1,79 @@ +// 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" +) + +// DeviceIPAddress Primary ip +// swagger:model DeviceIPAddress +type DeviceIPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this device IP address +func (m *DeviceIPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceIPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceIPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceIPAddress) UnmarshalBinary(b []byte) error { + var res DeviceIPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_role.go b/netbox/models/device_role.go new file mode 100644 index 0000000000000000000000000000000000000000..fc4d106f705442e742da8ca3e49dab181285eba2 --- /dev/null +++ b/netbox/models/device_role.go @@ -0,0 +1,135 @@ +// 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" +) + +// DeviceRole device role +// swagger:model DeviceRole +type DeviceRole struct { + + // Color + // Required: true + // Max Length: 6 + // Pattern: ^[0-9a-f]{6}$ + Color *string `json:"color"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // VM Role + // + // Virtual machines may be assigned to this role + VMRole bool `json:"vm_role,omitempty"` +} + +// Validate validates this device role +func (m *DeviceRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceRole) validateColor(formats strfmt.Registry) error { + + if err := validate.Required("color", "body", m.Color); err != nil { + return err + } + + if err := validate.MaxLength("color", "body", string(*m.Color), 6); err != nil { + return err + } + + if err := validate.Pattern("color", "body", string(*m.Color), `^[0-9a-f]{6}$`); err != nil { + return err + } + + return nil +} + +func (m *DeviceRole) 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 *DeviceRole) 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 *DeviceRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceRole) UnmarshalBinary(b []byte) error { + var res DeviceRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_status.go b/netbox/models/device_status.go new file mode 100644 index 0000000000000000000000000000000000000000..70ce0f1db3e5c787b2f3861f1d517af10cc64c7a --- /dev/null +++ b/netbox/models/device_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" +) + +// DeviceStatus Status +// swagger:model deviceStatus +type DeviceStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device status +func (m *DeviceStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceStatus) UnmarshalBinary(b []byte) error { + var res DeviceStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_type.go b/netbox/models/device_type.go new file mode 100644 index 0000000000000000000000000000000000000000..f5b1a4978d1cd34addc4c8fd62802d8b8256f146 --- /dev/null +++ b/netbox/models/device_type.go @@ -0,0 +1,267 @@ +// 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" +) + +// DeviceType device type +// swagger:model DeviceType +type DeviceType struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Instance count + // Read Only: true + InstanceCount int64 `json:"instance_count,omitempty"` + + // interface ordering + // Required: true + InterfaceOrdering *DeviceTypeInterfaceOrdering `json:"interface_ordering"` + + // Is a console server + // + // This type of device has console server ports + IsConsoleServer bool `json:"is_console_server,omitempty"` + + // Is full depth + // + // Device consumes both front and rear rack faces + IsFullDepth bool `json:"is_full_depth,omitempty"` + + // Is a network device + // + // This type of device has network interfaces + IsNetworkDevice bool `json:"is_network_device,omitempty"` + + // Is a PDU + // + // This type of device has power outlets + IsPdu bool `json:"is_pdu,omitempty"` + + // manufacturer + // Required: true + Manufacturer *NestedManufacturer `json:"manufacturer"` + + // Model + // Required: true + // Max Length: 50 + Model *string `json:"model"` + + // Part number + // + // Discrete part number (optional) + // Max Length: 50 + PartNumber string `json:"part_number,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // subdevice role + // Required: true + SubdeviceRole *DeviceTypeSubdeviceRole `json:"subdevice_role"` + + // Height (U) + // Maximum: 32767 + // Minimum: 0 + UHeight *int64 `json:"u_height,omitempty"` +} + +// Validate validates this device type +func (m *DeviceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInterfaceOrdering(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePartNumber(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSubdeviceRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceType) validateInterfaceOrdering(formats strfmt.Registry) error { + + if err := validate.Required("interface_ordering", "body", m.InterfaceOrdering); err != nil { + return err + } + + if m.InterfaceOrdering != nil { + + if err := m.InterfaceOrdering.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface_ordering") + } + return err + } + } + + return nil +} + +func (m *DeviceType) 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 *DeviceType) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { + return err + } + + return nil +} + +func (m *DeviceType) validatePartNumber(formats strfmt.Registry) error { + + if swag.IsZero(m.PartNumber) { // not required + return nil + } + + if err := validate.MaxLength("part_number", "body", string(m.PartNumber), 50); err != nil { + return err + } + + return nil +} + +func (m *DeviceType) 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 +} + +func (m *DeviceType) validateSubdeviceRole(formats strfmt.Registry) error { + + if err := validate.Required("subdevice_role", "body", m.SubdeviceRole); err != nil { + return err + } + + if m.SubdeviceRole != nil { + + if err := m.SubdeviceRole.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("subdevice_role") + } + return err + } + } + + return nil +} + +func (m *DeviceType) validateUHeight(formats strfmt.Registry) error { + + if swag.IsZero(m.UHeight) { // not required + return nil + } + + if err := validate.MinimumInt("u_height", "body", int64(*m.UHeight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("u_height", "body", int64(*m.UHeight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceType) UnmarshalBinary(b []byte) error { + var res DeviceType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_type_interface_ordering.go b/netbox/models/device_type_interface_ordering.go new file mode 100644 index 0000000000000000000000000000000000000000..8da7497ecdc74af004085ce926c5b95af52b437f --- /dev/null +++ b/netbox/models/device_type_interface_ordering.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" +) + +// DeviceTypeInterfaceOrdering Interface ordering +// swagger:model deviceTypeInterfaceOrdering +type DeviceTypeInterfaceOrdering struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this device type interface ordering +func (m *DeviceTypeInterfaceOrdering) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceTypeInterfaceOrdering) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceTypeInterfaceOrdering) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceTypeInterfaceOrdering) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceTypeInterfaceOrdering) UnmarshalBinary(b []byte) error { + var res DeviceTypeInterfaceOrdering + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/device_type_subdevice_role.go b/netbox/models/device_type_subdevice_role.go new file mode 100644 index 0000000000000000000000000000000000000000..47c352dede1e981a343d3cf49d68c1cae20b0462 --- /dev/null +++ b/netbox/models/device_type_subdevice_role.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" +) + +// DeviceTypeSubdeviceRole Subdevice role +// swagger:model deviceTypeSubdeviceRole +type DeviceTypeSubdeviceRole struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this device type subdevice role +func (m *DeviceTypeSubdeviceRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DeviceTypeSubdeviceRole) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *DeviceTypeSubdeviceRole) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DeviceTypeSubdeviceRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DeviceTypeSubdeviceRole) UnmarshalBinary(b []byte) error { + var res DeviceTypeSubdeviceRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/export_template.go b/netbox/models/export_template.go new file mode 100644 index 0000000000000000000000000000000000000000..c20d9ae2fb9df2d35d740a7fea10207d5ff9d05a --- /dev/null +++ b/netbox/models/export_template.go @@ -0,0 +1,176 @@ +// 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" +) + +// ExportTemplate export template +// swagger:model ExportTemplate +type ExportTemplate struct { + + // Content type + // Required: true + ContentType *int64 `json:"content_type"` + + // Description + // Max Length: 200 + Description string `json:"description,omitempty"` + + // File extension + // Max Length: 15 + FileExtension string `json:"file_extension,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Mime type + // Max Length: 15 + MimeType string `json:"mime_type,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Template code + // Required: true + TemplateCode *string `json:"template_code"` +} + +// Validate validates this export template +func (m *ExportTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContentType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFileExtension(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMimeType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTemplateCode(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExportTemplate) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("content_type", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 200); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateFileExtension(formats strfmt.Registry) error { + + if swag.IsZero(m.FileExtension) { // not required + return nil + } + + if err := validate.MaxLength("file_extension", "body", string(m.FileExtension), 15); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateMimeType(formats strfmt.Registry) error { + + if swag.IsZero(m.MimeType) { // not required + return nil + } + + if err := validate.MaxLength("mime_type", "body", string(m.MimeType), 15); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) 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), 100); err != nil { + return err + } + + return nil +} + +func (m *ExportTemplate) validateTemplateCode(formats strfmt.Registry) error { + + if err := validate.Required("template_code", "body", m.TemplateCode); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExportTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExportTemplate) UnmarshalBinary(b []byte) error { + var res ExportTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/extras_export_templates_list_okbody.go b/netbox/models/extras_export_templates_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..8c82c0ffaedb526a5ddd95f46dd821d8e31a24f0 --- /dev/null +++ b/netbox/models/extras_export_templates_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" +) + +// ExtrasExportTemplatesListOKBody extras export templates list o k body +// swagger:model extrasExportTemplatesListOKBody +type ExtrasExportTemplatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasExportTemplatesListOKBodyResults `json:"results"` +} + +// Validate validates this extras export templates list o k body +func (m *ExtrasExportTemplatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasExportTemplatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasExportTemplatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasExportTemplatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasExportTemplatesListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasExportTemplatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/extras_export_templates_list_okbody_results.go b/netbox/models/extras_export_templates_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..739f9664c25f371de46b12904b25a8caea16e3ff --- /dev/null +++ b/netbox/models/extras_export_templates_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" +) + +// ExtrasExportTemplatesListOKBodyResults extras export templates list o k body results +// swagger:model extrasExportTemplatesListOKBodyResults +type ExtrasExportTemplatesListOKBodyResults []*ExportTemplate + +// Validate validates this extras export templates list o k body results +func (m ExtrasExportTemplatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/extras_graphs_list_okbody.go b/netbox/models/extras_graphs_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..8215668f474dc79a8a4c1a9b8795e2deac138015 --- /dev/null +++ b/netbox/models/extras_graphs_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" +) + +// ExtrasGraphsListOKBody extras graphs list o k body +// swagger:model extrasGraphsListOKBody +type ExtrasGraphsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasGraphsListOKBodyResults `json:"results"` +} + +// Validate validates this extras graphs list o k body +func (m *ExtrasGraphsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasGraphsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasGraphsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasGraphsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasGraphsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasGraphsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/extras_graphs_list_okbody_results.go b/netbox/models/extras_graphs_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..4b6bb5d59855d778b2181fbd5595d61876376982 --- /dev/null +++ b/netbox/models/extras_graphs_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" +) + +// ExtrasGraphsListOKBodyResults extras graphs list o k body results +// swagger:model extrasGraphsListOKBodyResults +type ExtrasGraphsListOKBodyResults []*Graph + +// Validate validates this extras graphs list o k body results +func (m ExtrasGraphsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/extras_image_attachments_list_okbody.go b/netbox/models/extras_image_attachments_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..dbcf59296c19810c6883e8d600c1dca1e46b778c --- /dev/null +++ b/netbox/models/extras_image_attachments_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" +) + +// ExtrasImageAttachmentsListOKBody extras image attachments list o k body +// swagger:model extrasImageAttachmentsListOKBody +type ExtrasImageAttachmentsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasImageAttachmentsListOKBodyResults `json:"results"` +} + +// Validate validates this extras image attachments list o k body +func (m *ExtrasImageAttachmentsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasImageAttachmentsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasImageAttachmentsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasImageAttachmentsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasImageAttachmentsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasImageAttachmentsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/extras_image_attachments_list_okbody_results.go b/netbox/models/extras_image_attachments_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..b303c12f8f0a6882e92d740b3cf251cf5d01af95 --- /dev/null +++ b/netbox/models/extras_image_attachments_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" +) + +// ExtrasImageAttachmentsListOKBodyResults extras image attachments list o k body results +// swagger:model extrasImageAttachmentsListOKBodyResults +type ExtrasImageAttachmentsListOKBodyResults []*ImageAttachment + +// Validate validates this extras image attachments list o k body results +func (m ExtrasImageAttachmentsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/extras_recent_activity_list_okbody.go b/netbox/models/extras_recent_activity_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..bf0902b4c7c3c913226bbf7169391dadb605517c --- /dev/null +++ b/netbox/models/extras_recent_activity_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" +) + +// ExtrasRecentActivityListOKBody extras recent activity list o k body +// swagger:model extrasRecentActivityListOKBody +type ExtrasRecentActivityListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasRecentActivityListOKBodyResults `json:"results"` +} + +// Validate validates this extras recent activity list o k body +func (m *ExtrasRecentActivityListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasRecentActivityListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasRecentActivityListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasRecentActivityListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasRecentActivityListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasRecentActivityListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/extras_recent_activity_list_okbody_results.go b/netbox/models/extras_recent_activity_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..ae6f0c8676ddcae592c045de18c4964ea6408305 --- /dev/null +++ b/netbox/models/extras_recent_activity_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" +) + +// ExtrasRecentActivityListOKBodyResults extras recent activity list o k body results +// swagger:model extrasRecentActivityListOKBodyResults +type ExtrasRecentActivityListOKBodyResults []*UserAction + +// Validate validates this extras recent activity list o k body results +func (m ExtrasRecentActivityListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/extras_topology_maps_list_okbody.go b/netbox/models/extras_topology_maps_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..6601aad735a7d61d45786a5f378283f3979055b3 --- /dev/null +++ b/netbox/models/extras_topology_maps_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" +) + +// ExtrasTopologyMapsListOKBody extras topology maps list o k body +// swagger:model extrasTopologyMapsListOKBody +type ExtrasTopologyMapsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results ExtrasTopologyMapsListOKBodyResults `json:"results"` +} + +// Validate validates this extras topology maps list o k body +func (m *ExtrasTopologyMapsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExtrasTopologyMapsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *ExtrasTopologyMapsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExtrasTopologyMapsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExtrasTopologyMapsListOKBody) UnmarshalBinary(b []byte) error { + var res ExtrasTopologyMapsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/extras_topology_maps_list_okbody_results.go b/netbox/models/extras_topology_maps_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..7a8566d56aafe87955d7550b2b952bacfa364217 --- /dev/null +++ b/netbox/models/extras_topology_maps_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" +) + +// ExtrasTopologyMapsListOKBodyResults extras topology maps list o k body results +// swagger:model extrasTopologyMapsListOKBodyResults +type ExtrasTopologyMapsListOKBodyResults []*TopologyMap + +// Validate validates this extras topology maps list o k body results +func (m ExtrasTopologyMapsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/graph.go b/netbox/models/graph.go new file mode 100644 index 0000000000000000000000000000000000000000..19447a61eee42bf8836c8acee53a6cf54d5dd3d6 --- /dev/null +++ b/netbox/models/graph.go @@ -0,0 +1,178 @@ +// 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" +) + +// Graph graph +// swagger:model Graph +type Graph struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Link URL + // Max Length: 200 + Link strfmt.URI `json:"link,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Source URL + // Required: true + // Max Length: 500 + Source *string `json:"source"` + + // type + // Required: true + Type *GraphType `json:"type"` + + // Weight + // Maximum: 32767 + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this graph +func (m *Graph) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLink(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Graph) validateLink(formats strfmt.Registry) error { + + if swag.IsZero(m.Link) { // not required + return nil + } + + if err := validate.MaxLength("link", "body", string(m.Link), 200); err != nil { + return err + } + + if err := validate.FormatOf("link", "body", "uri", m.Link.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Graph) 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), 100); err != nil { + return err + } + + return nil +} + +func (m *Graph) validateSource(formats strfmt.Registry) error { + + if err := validate.Required("source", "body", m.Source); err != nil { + return err + } + + if err := validate.MaxLength("source", "body", string(*m.Source), 500); err != nil { + return err + } + + return nil +} + +func (m *Graph) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *Graph) validateWeight(formats strfmt.Registry) error { + + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", int64(*m.Weight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("weight", "body", int64(*m.Weight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Graph) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Graph) UnmarshalBinary(b []byte) error { + var res Graph + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/graph_type.go b/netbox/models/graph_type.go new file mode 100644 index 0000000000000000000000000000000000000000..5f2f906395b117cc3c793e5db14b020202c9db12 --- /dev/null +++ b/netbox/models/graph_type.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" +) + +// GraphType Type +// swagger:model graphType +type GraphType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this graph type +func (m *GraphType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GraphType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *GraphType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GraphType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GraphType) UnmarshalBinary(b []byte) error { + var res GraphType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/image_attachment.go b/netbox/models/image_attachment.go new file mode 100644 index 0000000000000000000000000000000000000000..e09bcf3c5c8f423c58f87b6eb7c10aa544ec3602 --- /dev/null +++ b/netbox/models/image_attachment.go @@ -0,0 +1,160 @@ +// 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" +) + +// ImageAttachment image attachment +// swagger:model ImageAttachment +type ImageAttachment struct { + + // Created + // Read Only: true + Created strfmt.DateTime `json:"created,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Image + // Required: true + // Read Only: true + Image strfmt.URI `json:"image"` + + // Image height + // Required: true + // Maximum: 32767 + // Minimum: 0 + ImageHeight *int64 `json:"image_height"` + + // Image width + // Required: true + // Maximum: 32767 + // Minimum: 0 + ImageWidth *int64 `json:"image_width"` + + // Name + // Max Length: 50 + Name string `json:"name,omitempty"` + + // Parent + // Read Only: true + Parent string `json:"parent,omitempty"` +} + +// Validate validates this image attachment +func (m *ImageAttachment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateImage(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateImageHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateImageWidth(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ImageAttachment) validateImage(formats strfmt.Registry) error { + + if err := validate.Required("image", "body", strfmt.URI(m.Image)); err != nil { + return err + } + + if err := validate.FormatOf("image", "body", "uri", m.Image.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ImageAttachment) validateImageHeight(formats strfmt.Registry) error { + + if err := validate.Required("image_height", "body", m.ImageHeight); err != nil { + return err + } + + if err := validate.MinimumInt("image_height", "body", int64(*m.ImageHeight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("image_height", "body", int64(*m.ImageHeight), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *ImageAttachment) validateImageWidth(formats strfmt.Registry) error { + + if err := validate.Required("image_width", "body", m.ImageWidth); err != nil { + return err + } + + if err := validate.MinimumInt("image_width", "body", int64(*m.ImageWidth), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("image_width", "body", int64(*m.ImageWidth), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *ImageAttachment) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ImageAttachment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ImageAttachment) UnmarshalBinary(b []byte) error { + var res ImageAttachment + 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 new file mode 100644 index 0000000000000000000000000000000000000000..7b1a58d0e3b6885f5a07d52a28426b9fd8c8f0c5 --- /dev/null +++ b/netbox/models/interface.go @@ -0,0 +1,254 @@ +// 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" +) + +// Interface Interface +// swagger:model Interface +type Interface struct { + + // circuit termination + // Required: true + CircuitTermination *InterfaceCircuitTermination `json:"circuit_termination"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // form factor + // Required: true + FormFactor *InterfaceFormFactor `json:"form_factor"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface connection + // Read Only: true + InterfaceConnection string `json:"interface_connection,omitempty"` + + // Is connected + // Read Only: true + IsConnected string `json:"is_connected,omitempty"` + + // lag + // Required: true + Lag *NestedInterface `json:"lag"` + + // MAC Address + MacAddress string `json:"mac_address,omitempty"` + + // OOB Management + // + // This interface is used only for out-of-band management + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // MTU + // Maximum: 32767 + // Minimum: 0 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` +} + +// Validate validates this interface +func (m *Interface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCircuitTermination(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateLag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Interface) validateCircuitTermination(formats strfmt.Registry) error { + + if err := validate.Required("circuit_termination", "body", m.CircuitTermination); err != nil { + return err + } + + if m.CircuitTermination != nil { + + if err := m.CircuitTermination.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuit_termination") + } + return err + } + } + + return nil +} + +func (m *Interface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *Interface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *Interface) validateFormFactor(formats strfmt.Registry) error { + + if err := validate.Required("form_factor", "body", m.FormFactor); err != nil { + return err + } + + if m.FormFactor != nil { + + if err := m.FormFactor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("form_factor") + } + return err + } + } + + return nil +} + +func (m *Interface) validateLag(formats strfmt.Registry) error { + + if err := validate.Required("lag", "body", m.Lag); err != nil { + return err + } + + if m.Lag != nil { + + if err := m.Lag.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lag") + } + return err + } + } + + return nil +} + +func (m *Interface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *Interface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Interface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Interface) UnmarshalBinary(b []byte) error { + var res Interface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_circuit_termination.go b/netbox/models/interface_circuit_termination.go new file mode 100644 index 0000000000000000000000000000000000000000..d41fb84fcdf20c30ea8d68b538fd1f9e2e9b5324 --- /dev/null +++ b/netbox/models/interface_circuit_termination.go @@ -0,0 +1,232 @@ +// 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" +) + +// InterfaceCircuitTermination Circuit termination +// swagger:model InterfaceCircuitTermination +type InterfaceCircuitTermination struct { + + // circuit + // Required: true + Circuit *InterfaceNestedCircuit `json:"circuit"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Port speed (Kbps) + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + PortSpeed *int64 `json:"port_speed"` + + // Patch panel/port(s) + // Max Length: 100 + PpInfo string `json:"pp_info,omitempty"` + + // Termination + // Required: true + TermSide *string `json:"term_side"` + + // Upstream speed (Kbps) + // + // Upstream speed, if different from port speed + // Maximum: 2.147483647e+09 + // Minimum: 0 + UpstreamSpeed *int64 `json:"upstream_speed,omitempty"` + + // Cross-connect ID + // Max Length: 50 + XconnectID string `json:"xconnect_id,omitempty"` +} + +// Validate validates this interface circuit termination +func (m *InterfaceCircuitTermination) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCircuit(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePpInfo(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTermSide(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUpstreamSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateXconnectID(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceCircuitTermination) validateCircuit(formats strfmt.Registry) error { + + if err := validate.Required("circuit", "body", m.Circuit); err != nil { + return err + } + + if m.Circuit != nil { + + if err := m.Circuit.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("circuit") + } + return err + } + } + + return nil +} + +func (m *InterfaceCircuitTermination) validatePortSpeed(formats strfmt.Registry) error { + + if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { + return err + } + + if err := validate.MinimumInt("port_speed", "body", int64(*m.PortSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("port_speed", "body", int64(*m.PortSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *InterfaceCircuitTermination) validatePpInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.PpInfo) { // not required + return nil + } + + if err := validate.MaxLength("pp_info", "body", string(m.PpInfo), 100); err != nil { + return err + } + + return nil +} + +var interfaceCircuitTerminationTypeTermSidePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["A","Z"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + interfaceCircuitTerminationTypeTermSidePropEnum = append(interfaceCircuitTerminationTypeTermSidePropEnum, v) + } +} + +const ( + // InterfaceCircuitTerminationTermSideA captures enum value "A" + InterfaceCircuitTerminationTermSideA string = "A" + // InterfaceCircuitTerminationTermSideZ captures enum value "Z" + InterfaceCircuitTerminationTermSideZ string = "Z" +) + +// prop value enum +func (m *InterfaceCircuitTermination) validateTermSideEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, interfaceCircuitTerminationTypeTermSidePropEnum); err != nil { + return err + } + return nil +} + +func (m *InterfaceCircuitTermination) validateTermSide(formats strfmt.Registry) error { + + if err := validate.Required("term_side", "body", m.TermSide); err != nil { + return err + } + + // value enum + if err := m.validateTermSideEnum("term_side", "body", *m.TermSide); err != nil { + return err + } + + return nil +} + +func (m *InterfaceCircuitTermination) validateUpstreamSpeed(formats strfmt.Registry) error { + + if swag.IsZero(m.UpstreamSpeed) { // not required + return nil + } + + if err := validate.MinimumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *InterfaceCircuitTermination) validateXconnectID(formats strfmt.Registry) error { + + if swag.IsZero(m.XconnectID) { // not required + return nil + } + + if err := validate.MaxLength("xconnect_id", "body", string(m.XconnectID), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceCircuitTermination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceCircuitTermination) UnmarshalBinary(b []byte) error { + var res InterfaceCircuitTermination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_connection.go b/netbox/models/interface_connection.go new file mode 100644 index 0000000000000000000000000000000000000000..70159d97ba002d4dac95ba0714cc8742439baf63 --- /dev/null +++ b/netbox/models/interface_connection.go @@ -0,0 +1,135 @@ +// 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" +) + +// InterfaceConnection interface connection +// swagger:model InterfaceConnection +type InterfaceConnection struct { + + // connection status + // Required: true + ConnectionStatus *InterfaceConnectionConnectionStatus `json:"connection_status"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // interface a + // Required: true + InterfaceA *PeerInterface `json:"interface_a"` + + // interface b + // Required: true + InterfaceB *PeerInterface `json:"interface_b"` +} + +// Validate validates this interface connection +func (m *InterfaceConnection) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConnectionStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterfaceA(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterfaceB(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceConnection) validateConnectionStatus(formats strfmt.Registry) error { + + if err := validate.Required("connection_status", "body", m.ConnectionStatus); err != nil { + return err + } + + if m.ConnectionStatus != nil { + + if err := m.ConnectionStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("connection_status") + } + return err + } + } + + return nil +} + +func (m *InterfaceConnection) validateInterfaceA(formats strfmt.Registry) error { + + if err := validate.Required("interface_a", "body", m.InterfaceA); err != nil { + return err + } + + if m.InterfaceA != nil { + + if err := m.InterfaceA.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface_a") + } + return err + } + } + + return nil +} + +func (m *InterfaceConnection) validateInterfaceB(formats strfmt.Registry) error { + + if err := validate.Required("interface_b", "body", m.InterfaceB); err != nil { + return err + } + + if m.InterfaceB != nil { + + if err := m.InterfaceB.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface_b") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceConnection) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceConnection) UnmarshalBinary(b []byte) error { + var res InterfaceConnection + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_connection_connection_status.go b/netbox/models/interface_connection_connection_status.go new file mode 100644 index 0000000000000000000000000000000000000000..75c1a1c596da45af3830309268e2982716cbe79d --- /dev/null +++ b/netbox/models/interface_connection_connection_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" +) + +// InterfaceConnectionConnectionStatus Connection status +// swagger:model interfaceConnectionConnectionStatus +type InterfaceConnectionConnectionStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *bool `json:"value"` +} + +// Validate validates this interface connection connection status +func (m *InterfaceConnectionConnectionStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceConnectionConnectionStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceConnectionConnectionStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceConnectionConnectionStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceConnectionConnectionStatus) UnmarshalBinary(b []byte) error { + var res InterfaceConnectionConnectionStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_form_factor.go b/netbox/models/interface_form_factor.go new file mode 100644 index 0000000000000000000000000000000000000000..93d051b092cc67c6269cec578a724b8cda16625c --- /dev/null +++ b/netbox/models/interface_form_factor.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" +) + +// InterfaceFormFactor Form factor +// swagger:model interfaceFormFactor +type InterfaceFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this interface form factor +func (m *InterfaceFormFactor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceFormFactor) UnmarshalBinary(b []byte) error { + var res InterfaceFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_nested_circuit.go b/netbox/models/interface_nested_circuit.go new file mode 100644 index 0000000000000000000000000000000000000000..468f4de0a954fcd3e9402a6b6f01915fc7911574 --- /dev/null +++ b/netbox/models/interface_nested_circuit.go @@ -0,0 +1,78 @@ +// 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" +) + +// InterfaceNestedCircuit Circuit +// swagger:model InterfaceNestedCircuit +type InterfaceNestedCircuit struct { + + // Circuit ID + // Required: true + // Max Length: 50 + Cid *string `json:"cid"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this interface nested circuit +func (m *InterfaceNestedCircuit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceNestedCircuit) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceNestedCircuit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceNestedCircuit) UnmarshalBinary(b []byte) error { + var res InterfaceNestedCircuit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_template.go b/netbox/models/interface_template.go new file mode 100644 index 0000000000000000000000000000000000000000..74c6b0a172593cf186250f63e6c184822915548f --- /dev/null +++ b/netbox/models/interface_template.go @@ -0,0 +1,133 @@ +// 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" +) + +// InterfaceTemplate interface template +// swagger:model InterfaceTemplate +type InterfaceTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // form factor + // Required: true + FormFactor *InterfaceTemplateFormFactor `json:"form_factor"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Management only + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` +} + +// Validate validates this interface template +func (m *InterfaceTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *InterfaceTemplate) 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 *InterfaceTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceTemplate) UnmarshalBinary(b []byte) error { + var res InterfaceTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/interface_template_form_factor.go b/netbox/models/interface_template_form_factor.go new file mode 100644 index 0000000000000000000000000000000000000000..8a3147c55787c5a22590ab781f702aff19106bd1 --- /dev/null +++ b/netbox/models/interface_template_form_factor.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" +) + +// InterfaceTemplateFormFactor Form factor +// swagger:model interfaceTemplateFormFactor +type InterfaceTemplateFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this interface template form factor +func (m *InterfaceTemplateFormFactor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InterfaceTemplateFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *InterfaceTemplateFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InterfaceTemplateFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InterfaceTemplateFormFactor) UnmarshalBinary(b []byte) error { + var res InterfaceTemplateFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/inventory_item.go b/netbox/models/inventory_item.go new file mode 100644 index 0000000000000000000000000000000000000000..37b343e2960ed792657858d4d3f8ec04e7091822 --- /dev/null +++ b/netbox/models/inventory_item.go @@ -0,0 +1,241 @@ +// 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" +) + +// InventoryItem inventory item +// swagger:model InventoryItem +type InventoryItem struct { + + // Asset tag + // + // A unique tag used to identify this item + // Max Length: 50 + AssetTag string `json:"asset_tag,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // Discovered + Discovered bool `json:"discovered,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // manufacturer + // Required: true + Manufacturer *NestedManufacturer `json:"manufacturer"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Parent + // Required: true + Parent *int64 `json:"parent"` + + // Part ID + // Max Length: 50 + PartID string `json:"part_id,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` +} + +// Validate validates this inventory item +func (m *InventoryItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePartID(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InventoryItem) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *InventoryItem) 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 *InventoryItem) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *InventoryItem) 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 *InventoryItem) 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 *InventoryItem) validateParent(formats strfmt.Registry) error { + + if err := validate.Required("parent", "body", m.Parent); err != nil { + return err + } + + return nil +} + +func (m *InventoryItem) validatePartID(formats strfmt.Registry) error { + + if swag.IsZero(m.PartID) { // not required + return nil + } + + if err := validate.MaxLength("part_id", "body", string(m.PartID), 50); err != nil { + return err + } + + return nil +} + +func (m *InventoryItem) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InventoryItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InventoryItem) UnmarshalBinary(b []byte) error { + var res InventoryItem + 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 new file mode 100644 index 0000000000000000000000000000000000000000..0f441fda40c7ce66a0b68bd0f60fea0b06549c6e --- /dev/null +++ b/netbox/models/ip_address.go @@ -0,0 +1,296 @@ +// 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" +) + +// IPAddress IP address +// swagger:model IPAddress +type IPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // interface + // Required: true + Interface *IPAddressInterface `json:"interface"` + + // nat inside + // Required: true + NatInside *NestedIPAddress `json:"nat_inside"` + + // nat outside + // Required: true + NatOutside *NestedIPAddress `json:"nat_outside"` + + // role + // Required: true + Role *IPAddressRole `json:"role"` + + // status + // Required: true + Status *IPAddressStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // vrf + // Required: true + Vrf *NestedVRF `json:"vrf"` +} + +// Validate validates this IP address +func (m *IPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterface(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateNatInside(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateNatOutside(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVrf(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +func (m *IPAddress) 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 *IPAddress) validateInterface(formats strfmt.Registry) error { + + if err := validate.Required("interface", "body", m.Interface); err != nil { + return err + } + + if m.Interface != nil { + + if err := m.Interface.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("interface") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateNatInside(formats strfmt.Registry) error { + + if err := validate.Required("nat_inside", "body", m.NatInside); err != nil { + return err + } + + if m.NatInside != nil { + + if err := m.NatInside.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_inside") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateNatOutside(formats strfmt.Registry) error { + + if err := validate.Required("nat_outside", "body", m.NatOutside); err != nil { + return err + } + + if m.NatOutside != nil { + + if err := m.NatOutside.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("nat_outside") + } + return err + } + } + + return nil +} + +func (m *IPAddress) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *IPAddress) 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 *IPAddress) 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 *IPAddress) validateVrf(formats strfmt.Registry) error { + + if err := validate.Required("vrf", "body", m.Vrf); err != nil { + return err + } + + if m.Vrf != nil { + + if err := m.Vrf.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vrf") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddress) UnmarshalBinary(b []byte) error { + var res IPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_address_interface.go b/netbox/models/ip_address_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..cb411f6a48af226dd281d2ee11f32a3397e0acf5 --- /dev/null +++ b/netbox/models/ip_address_interface.go @@ -0,0 +1,282 @@ +// 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" +) + +// IPAddressInterface Interface +// 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"` + + // virtual machine + // Required: true + VirtualMachine *NestedVirtualMachine `json:"virtual_machine"` +} + +// Validate validates this IP address interface +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) + } + + if err := m.validateVirtualMachine(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + 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 { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *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 { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *IPAddressInterface) validateVirtualMachine(formats strfmt.Registry) error { + + if err := validate.Required("virtual_machine", "body", m.VirtualMachine); err != nil { + return err + } + + if m.VirtualMachine != nil { + + if err := m.VirtualMachine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_machine") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressInterface) UnmarshalBinary(b []byte) error { + var res IPAddressInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_address_interface_form_factor.go b/netbox/models/ip_address_interface_form_factor.go new file mode 100644 index 0000000000000000000000000000000000000000..1d6e886bb60d38196fac4b7d7396597eb73600e0 --- /dev/null +++ b/netbox/models/ip_address_interface_form_factor.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" +) + +// IPAddressInterfaceFormFactor Form factor +// swagger:model ipAddressInterfaceFormFactor +type IPAddressInterfaceFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this ip address interface form factor +func (m *IPAddressInterfaceFormFactor) 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 *IPAddressInterfaceFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *IPAddressInterfaceFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressInterfaceFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressInterfaceFormFactor) UnmarshalBinary(b []byte) error { + var res IPAddressInterfaceFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_address_role.go b/netbox/models/ip_address_role.go new file mode 100644 index 0000000000000000000000000000000000000000..1799b7226bd7121d2f0597d4f73ba379ffdfb1ba --- /dev/null +++ b/netbox/models/ip_address_role.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" +) + +// IPAddressRole Role +// swagger:model ipAddressRole +type IPAddressRole struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this ip address role +func (m *IPAddressRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddressRole) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *IPAddressRole) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressRole) UnmarshalBinary(b []byte) error { + var res IPAddressRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_address_status.go b/netbox/models/ip_address_status.go new file mode 100644 index 0000000000000000000000000000000000000000..9f20917663ab99665fd1e73f10f137f2be58b73e --- /dev/null +++ b/netbox/models/ip_address_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" +) + +// IPAddressStatus Status +// swagger:model ipAddressStatus +type IPAddressStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this ip address status +func (m *IPAddressStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAddressStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *IPAddressStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAddressStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAddressStatus) UnmarshalBinary(b []byte) error { + var res IPAddressStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amaggregates_list_okbody.go b/netbox/models/ip_amaggregates_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..3acdc9d1e074562950d057fdf80c55a2090b5cb3 --- /dev/null +++ b/netbox/models/ip_amaggregates_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" +) + +// IPAMAggregatesListOKBody ipam aggregates list o k body +// swagger:model ipamAggregatesListOKBody +type IPAMAggregatesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMAggregatesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam aggregates list o k body +func (m *IPAMAggregatesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMAggregatesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMAggregatesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMAggregatesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMAggregatesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMAggregatesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amaggregates_list_okbody_results.go b/netbox/models/ip_amaggregates_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..d60b84031fd0ed1fbbef052dea9e4c10b29aefa4 --- /dev/null +++ b/netbox/models/ip_amaggregates_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" +) + +// IPAMAggregatesListOKBodyResults ipam aggregates list o k body results +// swagger:model ipamAggregatesListOKBodyResults +type IPAMAggregatesListOKBodyResults []*Aggregate + +// Validate validates this ipam aggregates list o k body results +func (m IPAMAggregatesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/ip_amip_addresses_list_okbody.go b/netbox/models/ip_amip_addresses_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..fb78d14978ec2eb88436dcfae436fd2c7f8d9fb3 --- /dev/null +++ b/netbox/models/ip_amip_addresses_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" +) + +// IPAMIPAddressesListOKBody ipam Ip addresses list o k body +// swagger:model ipamIpAddressesListOKBody +type IPAMIPAddressesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMIPAddressesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam Ip addresses list o k body +func (m *IPAMIPAddressesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMIPAddressesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMIPAddressesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMIPAddressesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMIPAddressesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMIPAddressesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amip_addresses_list_okbody_results.go b/netbox/models/ip_amip_addresses_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..75fc710e61c352d9d9a4950841c789eea868a9de --- /dev/null +++ b/netbox/models/ip_amip_addresses_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" +) + +// IPAMIPAddressesListOKBodyResults ipam Ip addresses list o k body results +// swagger:model ipamIpAddressesListOKBodyResults +type IPAMIPAddressesListOKBodyResults []*IPAddress + +// Validate validates this ipam Ip addresses list o k body results +func (m IPAMIPAddressesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/ip_amprefixes_list_okbody.go b/netbox/models/ip_amprefixes_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..a98611f8107ff33729d7adacd19055a486534cfb --- /dev/null +++ b/netbox/models/ip_amprefixes_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" +) + +// IPAMPrefixesListOKBody ipam prefixes list o k body +// swagger:model ipamPrefixesListOKBody +type IPAMPrefixesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMPrefixesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam prefixes list o k body +func (m *IPAMPrefixesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMPrefixesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMPrefixesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMPrefixesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMPrefixesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMPrefixesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amprefixes_list_okbody_results.go b/netbox/models/ip_amprefixes_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..a8ddeebc1e562c0007c15a469d5b9da1248a3108 --- /dev/null +++ b/netbox/models/ip_amprefixes_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" +) + +// IPAMPrefixesListOKBodyResults ipam prefixes list o k body results +// swagger:model ipamPrefixesListOKBodyResults +type IPAMPrefixesListOKBodyResults []*Prefix + +// Validate validates this ipam prefixes list o k body results +func (m IPAMPrefixesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/ip_amrirs_list_okbody.go b/netbox/models/ip_amrirs_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..173d5deb9b5bff73348595072699a297543f0bfa --- /dev/null +++ b/netbox/models/ip_amrirs_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" +) + +// IPAMRirsListOKBody ipam rirs list o k body +// swagger:model ipamRirsListOKBody +type IPAMRirsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMRirsListOKBodyResults `json:"results"` +} + +// Validate validates this ipam rirs list o k body +func (m *IPAMRirsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMRirsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMRirsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMRirsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMRirsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMRirsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amrirs_list_okbody_results.go b/netbox/models/ip_amrirs_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..64a36c4d27335553010f9a3c92e1a2273f8d75ad --- /dev/null +++ b/netbox/models/ip_amrirs_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" +) + +// IPAMRirsListOKBodyResults ipam rirs list o k body results +// swagger:model ipamRirsListOKBodyResults +type IPAMRirsListOKBodyResults []*RIR + +// Validate validates this ipam rirs list o k body results +func (m IPAMRirsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/ip_amroles_list_okbody.go b/netbox/models/ip_amroles_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..405631d2a3a158c5acc09d711a565e4fa3b6e5e6 --- /dev/null +++ b/netbox/models/ip_amroles_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" +) + +// IPAMRolesListOKBody ipam roles list o k body +// swagger:model ipamRolesListOKBody +type IPAMRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMRolesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam roles list o k body +func (m *IPAMRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMRolesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMRolesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amroles_list_okbody_results.go b/netbox/models/ip_amroles_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..1fb7c948a82c55a4f9e5942ce3eaae33ba050976 --- /dev/null +++ b/netbox/models/ip_amroles_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" +) + +// IPAMRolesListOKBodyResults ipam roles list o k body results +// swagger:model ipamRolesListOKBodyResults +type IPAMRolesListOKBodyResults []*Role + +// Validate validates this ipam roles list o k body results +func (m IPAMRolesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/ip_amservices_list_okbody.go b/netbox/models/ip_amservices_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..06aa448bbee83332d85feeaf6342d9cede8396b4 --- /dev/null +++ b/netbox/models/ip_amservices_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" +) + +// IPAMServicesListOKBody ipam services list o k body +// swagger:model ipamServicesListOKBody +type IPAMServicesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMServicesListOKBodyResults `json:"results"` +} + +// Validate validates this ipam services list o k body +func (m *IPAMServicesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMServicesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMServicesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMServicesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMServicesListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMServicesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amservices_list_okbody_results.go b/netbox/models/ip_amservices_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..1c405b9a64259fe46002c36f55c1b408873df588 --- /dev/null +++ b/netbox/models/ip_amservices_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" +) + +// IPAMServicesListOKBodyResults ipam services list o k body results +// swagger:model ipamServicesListOKBodyResults +type IPAMServicesListOKBodyResults []*Service + +// Validate validates this ipam services list o k body results +func (m IPAMServicesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/ip_amvlan_groups_list_okbody.go b/netbox/models/ip_amvlan_groups_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..82029f6ace4594204f8d734ca1a6a589b53ae082 --- /dev/null +++ b/netbox/models/ip_amvlan_groups_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" +) + +// IPAMVlanGroupsListOKBody ipam vlan groups list o k body +// swagger:model ipamVlanGroupsListOKBody +type IPAMVlanGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMVlanGroupsListOKBodyResults `json:"results"` +} + +// Validate validates this ipam vlan groups list o k body +func (m *IPAMVlanGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMVlanGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMVlanGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMVlanGroupsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMVlanGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVlanGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amvlan_groups_list_okbody_results.go b/netbox/models/ip_amvlan_groups_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..fa4f17ccc403485206b63bc451ad3e7a41357c2f --- /dev/null +++ b/netbox/models/ip_amvlan_groups_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" +) + +// IPAMVlanGroupsListOKBodyResults ipam vlan groups list o k body results +// swagger:model ipamVlanGroupsListOKBodyResults +type IPAMVlanGroupsListOKBodyResults []*VLANGroup + +// Validate validates this ipam vlan groups list o k body results +func (m IPAMVlanGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/ip_amvlans_list_okbody.go b/netbox/models/ip_amvlans_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..d21003faf4c1ab430dadf648a3837509c432f5bb --- /dev/null +++ b/netbox/models/ip_amvlans_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" +) + +// IPAMVlansListOKBody ipam vlans list o k body +// swagger:model ipamVlansListOKBody +type IPAMVlansListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMVlansListOKBodyResults `json:"results"` +} + +// Validate validates this ipam vlans list o k body +func (m *IPAMVlansListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMVlansListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMVlansListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMVlansListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMVlansListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVlansListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amvlans_list_okbody_results.go b/netbox/models/ip_amvlans_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..e7d74400d617d974f0075f6c4eb15ecf1e6bfaef --- /dev/null +++ b/netbox/models/ip_amvlans_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" +) + +// IPAMVlansListOKBodyResults ipam vlans list o k body results +// swagger:model ipamVlansListOKBodyResults +type IPAMVlansListOKBodyResults []*VLAN + +// Validate validates this ipam vlans list o k body results +func (m IPAMVlansListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/ip_amvrfs_list_okbody.go b/netbox/models/ip_amvrfs_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..a2275ddf1727aad62599fc690a0db97def4757a3 --- /dev/null +++ b/netbox/models/ip_amvrfs_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" +) + +// IPAMVrfsListOKBody ipam vrfs list o k body +// swagger:model ipamVrfsListOKBody +type IPAMVrfsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results IPAMVrfsListOKBodyResults `json:"results"` +} + +// Validate validates this ipam vrfs list o k body +func (m *IPAMVrfsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IPAMVrfsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *IPAMVrfsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *IPAMVrfsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IPAMVrfsListOKBody) UnmarshalBinary(b []byte) error { + var res IPAMVrfsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/ip_amvrfs_list_okbody_results.go b/netbox/models/ip_amvrfs_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..fa1c3fc9b35b1fdddbe1870486f7494768615467 --- /dev/null +++ b/netbox/models/ip_amvrfs_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" +) + +// IPAMVrfsListOKBodyResults ipam vrfs list o k body results +// swagger:model ipamVrfsListOKBodyResults +type IPAMVrfsListOKBodyResults []*VRF + +// Validate validates this ipam vrfs list o k body results +func (m IPAMVrfsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/manufacturer.go b/netbox/models/manufacturer.go new file mode 100644 index 0000000000000000000000000000000000000000..59f0946207f2e9f7102979e0f0be90de74555cf6 --- /dev/null +++ b/netbox/models/manufacturer.go @@ -0,0 +1,102 @@ +// 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" +) + +// Manufacturer manufacturer +// swagger:model Manufacturer +type Manufacturer struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this manufacturer +func (m *Manufacturer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Manufacturer) 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 *Manufacturer) 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 *Manufacturer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Manufacturer) UnmarshalBinary(b []byte) error { + var res Manufacturer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_circuit.go b/netbox/models/nested_circuit.go new file mode 100644 index 0000000000000000000000000000000000000000..b3407d4084ae65b55cd6c22acecfb1fbddea0904 --- /dev/null +++ b/netbox/models/nested_circuit.go @@ -0,0 +1,78 @@ +// 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" +) + +// NestedCircuit Circuit +// swagger:model NestedCircuit +type NestedCircuit struct { + + // Circuit ID + // Required: true + // Max Length: 50 + Cid *string `json:"cid"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested circuit +func (m *NestedCircuit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedCircuit) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedCircuit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedCircuit) UnmarshalBinary(b []byte) error { + var res NestedCircuit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_circuit_type.go b/netbox/models/nested_circuit_type.go new file mode 100644 index 0000000000000000000000000000000000000000..9b9a9ab4f76798038a99fddd3cdaa57c3f3e6a79 --- /dev/null +++ b/netbox/models/nested_circuit_type.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedCircuitType Type +// swagger:model NestedCircuitType +type NestedCircuitType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested circuit type +func (m *NestedCircuitType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedCircuitType) 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 *NestedCircuitType) 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 *NestedCircuitType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedCircuitType) UnmarshalBinary(b []byte) error { + var res NestedCircuitType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_cluster.go b/netbox/models/nested_cluster.go new file mode 100644 index 0000000000000000000000000000000000000000..a46b4c6cfe046e409828ee496c2813cfd5f7b3af --- /dev/null +++ b/netbox/models/nested_cluster.go @@ -0,0 +1,78 @@ +// 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" +) + +// NestedCluster Cluster +// swagger:model NestedCluster +type NestedCluster struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested cluster +func (m *NestedCluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedCluster) 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), 100); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedCluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedCluster) UnmarshalBinary(b []byte) error { + var res NestedCluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_cluster_group.go b/netbox/models/nested_cluster_group.go new file mode 100644 index 0000000000000000000000000000000000000000..8fd30da6ecf4fbb462ee09aa93dc74eaff1a047a --- /dev/null +++ b/netbox/models/nested_cluster_group.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedClusterGroup Group +// swagger:model NestedClusterGroup +type NestedClusterGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested cluster group +func (m *NestedClusterGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedClusterGroup) 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 *NestedClusterGroup) 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 *NestedClusterGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedClusterGroup) UnmarshalBinary(b []byte) error { + var res NestedClusterGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_cluster_type.go b/netbox/models/nested_cluster_type.go new file mode 100644 index 0000000000000000000000000000000000000000..e211a9151fb44d8bb223bc76b86e07d60fb1c788 --- /dev/null +++ b/netbox/models/nested_cluster_type.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedClusterType Type +// swagger:model NestedClusterType +type NestedClusterType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested cluster type +func (m *NestedClusterType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedClusterType) 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 *NestedClusterType) 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 *NestedClusterType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedClusterType) UnmarshalBinary(b []byte) error { + var res NestedClusterType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_device.go b/netbox/models/nested_device.go new file mode 100644 index 0000000000000000000000000000000000000000..d0039dc2a5af37b95b63bf1652d1ce68695caa44 --- /dev/null +++ b/netbox/models/nested_device.go @@ -0,0 +1,81 @@ +// 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" +) + +// NestedDevice Device +// swagger:model NestedDevice +type NestedDevice struct { + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Max Length: 64 + Name string `json:"name,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested device +func (m *NestedDevice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedDevice) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedDevice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedDevice) UnmarshalBinary(b []byte) error { + var res NestedDevice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_device_role.go b/netbox/models/nested_device_role.go new file mode 100644 index 0000000000000000000000000000000000000000..0582d27adada9ceb0b1cf2d6ce216052768563c8 --- /dev/null +++ b/netbox/models/nested_device_role.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedDeviceRole Device role +// swagger:model NestedDeviceRole +type NestedDeviceRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested device role +func (m *NestedDeviceRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedDeviceRole) 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 *NestedDeviceRole) 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 *NestedDeviceRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedDeviceRole) UnmarshalBinary(b []byte) error { + var res NestedDeviceRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_device_type.go b/netbox/models/nested_device_type.go new file mode 100644 index 0000000000000000000000000000000000000000..8b6e0cf1c80f3a9df989129bfa5052c03e799714 --- /dev/null +++ b/netbox/models/nested_device_type.go @@ -0,0 +1,134 @@ +// 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" +) + +// NestedDeviceType Device type +// swagger:model NestedDeviceType +type NestedDeviceType struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // manufacturer + // Required: true + Manufacturer *NestedManufacturer `json:"manufacturer"` + + // Model + // Required: true + // Max Length: 50 + Model *string `json:"model"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested device type +func (m *NestedDeviceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedDeviceType) 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 *NestedDeviceType) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { + return err + } + + return nil +} + +func (m *NestedDeviceType) 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 *NestedDeviceType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedDeviceType) UnmarshalBinary(b []byte) error { + var res NestedDeviceType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_interface.go b/netbox/models/nested_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..769205b0d23b2741e79731a7bb56821461d8978a --- /dev/null +++ b/netbox/models/nested_interface.go @@ -0,0 +1,78 @@ +// 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" +) + +// NestedInterface Lag +// swagger:model NestedInterface +type NestedInterface struct { + + // 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"` +} + +// Validate validates this nested interface +func (m *NestedInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedInterface) UnmarshalBinary(b []byte) error { + var res NestedInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_ip_address.go b/netbox/models/nested_ip_address.go new file mode 100644 index 0000000000000000000000000000000000000000..a5a086b15b071a8a9a70e483c84f05439a0903ee --- /dev/null +++ b/netbox/models/nested_ip_address.go @@ -0,0 +1,79 @@ +// 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" +) + +// NestedIPAddress Nat inside +// swagger:model NestedIPAddress +type NestedIPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested IP address +func (m *NestedIPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedIPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedIPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedIPAddress) UnmarshalBinary(b []byte) error { + var res NestedIPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_manufacturer.go b/netbox/models/nested_manufacturer.go new file mode 100644 index 0000000000000000000000000000000000000000..3a16e9484648384c6d66789cb05ec9074c479dfb --- /dev/null +++ b/netbox/models/nested_manufacturer.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedManufacturer Manufacturer +// swagger:model NestedManufacturer +type NestedManufacturer struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested manufacturer +func (m *NestedManufacturer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedManufacturer) 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 *NestedManufacturer) 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 *NestedManufacturer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedManufacturer) UnmarshalBinary(b []byte) error { + var res NestedManufacturer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_platform.go b/netbox/models/nested_platform.go new file mode 100644 index 0000000000000000000000000000000000000000..406486dfe6c32b5e495035098e13199a7af5f72d --- /dev/null +++ b/netbox/models/nested_platform.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedPlatform Platform +// swagger:model NestedPlatform +type NestedPlatform struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested platform +func (m *NestedPlatform) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedPlatform) 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 *NestedPlatform) 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 *NestedPlatform) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedPlatform) UnmarshalBinary(b []byte) error { + var res NestedPlatform + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_provider.go b/netbox/models/nested_provider.go new file mode 100644 index 0000000000000000000000000000000000000000..a4bc72f35873d7815df98f35ba37c7a3f62daaf9 --- /dev/null +++ b/netbox/models/nested_provider.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedProvider Provider +// swagger:model NestedProvider +type NestedProvider struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested provider +func (m *NestedProvider) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedProvider) 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 *NestedProvider) 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 *NestedProvider) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedProvider) UnmarshalBinary(b []byte) error { + var res NestedProvider + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_rack.go b/netbox/models/nested_rack.go new file mode 100644 index 0000000000000000000000000000000000000000..9614606d4213c4b7110642414eeff3659632a5fc --- /dev/null +++ b/netbox/models/nested_rack.go @@ -0,0 +1,82 @@ +// 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" +) + +// NestedRack Rack +// swagger:model NestedRack +type NestedRack 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: 50 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested rack +func (m *NestedRack) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRack) 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 +} + +// MarshalBinary interface implementation +func (m *NestedRack) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRack) UnmarshalBinary(b []byte) error { + var res NestedRack + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_rack_group.go b/netbox/models/nested_rack_group.go new file mode 100644 index 0000000000000000000000000000000000000000..67b44bf052860106efd336541fefbf95a84eb6d0 --- /dev/null +++ b/netbox/models/nested_rack_group.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedRackGroup Group +// swagger:model NestedRackGroup +type NestedRackGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested rack group +func (m *NestedRackGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRackGroup) 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 *NestedRackGroup) 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 *NestedRackGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRackGroup) UnmarshalBinary(b []byte) error { + var res NestedRackGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_rack_role.go b/netbox/models/nested_rack_role.go new file mode 100644 index 0000000000000000000000000000000000000000..fd44e67b92cacfb55cd798db5e30490d6a8d1645 --- /dev/null +++ b/netbox/models/nested_rack_role.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedRackRole Role +// swagger:model NestedRackRole +type NestedRackRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested rack role +func (m *NestedRackRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRackRole) 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 *NestedRackRole) 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 *NestedRackRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRackRole) UnmarshalBinary(b []byte) error { + var res NestedRackRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_region.go b/netbox/models/nested_region.go new file mode 100644 index 0000000000000000000000000000000000000000..094c08039ea81e6a03aa2e4c7bc56e74f56bdb51 --- /dev/null +++ b/netbox/models/nested_region.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedRegion Parent +// swagger:model NestedRegion +type NestedRegion struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested region +func (m *NestedRegion) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRegion) 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 *NestedRegion) 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 *NestedRegion) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRegion) UnmarshalBinary(b []byte) error { + var res NestedRegion + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_rir.go b/netbox/models/nested_rir.go new file mode 100644 index 0000000000000000000000000000000000000000..d84b5c81ec0eca2ab475e262f18971c5af4d0a6c --- /dev/null +++ b/netbox/models/nested_rir.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedRIR Rir +// swagger:model NestedRIR +type NestedRIR struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested r i r +func (m *NestedRIR) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRIR) 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 *NestedRIR) 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 *NestedRIR) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRIR) UnmarshalBinary(b []byte) error { + var res NestedRIR + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_role.go b/netbox/models/nested_role.go new file mode 100644 index 0000000000000000000000000000000000000000..fcac16dbc186b72d31e70738c219cf4190da4dc1 --- /dev/null +++ b/netbox/models/nested_role.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedRole Role +// swagger:model NestedRole +type NestedRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested role +func (m *NestedRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedRole) 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 *NestedRole) 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 *NestedRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedRole) UnmarshalBinary(b []byte) error { + var res NestedRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_secret_role.go b/netbox/models/nested_secret_role.go new file mode 100644 index 0000000000000000000000000000000000000000..f54a4b097e84a20581383890d2a14020d79756b8 --- /dev/null +++ b/netbox/models/nested_secret_role.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedSecretRole Role +// swagger:model NestedSecretRole +type NestedSecretRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested secret role +func (m *NestedSecretRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedSecretRole) 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 *NestedSecretRole) 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 *NestedSecretRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedSecretRole) UnmarshalBinary(b []byte) error { + var res NestedSecretRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_site.go b/netbox/models/nested_site.go new file mode 100644 index 0000000000000000000000000000000000000000..f865c5e3aefc380175dad5c6f60290665a318407 --- /dev/null +++ b/netbox/models/nested_site.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedSite Site +// swagger:model NestedSite +type NestedSite struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested site +func (m *NestedSite) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedSite) 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 *NestedSite) 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 *NestedSite) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedSite) UnmarshalBinary(b []byte) error { + var res NestedSite + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_tenant.go b/netbox/models/nested_tenant.go new file mode 100644 index 0000000000000000000000000000000000000000..39d8e7be75770b4ba14fba0333ba8af8d07c4320 --- /dev/null +++ b/netbox/models/nested_tenant.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedTenant Tenant +// swagger:model NestedTenant +type NestedTenant struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested tenant +func (m *NestedTenant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedTenant) 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), 30); err != nil { + return err + } + + return nil +} + +func (m *NestedTenant) 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 *NestedTenant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedTenant) UnmarshalBinary(b []byte) error { + var res NestedTenant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_tenant_group.go b/netbox/models/nested_tenant_group.go new file mode 100644 index 0000000000000000000000000000000000000000..eef0c780def11f80bb180a57b4d552283bc9f6b8 --- /dev/null +++ b/netbox/models/nested_tenant_group.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedTenantGroup Group +// swagger:model NestedTenantGroup +type NestedTenantGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested tenant group +func (m *NestedTenantGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedTenantGroup) 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 *NestedTenantGroup) 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 *NestedTenantGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedTenantGroup) UnmarshalBinary(b []byte) error { + var res NestedTenantGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_user.go b/netbox/models/nested_user.go new file mode 100644 index 0000000000000000000000000000000000000000..f3ca9a3acfc6148687901e213f08a2d56b00122c --- /dev/null +++ b/netbox/models/nested_user.go @@ -0,0 +1,81 @@ +// 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" +) + +// NestedUser User +// swagger:model NestedUser +type NestedUser struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Username + // + // Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + // Required: true + // Max Length: 150 + // Pattern: ^[\w.@+-]+$ + Username *string `json:"username"` +} + +// Validate validates this nested user +func (m *NestedUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUsername(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedUser) validateUsername(formats strfmt.Registry) error { + + if err := validate.Required("username", "body", m.Username); err != nil { + return err + } + + if err := validate.MaxLength("username", "body", string(*m.Username), 150); err != nil { + return err + } + + if err := validate.Pattern("username", "body", string(*m.Username), `^[\w.@+-]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedUser) UnmarshalBinary(b []byte) error { + var res NestedUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_virtual_machine.go b/netbox/models/nested_virtual_machine.go new file mode 100644 index 0000000000000000000000000000000000000000..bc54f7f6295cacbfe7424d39e3481f4886024911 --- /dev/null +++ b/netbox/models/nested_virtual_machine.go @@ -0,0 +1,78 @@ +// 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" +) + +// NestedVirtualMachine Virtual machine +// swagger:model NestedVirtualMachine +type NestedVirtualMachine struct { + + // 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"` +} + +// Validate validates this nested virtual machine +func (m *NestedVirtualMachine) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVirtualMachine) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedVirtualMachine) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVirtualMachine) UnmarshalBinary(b []byte) error { + var res NestedVirtualMachine + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_vlan.go b/netbox/models/nested_vlan.go new file mode 100644 index 0000000000000000000000000000000000000000..7a85e13f40a38ec2f1c25d3d403d4e6de1dc6c5b --- /dev/null +++ b/netbox/models/nested_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" +) + +// NestedVLAN Vlan +// swagger:model NestedVLAN +type NestedVLAN 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 nested v l a n +func (m *NestedVLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVLAN) 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 *NestedVLAN) 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 *NestedVLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVLAN) UnmarshalBinary(b []byte) error { + var res NestedVLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_vlangroup.go b/netbox/models/nested_vlangroup.go new file mode 100644 index 0000000000000000000000000000000000000000..27613616bc682a59843f2732b12cf3f428fea6be --- /dev/null +++ b/netbox/models/nested_vlangroup.go @@ -0,0 +1,106 @@ +// 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" +) + +// NestedVLANGroup Group +// swagger:model NestedVLANGroup +type NestedVLANGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested v l a n group +func (m *NestedVLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVLANGroup) 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 *NestedVLANGroup) 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 *NestedVLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVLANGroup) UnmarshalBinary(b []byte) error { + var res NestedVLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/nested_vrf.go b/netbox/models/nested_vrf.go new file mode 100644 index 0000000000000000000000000000000000000000..0eeafba649b90cd85b45b09917f27cfc8579dcab --- /dev/null +++ b/netbox/models/nested_vrf.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" +) + +// NestedVRF Vrf +// swagger:model NestedVRF +type NestedVRF struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Route distinguisher + // Required: true + // Max Length: 21 + Rd *string `json:"rd"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this nested v r f +func (m *NestedVRF) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRd(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *NestedVRF) 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 *NestedVRF) validateRd(formats strfmt.Registry) error { + + if err := validate.Required("rd", "body", m.Rd); err != nil { + return err + } + + if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *NestedVRF) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *NestedVRF) UnmarshalBinary(b []byte) error { + var res NestedVRF + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/peer_interface.go b/netbox/models/peer_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..72873a0455440b98bada5a4ed7c63637931599e5 --- /dev/null +++ b/netbox/models/peer_interface.go @@ -0,0 +1,222 @@ +// 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" +) + +// PeerInterface Interface a +// swagger:model PeerInterface +type PeerInterface struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // form factor + // Required: true + FormFactor *PeerInterfaceFormFactor `json:"form_factor"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // lag + // Required: true + Lag *NestedInterface `json:"lag"` + + // MAC Address + MacAddress string `json:"mac_address,omitempty"` + + // OOB Management + // + // This interface is used only for out-of-band management + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // MTU + // Maximum: 32767 + // Minimum: 0 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this peer interface +func (m *PeerInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateLag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PeerInterface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *PeerInterface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *PeerInterface) validateFormFactor(formats strfmt.Registry) error { + + if err := validate.Required("form_factor", "body", m.FormFactor); err != nil { + return err + } + + if m.FormFactor != nil { + + if err := m.FormFactor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("form_factor") + } + return err + } + } + + return nil +} + +func (m *PeerInterface) validateLag(formats strfmt.Registry) error { + + if err := validate.Required("lag", "body", m.Lag); err != nil { + return err + } + + if m.Lag != nil { + + if err := m.Lag.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lag") + } + return err + } + } + + return nil +} + +func (m *PeerInterface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *PeerInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PeerInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeerInterface) UnmarshalBinary(b []byte) error { + var res PeerInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/peer_interface_form_factor.go b/netbox/models/peer_interface_form_factor.go new file mode 100644 index 0000000000000000000000000000000000000000..1a6fecd83501754f35355438d485486cc17cefae --- /dev/null +++ b/netbox/models/peer_interface_form_factor.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" +) + +// PeerInterfaceFormFactor Form factor +// swagger:model peerInterfaceFormFactor +type PeerInterfaceFormFactor struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this peer interface form factor +func (m *PeerInterfaceFormFactor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PeerInterfaceFormFactor) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PeerInterfaceFormFactor) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PeerInterfaceFormFactor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PeerInterfaceFormFactor) UnmarshalBinary(b []byte) error { + var res PeerInterfaceFormFactor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/platform.go b/netbox/models/platform.go new file mode 100644 index 0000000000000000000000000000000000000000..fe4b37845d644a960709de70db3bd1f80a1dc8cc --- /dev/null +++ b/netbox/models/platform.go @@ -0,0 +1,179 @@ +// 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" +) + +// Platform platform +// swagger:model Platform +type Platform struct { + + // ID + // Read Only: true + ID int64 `json:"id,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 platform +func (m *Platform) 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 *Platform) 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 *Platform) 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 platformTypeRPCClientPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["juniper-junos","cisco-ios","opengear"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + platformTypeRPCClientPropEnum = append(platformTypeRPCClientPropEnum, v) + } +} + +const ( + // PlatformRPCClientJuniperJunos captures enum value "juniper-junos" + PlatformRPCClientJuniperJunos string = "juniper-junos" + // PlatformRPCClientCiscoIos captures enum value "cisco-ios" + PlatformRPCClientCiscoIos string = "cisco-ios" + // PlatformRPCClientOpengear captures enum value "opengear" + PlatformRPCClientOpengear string = "opengear" +) + +// prop value enum +func (m *Platform) validateRPCClientEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, platformTypeRPCClientPropEnum); err != nil { + return err + } + return nil +} + +func (m *Platform) validateRPCClient(formats strfmt.Registry) error { + + if swag.IsZero(m.RPCClient) { // not required + return nil + } + + // value enum + if err := m.validateRPCClientEnum("rpc_client", "body", m.RPCClient); err != nil { + return err + } + + return nil +} + +func (m *Platform) 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 *Platform) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Platform) UnmarshalBinary(b []byte) error { + var res Platform + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_outlet.go b/netbox/models/power_outlet.go new file mode 100644 index 0000000000000000000000000000000000000000..4c1287b9eaa630cd727eca93ada6ab9d267851a0 --- /dev/null +++ b/netbox/models/power_outlet.go @@ -0,0 +1,106 @@ +// 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" +) + +// PowerOutlet Power outlet +// swagger:model PowerOutlet +type PowerOutlet struct { + + // Connected port + // Read Only: true + ConnectedPort string `json:"connected_port,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this power outlet +func (m *PowerOutlet) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerOutlet) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *PowerOutlet) 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 +} + +// MarshalBinary interface implementation +func (m *PowerOutlet) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerOutlet) UnmarshalBinary(b []byte) error { + var res PowerOutlet + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_outlet_template.go b/netbox/models/power_outlet_template.go new file mode 100644 index 0000000000000000000000000000000000000000..e859e349e011a662880f17d7c20e3b13e2d692ae --- /dev/null +++ b/netbox/models/power_outlet_template.go @@ -0,0 +1,102 @@ +// 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" +) + +// PowerOutletTemplate power outlet template +// swagger:model PowerOutletTemplate +type PowerOutletTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this power outlet template +func (m *PowerOutletTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerOutletTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *PowerOutletTemplate) 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 +} + +// MarshalBinary interface implementation +func (m *PowerOutletTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerOutletTemplate) UnmarshalBinary(b []byte) error { + var res PowerOutletTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_port.go b/netbox/models/power_port.go new file mode 100644 index 0000000000000000000000000000000000000000..33e347a19540c48f445fc1885c8c8a4afd564cc1 --- /dev/null +++ b/netbox/models/power_port.go @@ -0,0 +1,133 @@ +// 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" +) + +// PowerPort power port +// swagger:model PowerPort +type PowerPort struct { + + // Connection status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // power outlet + // Required: true + PowerOutlet *PowerOutlet `json:"power_outlet"` +} + +// Validate validates this power port +func (m *PowerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePowerOutlet(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *PowerPort) 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 *PowerPort) validatePowerOutlet(formats strfmt.Registry) error { + + if err := validate.Required("power_outlet", "body", m.PowerOutlet); err != nil { + return err + } + + if m.PowerOutlet != nil { + + if err := m.PowerOutlet.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("power_outlet") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PowerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerPort) UnmarshalBinary(b []byte) error { + var res PowerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/power_port_template.go b/netbox/models/power_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..5e3e11ba440e694d06c46358fa3f2ef1a11e8282 --- /dev/null +++ b/netbox/models/power_port_template.go @@ -0,0 +1,102 @@ +// 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" +) + +// PowerPortTemplate power port template +// swagger:model PowerPortTemplate +type PowerPortTemplate struct { + + // device type + // Required: true + DeviceType *NestedDeviceType `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this power port template +func (m *PowerPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PowerPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + if m.DeviceType != nil { + + if err := m.DeviceType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device_type") + } + return err + } + } + + return nil +} + +func (m *PowerPortTemplate) 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 +} + +// MarshalBinary interface implementation +func (m *PowerPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PowerPortTemplate) UnmarshalBinary(b []byte) error { + var res PowerPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/prefix.go b/netbox/models/prefix.go new file mode 100644 index 0000000000000000000000000000000000000000..233cb0bdcb35d8dcba4ec3ff95963e143c86ff1f --- /dev/null +++ b/netbox/models/prefix.go @@ -0,0 +1,273 @@ +// 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" +) + +// Prefix prefix +// swagger:model Prefix +type Prefix struct { + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Is a pool + // + // All IP addresses within this prefix are considered usable + IsPool bool `json:"is_pool,omitempty"` + + // Prefix + // + // IPv4 or IPv6 network with mask + // Required: true + Prefix *string `json:"prefix"` + + // role + // Required: true + Role *NestedRole `json:"role"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // status + // Required: true + Status *PrefixStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // vlan + // Required: true + Vlan *NestedVLAN `json:"vlan"` + + // vrf + // Required: true + Vrf *NestedVRF `json:"vrf"` +} + +// Validate validates this prefix +func (m *Prefix) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVlan(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVrf(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Prefix) 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 *Prefix) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +func (m *Prefix) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *Prefix) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *Prefix) 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 *Prefix) 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 *Prefix) validateVlan(formats strfmt.Registry) error { + + if err := validate.Required("vlan", "body", m.Vlan); err != nil { + return err + } + + if m.Vlan != nil { + + if err := m.Vlan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vlan") + } + return err + } + } + + return nil +} + +func (m *Prefix) validateVrf(formats strfmt.Registry) error { + + if err := validate.Required("vrf", "body", m.Vrf); err != nil { + return err + } + + if m.Vrf != nil { + + if err := m.Vrf.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("vrf") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Prefix) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Prefix) UnmarshalBinary(b []byte) error { + var res Prefix + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/prefix_status.go b/netbox/models/prefix_status.go new file mode 100644 index 0000000000000000000000000000000000000000..8c65d0b90296a0ed26c4fe0f3c2ae1b69e21c2fa --- /dev/null +++ b/netbox/models/prefix_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" +) + +// PrefixStatus Status +// swagger:model prefixStatus +type PrefixStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this prefix status +func (m *PrefixStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PrefixStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *PrefixStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PrefixStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PrefixStatus) UnmarshalBinary(b []byte) error { + var res PrefixStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/provider.go b/netbox/models/provider.go new file mode 100644 index 0000000000000000000000000000000000000000..d64fb5738344af7753371d46ba78352d63fad4ba --- /dev/null +++ b/netbox/models/provider.go @@ -0,0 +1,189 @@ +// 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" +) + +// Provider provider +// swagger:model Provider +type Provider struct { + + // Account number + // Max Length: 30 + Account string `json:"account,omitempty"` + + // Admin contact + AdminContact string `json:"admin_contact,omitempty"` + + // ASN + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn int64 `json:"asn,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // NOC contact + NocContact string `json:"noc_contact,omitempty"` + + // Portal + // Max Length: 200 + PortalURL strfmt.URI `json:"portal_url,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this provider +func (m *Provider) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateAsn(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortalURL(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Provider) validateAccount(formats strfmt.Registry) error { + + if swag.IsZero(m.Account) { // not required + return nil + } + + if err := validate.MaxLength("account", "body", string(m.Account), 30); err != nil { + return err + } + + return nil +} + +func (m *Provider) validateAsn(formats strfmt.Registry) error { + + if swag.IsZero(m.Asn) { // not required + return nil + } + + if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Provider) 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 *Provider) validatePortalURL(formats strfmt.Registry) error { + + if swag.IsZero(m.PortalURL) { // not required + return nil + } + + if err := validate.MaxLength("portal_url", "body", string(m.PortalURL), 200); err != nil { + return err + } + + if err := validate.FormatOf("portal_url", "body", "uri", m.PortalURL.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Provider) 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 *Provider) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Provider) UnmarshalBinary(b []byte) error { + var res Provider + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rack.go b/netbox/models/rack.go new file mode 100644 index 0000000000000000000000000000000000000000..b6d2cd97ddd594c439354c9844571da7c5903742 --- /dev/null +++ b/netbox/models/rack.go @@ -0,0 +1,329 @@ +// 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" +) + +// Rack rack +// swagger:model Rack +type Rack struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Descending units + // + // Units are numbered top-to-bottom + DescUnits bool `json:"desc_units,omitempty"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // Facility ID + // Required: true + // Max Length: 50 + FacilityID *string `json:"facility_id"` + + // group + // Required: true + Group *NestedRackGroup `json:"group"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // role + // Required: true + Role *NestedRackRole `json:"role"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // type + // Required: true + Type *RackType `json:"type"` + + // Height (U) + // Maximum: 100 + // Minimum: 1 + UHeight int64 `json:"u_height,omitempty"` + + // width + // Required: true + Width *RackWidth `json:"width"` +} + +// Validate validates this rack +func (m *Rack) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFacilityID(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWidth(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Rack) validateFacilityID(formats strfmt.Registry) error { + + if err := validate.Required("facility_id", "body", m.FacilityID); err != nil { + return err + } + + if err := validate.MaxLength("facility_id", "body", string(*m.FacilityID), 50); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + if m.Group != nil { + + if err := m.Group.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *Rack) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *Rack) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *Rack) 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 *Rack) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + if m.Type != nil { + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } + return err + } + } + + return nil +} + +func (m *Rack) validateUHeight(formats strfmt.Registry) error { + + if swag.IsZero(m.UHeight) { // not required + return nil + } + + if err := validate.MinimumInt("u_height", "body", int64(m.UHeight), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("u_height", "body", int64(m.UHeight), 100, false); err != nil { + return err + } + + return nil +} + +func (m *Rack) validateWidth(formats strfmt.Registry) error { + + if err := validate.Required("width", "body", m.Width); err != nil { + return err + } + + if m.Width != nil { + + if err := m.Width.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("width") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Rack) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Rack) UnmarshalBinary(b []byte) error { + var res Rack + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rack_group.go b/netbox/models/rack_group.go new file mode 100644 index 0000000000000000000000000000000000000000..8b243db89138d4612ffb0f14356869450b06dc2d --- /dev/null +++ b/netbox/models/rack_group.go @@ -0,0 +1,130 @@ +// 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" +) + +// RackGroup rack group +// swagger:model RackGroup +type RackGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this rack group +func (m *RackGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackGroup) 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 *RackGroup) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *RackGroup) 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 *RackGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackGroup) UnmarshalBinary(b []byte) error { + var res RackGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rack_reservation.go b/netbox/models/rack_reservation.go new file mode 100644 index 0000000000000000000000000000000000000000..7c9096e39a9efb0668eff76c78acaaca123b7ce4 --- /dev/null +++ b/netbox/models/rack_reservation.go @@ -0,0 +1,160 @@ +// 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" + "github.com/go-openapi/validate" +) + +// RackReservation rack reservation +// swagger:model RackReservation +type RackReservation struct { + + // Created + // Read Only: true + Created strfmt.DateTime `json:"created,omitempty"` + + // Description + // Required: true + // Max Length: 100 + Description *string `json:"description"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // rack + // Required: true + Rack *NestedRack `json:"rack"` + + // units + // Required: true + Units []*int64 `json:"units"` + + // User + // Required: true + User *int64 `json:"user"` +} + +// Validate validates this rack reservation +func (m *RackReservation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRack(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUnits(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackReservation) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + if err := validate.MaxLength("description", "body", string(*m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *RackReservation) validateRack(formats strfmt.Registry) error { + + if err := validate.Required("rack", "body", m.Rack); err != nil { + return err + } + + if m.Rack != nil { + + if err := m.Rack.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("rack") + } + return err + } + } + + return nil +} + +func (m *RackReservation) validateUnits(formats strfmt.Registry) error { + + if err := validate.Required("units", "body", m.Units); err != nil { + return err + } + + for i := 0; i < len(m.Units); i++ { + + if swag.IsZero(m.Units[i]) { // not required + continue + } + + if err := validate.MinimumInt("units"+"."+strconv.Itoa(i), "body", int64(*m.Units[i]), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("units"+"."+strconv.Itoa(i), "body", int64(*m.Units[i]), 32767, false); err != nil { + return err + } + + } + + return nil +} + +func (m *RackReservation) validateUser(formats strfmt.Registry) error { + + if err := validate.Required("user", "body", m.User); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackReservation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackReservation) UnmarshalBinary(b []byte) error { + var res RackReservation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rack_role.go b/netbox/models/rack_role.go new file mode 100644 index 0000000000000000000000000000000000000000..0e7af723ba3acc23c70d5875a91e4f2358ca1e20 --- /dev/null +++ b/netbox/models/rack_role.go @@ -0,0 +1,130 @@ +// 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" +) + +// RackRole rack role +// swagger:model RackRole +type RackRole struct { + + // Color + // Required: true + // Max Length: 6 + // Pattern: ^[0-9a-f]{6}$ + Color *string `json:"color"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this rack role +func (m *RackRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateColor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackRole) validateColor(formats strfmt.Registry) error { + + if err := validate.Required("color", "body", m.Color); err != nil { + return err + } + + if err := validate.MaxLength("color", "body", string(*m.Color), 6); err != nil { + return err + } + + if err := validate.Pattern("color", "body", string(*m.Color), `^[0-9a-f]{6}$`); err != nil { + return err + } + + return nil +} + +func (m *RackRole) 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 *RackRole) 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 *RackRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackRole) UnmarshalBinary(b []byte) error { + var res RackRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rack_type.go b/netbox/models/rack_type.go new file mode 100644 index 0000000000000000000000000000000000000000..f678e89e2f53fb467746b749ea5127f1bd93a6b8 --- /dev/null +++ b/netbox/models/rack_type.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" +) + +// RackType Type +// swagger:model rackType +type RackType struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rack type +func (m *RackType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackType) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RackType) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackType) UnmarshalBinary(b []byte) error { + var res RackType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rack_width.go b/netbox/models/rack_width.go new file mode 100644 index 0000000000000000000000000000000000000000..59688a8225f979acb45dea53025d455c4583a684 --- /dev/null +++ b/netbox/models/rack_width.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" +) + +// RackWidth Width +// swagger:model rackWidth +type RackWidth struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this rack width +func (m *RackWidth) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RackWidth) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *RackWidth) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RackWidth) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RackWidth) UnmarshalBinary(b []byte) error { + var res RackWidth + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/region.go b/netbox/models/region.go new file mode 100644 index 0000000000000000000000000000000000000000..710d34db4d0ee24d62cffb479bf4858e24ceb7fd --- /dev/null +++ b/netbox/models/region.go @@ -0,0 +1,130 @@ +// 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" +) + +// Region region +// swagger:model Region +type Region struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // parent + // Required: true + Parent *NestedRegion `json:"parent"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this region +func (m *Region) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateParent(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Region) 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 *Region) validateParent(formats strfmt.Registry) error { + + if err := validate.Required("parent", "body", m.Parent); err != nil { + return err + } + + if m.Parent != nil { + + if err := m.Parent.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent") + } + return err + } + } + + return nil +} + +func (m *Region) 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 *Region) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Region) UnmarshalBinary(b []byte) error { + var res Region + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/rir.go b/netbox/models/rir.go new file mode 100644 index 0000000000000000000000000000000000000000..828a09e40ca4c2c97c627105ccf5e830fabfa5e4 --- /dev/null +++ b/netbox/models/rir.go @@ -0,0 +1,107 @@ +// 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" +) + +// RIR r i r +// swagger:model RIR +type RIR struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Private + // + // IP space managed by this RIR is considered private + IsPrivate bool `json:"is_private,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this r i r +func (m *RIR) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RIR) 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 *RIR) 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 *RIR) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RIR) UnmarshalBinary(b []byte) error { + var res RIR + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/role.go b/netbox/models/role.go new file mode 100644 index 0000000000000000000000000000000000000000..f460318ac0898feeee22855bebb879ed7b4f2626 --- /dev/null +++ b/netbox/models/role.go @@ -0,0 +1,129 @@ +// 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" +) + +// Role role +// swagger:model Role +type Role struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Weight + // Maximum: 32767 + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this role +func (m *Role) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Role) 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 *Role) 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 +} + +func (m *Role) validateWeight(formats strfmt.Registry) error { + + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", int64(*m.Weight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("weight", "body", int64(*m.Weight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Role) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Role) UnmarshalBinary(b []byte) error { + var res Role + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/secret.go b/netbox/models/secret.go new file mode 100644 index 0000000000000000000000000000000000000000..280a1a155faeda11e8c3422eb954dc19418af228 --- /dev/null +++ b/netbox/models/secret.go @@ -0,0 +1,146 @@ +// 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" +) + +// Secret secret +// swagger:model Secret +type Secret struct { + + // Created + // Read Only: true + Created strfmt.Date `json:"created,omitempty"` + + // device + // Required: true + Device *NestedDevice `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 + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Plaintext + // Read Only: true + Plaintext string `json:"plaintext,omitempty"` + + // role + // Required: true + Role *NestedSecretRole `json:"role"` +} + +// Validate validates this secret +func (m *Secret) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Secret) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *Secret) 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), 100); err != nil { + return err + } + + return nil +} + +func (m *Secret) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Secret) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Secret) UnmarshalBinary(b []byte) error { + var res Secret + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/secret_role.go b/netbox/models/secret_role.go new file mode 100644 index 0000000000000000000000000000000000000000..1125515b929b6f6d11925b90b146745244dbfa8b --- /dev/null +++ b/netbox/models/secret_role.go @@ -0,0 +1,102 @@ +// 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" +) + +// SecretRole secret role +// swagger:model SecretRole +type SecretRole struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this secret role +func (m *SecretRole) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecretRole) 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 *SecretRole) 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 *SecretRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SecretRole) UnmarshalBinary(b []byte) error { + var res SecretRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/secrets_secret_roles_list_okbody.go b/netbox/models/secrets_secret_roles_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..34479320d301b1b5181c29b7a24a4ccef80362fb --- /dev/null +++ b/netbox/models/secrets_secret_roles_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" +) + +// SecretsSecretRolesListOKBody secrets secret roles list o k body +// swagger:model secretsSecretRolesListOKBody +type SecretsSecretRolesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results SecretsSecretRolesListOKBodyResults `json:"results"` +} + +// Validate validates this secrets secret roles list o k body +func (m *SecretsSecretRolesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecretsSecretRolesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *SecretsSecretRolesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SecretsSecretRolesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SecretsSecretRolesListOKBody) UnmarshalBinary(b []byte) error { + var res SecretsSecretRolesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/secrets_secret_roles_list_okbody_results.go b/netbox/models/secrets_secret_roles_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..a56d915bd6f45d63bf52eed701c20a28e9956b4a --- /dev/null +++ b/netbox/models/secrets_secret_roles_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" +) + +// SecretsSecretRolesListOKBodyResults secrets secret roles list o k body results +// swagger:model secretsSecretRolesListOKBodyResults +type SecretsSecretRolesListOKBodyResults []*SecretRole + +// Validate validates this secrets secret roles list o k body results +func (m SecretsSecretRolesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/secrets_secrets_list_okbody.go b/netbox/models/secrets_secrets_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..d288f3e4b882b81708b52c2811eb0fcb8c1b6964 --- /dev/null +++ b/netbox/models/secrets_secrets_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" +) + +// SecretsSecretsListOKBody secrets secrets list o k body +// swagger:model secretsSecretsListOKBody +type SecretsSecretsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results SecretsSecretsListOKBodyResults `json:"results"` +} + +// Validate validates this secrets secrets list o k body +func (m *SecretsSecretsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SecretsSecretsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *SecretsSecretsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SecretsSecretsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SecretsSecretsListOKBody) UnmarshalBinary(b []byte) error { + var res SecretsSecretsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/secrets_secrets_list_okbody_results.go b/netbox/models/secrets_secrets_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..737c804e24bcb67fa594d7d2d5203965fa93a6d1 --- /dev/null +++ b/netbox/models/secrets_secrets_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" +) + +// SecretsSecretsListOKBodyResults secrets secrets list o k body results +// swagger:model secretsSecretsListOKBodyResults +type SecretsSecretsListOKBodyResults []*Secret + +// Validate validates this secrets secrets list o k body results +func (m SecretsSecretsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/service.go b/netbox/models/service.go new file mode 100644 index 0000000000000000000000000000000000000000..cf5cae55fba463829ef9586bb3ab58da1f545244 --- /dev/null +++ b/netbox/models/service.go @@ -0,0 +1,233 @@ +// 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" +) + +// Service service +// swagger:model Service +type Service struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // device + // Required: true + Device *NestedDevice `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // ipaddresses + // Required: true + Ipaddresses ServiceIpaddresses `json:"ipaddresses"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Port number + // Required: true + // Maximum: 65535 + // Minimum: 1 + Port *int64 `json:"port"` + + // protocol + // Required: true + Protocol *ServiceProtocol `json:"protocol"` + + // virtual machine + // Required: true + VirtualMachine *NestedVirtualMachine `json:"virtual_machine"` +} + +// Validate validates this service +func (m *Service) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateIpaddresses(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePort(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateProtocol(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVirtualMachine(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Service) 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 *Service) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + if m.Device != nil { + + if err := m.Device.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("device") + } + return err + } + } + + return nil +} + +func (m *Service) validateIpaddresses(formats strfmt.Registry) error { + + if err := validate.Required("ipaddresses", "body", m.Ipaddresses); err != nil { + return err + } + + if err := m.Ipaddresses.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ipaddresses") + } + return err + } + + return nil +} + +func (m *Service) 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), 30); err != nil { + return err + } + + return nil +} + +func (m *Service) validatePort(formats strfmt.Registry) error { + + if err := validate.Required("port", "body", m.Port); err != nil { + return err + } + + if err := validate.MinimumInt("port", "body", int64(*m.Port), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("port", "body", int64(*m.Port), 65535, false); err != nil { + return err + } + + return nil +} + +func (m *Service) validateProtocol(formats strfmt.Registry) error { + + if err := validate.Required("protocol", "body", m.Protocol); err != nil { + return err + } + + if m.Protocol != nil { + + if err := m.Protocol.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("protocol") + } + return err + } + } + + return nil +} + +func (m *Service) validateVirtualMachine(formats strfmt.Registry) error { + + if err := validate.Required("virtual_machine", "body", m.VirtualMachine); err != nil { + return err + } + + if m.VirtualMachine != nil { + + if err := m.VirtualMachine.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("virtual_machine") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Service) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Service) UnmarshalBinary(b []byte) error { + var res Service + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/service_ipaddresses.go b/netbox/models/service_ipaddresses.go new file mode 100644 index 0000000000000000000000000000000000000000..2b804894372910d0cb615a64c6a0b32d783f49a1 --- /dev/null +++ b/netbox/models/service_ipaddresses.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" +) + +// ServiceIpaddresses service ipaddresses +// swagger:model serviceIpaddresses +type ServiceIpaddresses []*NestedIPAddress + +// Validate validates this service ipaddresses +func (m ServiceIpaddresses) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/service_protocol.go b/netbox/models/service_protocol.go new file mode 100644 index 0000000000000000000000000000000000000000..65744c9aa234cc71cb83dbc0307686f862688509 --- /dev/null +++ b/netbox/models/service_protocol.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" +) + +// ServiceProtocol Protocol +// swagger:model serviceProtocol +type ServiceProtocol struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this service protocol +func (m *ServiceProtocol) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceProtocol) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *ServiceProtocol) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceProtocol) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceProtocol) UnmarshalBinary(b []byte) error { + var res ServiceProtocol + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/site.go b/netbox/models/site.go new file mode 100644 index 0000000000000000000000000000000000000000..df60b930d7e3c53acc06a11eada2f718c522ca5a --- /dev/null +++ b/netbox/models/site.go @@ -0,0 +1,347 @@ +// 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" +) + +// Site site +// swagger:model Site +type Site struct { + + // ASN + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn int64 `json:"asn,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Contact E-mail + // Max Length: 254 + ContactEmail strfmt.Email `json:"contact_email,omitempty"` + + // Contact name + // Max Length: 50 + ContactName string `json:"contact_name,omitempty"` + + // Contact phone + // Max Length: 20 + ContactPhone string `json:"contact_phone,omitempty"` + + // Count circuits + // Read Only: true + CountCircuits string `json:"count_circuits,omitempty"` + + // Count devices + // Read Only: true + CountDevices string `json:"count_devices,omitempty"` + + // Count prefixes + // Read Only: true + CountPrefixes string `json:"count_prefixes,omitempty"` + + // Count racks + // Read Only: true + CountRacks string `json:"count_racks,omitempty"` + + // Count vlans + // Read Only: true + CountVlans string `json:"count_vlans,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Facility + // Max Length: 50 + Facility string `json:"facility,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Physical address + // Max Length: 200 + PhysicalAddress string `json:"physical_address,omitempty"` + + // region + // Required: true + Region *NestedRegion `json:"region"` + + // Shipping address + // Max Length: 200 + ShippingAddress string `json:"shipping_address,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` +} + +// Validate validates this site +func (m *Site) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAsn(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactEmail(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactPhone(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFacility(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePhysicalAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRegion(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Site) validateAsn(formats strfmt.Registry) error { + + if swag.IsZero(m.Asn) { // not required + return nil + } + + if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *Site) validateContactEmail(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactEmail) { // not required + return nil + } + + if err := validate.MaxLength("contact_email", "body", string(m.ContactEmail), 254); err != nil { + return err + } + + if err := validate.FormatOf("contact_email", "body", "email", m.ContactEmail.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Site) validateContactName(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactName) { // not required + return nil + } + + if err := validate.MaxLength("contact_name", "body", string(m.ContactName), 50); err != nil { + return err + } + + return nil +} + +func (m *Site) validateContactPhone(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactPhone) { // not required + return nil + } + + if err := validate.MaxLength("contact_phone", "body", string(m.ContactPhone), 20); err != nil { + return err + } + + return nil +} + +func (m *Site) validateFacility(formats strfmt.Registry) error { + + if swag.IsZero(m.Facility) { // not required + return nil + } + + if err := validate.MaxLength("facility", "body", string(m.Facility), 50); err != nil { + return err + } + + return nil +} + +func (m *Site) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *Site) validatePhysicalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.PhysicalAddress) { // not required + return nil + } + + if err := validate.MaxLength("physical_address", "body", string(m.PhysicalAddress), 200); err != nil { + return err + } + + return nil +} + +func (m *Site) validateRegion(formats strfmt.Registry) error { + + if err := validate.Required("region", "body", m.Region); err != nil { + return err + } + + if m.Region != nil { + + if err := m.Region.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("region") + } + return err + } + } + + return nil +} + +func (m *Site) validateShippingAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.ShippingAddress) { // not required + return nil + } + + if err := validate.MaxLength("shipping_address", "body", string(m.ShippingAddress), 200); err != nil { + return err + } + + return nil +} + +func (m *Site) 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 +} + +func (m *Site) 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 +} + +// MarshalBinary interface implementation +func (m *Site) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Site) UnmarshalBinary(b []byte) error { + var res Site + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/tenancy_tenant_groups_list_okbody.go b/netbox/models/tenancy_tenant_groups_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..c6bcf0dd9b8ec6064f6a5bdd1f976c45a2e8e000 --- /dev/null +++ b/netbox/models/tenancy_tenant_groups_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" +) + +// TenancyTenantGroupsListOKBody tenancy tenant groups list o k body +// swagger:model tenancyTenantGroupsListOKBody +type TenancyTenantGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results TenancyTenantGroupsListOKBodyResults `json:"results"` +} + +// Validate validates this tenancy tenant groups list o k body +func (m *TenancyTenantGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenancyTenantGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *TenancyTenantGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TenancyTenantGroupsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenancyTenantGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyTenantGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/tenancy_tenant_groups_list_okbody_results.go b/netbox/models/tenancy_tenant_groups_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..4a8e3a2617934213638ca4f8db47362fc8ada8d2 --- /dev/null +++ b/netbox/models/tenancy_tenant_groups_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" +) + +// TenancyTenantGroupsListOKBodyResults tenancy tenant groups list o k body results +// swagger:model tenancyTenantGroupsListOKBodyResults +type TenancyTenantGroupsListOKBodyResults []*TenantGroup + +// Validate validates this tenancy tenant groups list o k body results +func (m TenancyTenantGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/tenancy_tenants_list_okbody.go b/netbox/models/tenancy_tenants_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..19ba0d28f9275d258eddb45c146055753027af05 --- /dev/null +++ b/netbox/models/tenancy_tenants_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" +) + +// TenancyTenantsListOKBody tenancy tenants list o k body +// swagger:model tenancyTenantsListOKBody +type TenancyTenantsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results TenancyTenantsListOKBodyResults `json:"results"` +} + +// Validate validates this tenancy tenants list o k body +func (m *TenancyTenantsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenancyTenantsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *TenancyTenantsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TenancyTenantsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenancyTenantsListOKBody) UnmarshalBinary(b []byte) error { + var res TenancyTenantsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/tenancy_tenants_list_okbody_results.go b/netbox/models/tenancy_tenants_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..3c29b1751243477577c7567062e5d189ac69aeef --- /dev/null +++ b/netbox/models/tenancy_tenants_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" +) + +// TenancyTenantsListOKBodyResults tenancy tenants list o k body results +// swagger:model tenancyTenantsListOKBodyResults +type TenancyTenantsListOKBodyResults []*Tenant + +// Validate validates this tenancy tenants list o k body results +func (m TenancyTenantsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/tenant.go b/netbox/models/tenant.go new file mode 100644 index 0000000000000000000000000000000000000000..20dea52b7b1cf5ab670166eb97f9e46ec72dac6d --- /dev/null +++ b/netbox/models/tenant.go @@ -0,0 +1,160 @@ +// 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" +) + +// Tenant tenant +// swagger:model Tenant +type Tenant struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // + // Long-form name (optional) + // Max Length: 100 + Description string `json:"description,omitempty"` + + // group + // Required: true + Group *NestedTenantGroup `json:"group"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this tenant +func (m *Tenant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(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 *Tenant) 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 *Tenant) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + if m.Group != nil { + + if err := m.Group.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *Tenant) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { + return err + } + + return nil +} + +func (m *Tenant) 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 *Tenant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Tenant) UnmarshalBinary(b []byte) error { + var res Tenant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/tenant_group.go b/netbox/models/tenant_group.go new file mode 100644 index 0000000000000000000000000000000000000000..185858eeedb3cd3c942dfb9ffbdc49d88b36a29b --- /dev/null +++ b/netbox/models/tenant_group.go @@ -0,0 +1,102 @@ +// 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" +) + +// TenantGroup tenant group +// swagger:model TenantGroup +type TenantGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this tenant group +func (m *TenantGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TenantGroup) 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 *TenantGroup) 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 *TenantGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TenantGroup) UnmarshalBinary(b []byte) error { + var res TenantGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/topology_map.go b/netbox/models/topology_map.go new file mode 100644 index 0000000000000000000000000000000000000000..8c1b87d78f1959dcac1655f1c696a43617d99171 --- /dev/null +++ b/netbox/models/topology_map.go @@ -0,0 +1,172 @@ +// 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" +) + +// TopologyMap topology map +// swagger:model TopologyMap +type TopologyMap struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device patterns + // + // Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined. + // Required: true + DevicePatterns *string `json:"device_patterns"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this topology map +func (m *TopologyMap) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevicePatterns(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TopologyMap) 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 *TopologyMap) validateDevicePatterns(formats strfmt.Registry) error { + + if err := validate.Required("device_patterns", "body", m.DevicePatterns); err != nil { + return err + } + + return nil +} + +func (m *TopologyMap) 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 *TopologyMap) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *TopologyMap) 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 *TopologyMap) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TopologyMap) UnmarshalBinary(b []byte) error { + var res TopologyMap + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/user_action.go b/netbox/models/user_action.go new file mode 100644 index 0000000000000000000000000000000000000000..b95559b970fb8ec13a351a26be20624b654e182c --- /dev/null +++ b/netbox/models/user_action.go @@ -0,0 +1,114 @@ +// 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" +) + +// UserAction user action +// swagger:model UserAction +type UserAction struct { + + // action + // Required: true + Action *UserActionAction `json:"action"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Message + Message string `json:"message,omitempty"` + + // Time + // Read Only: true + Time strfmt.DateTime `json:"time,omitempty"` + + // user + // Required: true + User *NestedUser `json:"user"` +} + +// Validate validates this user action +func (m *UserAction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAction(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserAction) validateAction(formats strfmt.Registry) error { + + if err := validate.Required("action", "body", m.Action); err != nil { + return err + } + + if m.Action != nil { + + if err := m.Action.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("action") + } + return err + } + } + + return nil +} + +func (m *UserAction) validateUser(formats strfmt.Registry) error { + + if err := validate.Required("user", "body", m.User); err != nil { + return err + } + + if m.User != nil { + + if err := m.User.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("user") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UserAction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserAction) UnmarshalBinary(b []byte) error { + var res UserAction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/user_action_action.go b/netbox/models/user_action_action.go new file mode 100644 index 0000000000000000000000000000000000000000..df0423861feb40bb3989f1236a49b78cd2e1fc97 --- /dev/null +++ b/netbox/models/user_action_action.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" +) + +// UserActionAction Action +// swagger:model userActionAction +type UserActionAction struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this user action action +func (m *UserActionAction) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UserActionAction) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *UserActionAction) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UserActionAction) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserActionAction) UnmarshalBinary(b []byte) error { + var res UserActionAction + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtual_machine.go b/netbox/models/virtual_machine.go new file mode 100644 index 0000000000000000000000000000000000000000..2b7e7ccf95559185f3ba1fc6f393bcdd2b8a5307 --- /dev/null +++ b/netbox/models/virtual_machine.go @@ -0,0 +1,385 @@ +// 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" +) + +// VirtualMachine virtual machine +// swagger:model VirtualMachine +type VirtualMachine struct { + + // cluster + // Required: true + Cluster *NestedCluster `json:"cluster"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Disk (GB) + // Maximum: 2.147483647e+09 + // Minimum: 0 + Disk *int64 `json:"disk,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Memory (MB) + // Maximum: 2.147483647e+09 + // Minimum: 0 + Memory *int64 `json:"memory,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // platform + // Required: true + Platform *NestedPlatform `json:"platform"` + + // primary ip + // Required: true + PrimaryIP *VirtualMachineIPAddress `json:"primary_ip"` + + // primary ip4 + // Required: true + PrimaryIp4 *VirtualMachineIPAddress `json:"primary_ip4"` + + // primary ip6 + // Required: true + PrimaryIp6 *VirtualMachineIPAddress `json:"primary_ip6"` + + // role + // Required: true + Role *NestedDeviceRole `json:"role"` + + // status + // Required: true + Status *VirtualMachineStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // VCPUs + // Maximum: 32767 + // Minimum: 0 + Vcpus *int64 `json:"vcpus,omitempty"` +} + +// Validate validates this virtual machine +func (m *VirtualMachine) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDisk(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMemory(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePlatform(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIP(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIp4(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrimaryIp6(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVcpus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachine) validateCluster(formats strfmt.Registry) error { + + if err := validate.Required("cluster", "body", m.Cluster); err != nil { + return err + } + + if m.Cluster != nil { + + if err := m.Cluster.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("cluster") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validateDisk(formats strfmt.Registry) error { + + if swag.IsZero(m.Disk) { // not required + return nil + } + + if err := validate.MinimumInt("disk", "body", int64(*m.Disk), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("disk", "body", int64(*m.Disk), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachine) validateMemory(formats strfmt.Registry) error { + + if swag.IsZero(m.Memory) { // not required + return nil + } + + if err := validate.MinimumInt("memory", "body", int64(*m.Memory), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("memory", "body", int64(*m.Memory), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachine) 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 *VirtualMachine) validatePlatform(formats strfmt.Registry) error { + + if err := validate.Required("platform", "body", m.Platform); err != nil { + return err + } + + if m.Platform != nil { + + if err := m.Platform.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("platform") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validatePrimaryIP(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip", "body", m.PrimaryIP); err != nil { + return err + } + + if m.PrimaryIP != nil { + + if err := m.PrimaryIP.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validatePrimaryIp4(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip4", "body", m.PrimaryIp4); err != nil { + return err + } + + if m.PrimaryIp4 != nil { + + if err := m.PrimaryIp4.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip4") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validatePrimaryIp6(formats strfmt.Registry) error { + + if err := validate.Required("primary_ip6", "body", m.PrimaryIp6); err != nil { + return err + } + + if m.PrimaryIp6 != nil { + + if err := m.PrimaryIp6.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("primary_ip6") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *VirtualMachine) 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 *VirtualMachine) 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 *VirtualMachine) validateVcpus(formats strfmt.Registry) error { + + if swag.IsZero(m.Vcpus) { // not required + return nil + } + + if err := validate.MinimumInt("vcpus", "body", int64(*m.Vcpus), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vcpus", "body", int64(*m.Vcpus), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachine) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachine) UnmarshalBinary(b []byte) error { + var res VirtualMachine + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtual_machine_ip_address.go b/netbox/models/virtual_machine_ip_address.go new file mode 100644 index 0000000000000000000000000000000000000000..d14c507539a333c7b3c1ee09e9a8af94f7232430 --- /dev/null +++ b/netbox/models/virtual_machine_ip_address.go @@ -0,0 +1,79 @@ +// 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" +) + +// VirtualMachineIPAddress Primary ip +// swagger:model VirtualMachineIPAddress +type VirtualMachineIPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Family + // Read Only: true + Family int64 `json:"family,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Url + // Read Only: true + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this virtual machine IP address +func (m *VirtualMachineIPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachineIPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachineIPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachineIPAddress) UnmarshalBinary(b []byte) error { + var res VirtualMachineIPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtual_machine_status.go b/netbox/models/virtual_machine_status.go new file mode 100644 index 0000000000000000000000000000000000000000..0d623308fd95195c75b41768a1a49b5af0638d4e --- /dev/null +++ b/netbox/models/virtual_machine_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" +) + +// VirtualMachineStatus Status +// swagger:model virtualMachineStatus +type VirtualMachineStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this virtual machine status +func (m *VirtualMachineStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualMachineStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *VirtualMachineStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualMachineStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualMachineStatus) UnmarshalBinary(b []byte) error { + var res VirtualMachineStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtualization_cluster_groups_list_okbody.go b/netbox/models/virtualization_cluster_groups_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..eb9cd7adfb392925d9f10df191f370d0442e72a8 --- /dev/null +++ b/netbox/models/virtualization_cluster_groups_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" +) + +// VirtualizationClusterGroupsListOKBody virtualization cluster groups list o k body +// swagger:model virtualizationClusterGroupsListOKBody +type VirtualizationClusterGroupsListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationClusterGroupsListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization cluster groups list o k body +func (m *VirtualizationClusterGroupsListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationClusterGroupsListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationClusterGroupsListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationClusterGroupsListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationClusterGroupsListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClusterGroupsListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtualization_cluster_groups_list_okbody_results.go b/netbox/models/virtualization_cluster_groups_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..c23462a7961543713f64483588910b68ee34ba5b --- /dev/null +++ b/netbox/models/virtualization_cluster_groups_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" +) + +// VirtualizationClusterGroupsListOKBodyResults virtualization cluster groups list o k body results +// swagger:model virtualizationClusterGroupsListOKBodyResults +type VirtualizationClusterGroupsListOKBodyResults []*ClusterGroup + +// Validate validates this virtualization cluster groups list o k body results +func (m VirtualizationClusterGroupsListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/virtualization_cluster_types_list_okbody.go b/netbox/models/virtualization_cluster_types_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..7f80ccdd3428ec5894168095f9d7417658c742d6 --- /dev/null +++ b/netbox/models/virtualization_cluster_types_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" +) + +// VirtualizationClusterTypesListOKBody virtualization cluster types list o k body +// swagger:model virtualizationClusterTypesListOKBody +type VirtualizationClusterTypesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationClusterTypesListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization cluster types list o k body +func (m *VirtualizationClusterTypesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationClusterTypesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationClusterTypesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationClusterTypesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationClusterTypesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClusterTypesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtualization_cluster_types_list_okbody_results.go b/netbox/models/virtualization_cluster_types_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..b3f22d681e11f9c7cc4bf095afa3635c40650cd0 --- /dev/null +++ b/netbox/models/virtualization_cluster_types_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" +) + +// VirtualizationClusterTypesListOKBodyResults virtualization cluster types list o k body results +// swagger:model virtualizationClusterTypesListOKBodyResults +type VirtualizationClusterTypesListOKBodyResults []*ClusterType + +// Validate validates this virtualization cluster types list o k body results +func (m VirtualizationClusterTypesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/virtualization_clusters_list_okbody.go b/netbox/models/virtualization_clusters_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..ca88e587804b18eca8da7428367b2e1e80cc3198 --- /dev/null +++ b/netbox/models/virtualization_clusters_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" +) + +// VirtualizationClustersListOKBody virtualization clusters list o k body +// swagger:model virtualizationClustersListOKBody +type VirtualizationClustersListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationClustersListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization clusters list o k body +func (m *VirtualizationClustersListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationClustersListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationClustersListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationClustersListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationClustersListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationClustersListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtualization_clusters_list_okbody_results.go b/netbox/models/virtualization_clusters_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..681ee4a11507eaef42d67a8dca77840989630d46 --- /dev/null +++ b/netbox/models/virtualization_clusters_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" +) + +// VirtualizationClustersListOKBodyResults virtualization clusters list o k body results +// swagger:model virtualizationClustersListOKBodyResults +type VirtualizationClustersListOKBodyResults []*Cluster + +// Validate validates this virtualization clusters list o k body results +func (m VirtualizationClustersListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/virtualization_interfaces_list_okbody.go b/netbox/models/virtualization_interfaces_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..8080f9e01f922f95b9cf8a2d2de3b256412ab1ec --- /dev/null +++ b/netbox/models/virtualization_interfaces_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" +) + +// VirtualizationInterfacesListOKBody virtualization interfaces list o k body +// swagger:model virtualizationInterfacesListOKBody +type VirtualizationInterfacesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationInterfacesListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization interfaces list o k body +func (m *VirtualizationInterfacesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationInterfacesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationInterfacesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationInterfacesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationInterfacesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationInterfacesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtualization_interfaces_list_okbody_results.go b/netbox/models/virtualization_interfaces_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..1503f49126d008179d4896e27206bf2c75749e24 --- /dev/null +++ b/netbox/models/virtualization_interfaces_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" +) + +// VirtualizationInterfacesListOKBodyResults virtualization interfaces list o k body results +// swagger:model virtualizationInterfacesListOKBodyResults +type VirtualizationInterfacesListOKBodyResults []*Interface + +// Validate validates this virtualization interfaces list o k body results +func (m VirtualizationInterfacesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/virtualization_virtual_machines_list_okbody.go b/netbox/models/virtualization_virtual_machines_list_okbody.go new file mode 100644 index 0000000000000000000000000000000000000000..a90d5bca57bff1b2f09ccc4614441553857cc520 --- /dev/null +++ b/netbox/models/virtualization_virtual_machines_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" +) + +// VirtualizationVirtualMachinesListOKBody virtualization virtual machines list o k body +// swagger:model virtualizationVirtualMachinesListOKBody +type VirtualizationVirtualMachinesListOKBody struct { + + // count + // Required: true + Count *int64 `json:"count"` + + // next + Next *strfmt.URI `json:"next,omitempty"` + + // previous + Previous *strfmt.URI `json:"previous,omitempty"` + + // results + // Required: true + Results VirtualizationVirtualMachinesListOKBodyResults `json:"results"` +} + +// Validate validates this virtualization virtual machines list o k body +func (m *VirtualizationVirtualMachinesListOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateResults(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VirtualizationVirtualMachinesListOKBody) validateCount(formats strfmt.Registry) error { + + if err := validate.Required("count", "body", m.Count); err != nil { + return err + } + + return nil +} + +func (m *VirtualizationVirtualMachinesListOKBody) validateResults(formats strfmt.Registry) error { + + if err := validate.Required("results", "body", m.Results); err != nil { + return err + } + + if err := m.Results.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("results") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VirtualizationVirtualMachinesListOKBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VirtualizationVirtualMachinesListOKBody) UnmarshalBinary(b []byte) error { + var res VirtualizationVirtualMachinesListOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/virtualization_virtual_machines_list_okbody_results.go b/netbox/models/virtualization_virtual_machines_list_okbody_results.go new file mode 100644 index 0000000000000000000000000000000000000000..cc12cc5c4fe3d3d14ce3e35a30a0740c1e0d4af7 --- /dev/null +++ b/netbox/models/virtualization_virtual_machines_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" +) + +// VirtualizationVirtualMachinesListOKBodyResults virtualization virtual machines list o k body results +// swagger:model virtualizationVirtualMachinesListOKBodyResults +type VirtualizationVirtualMachinesListOKBodyResults []*VirtualMachine + +// Validate validates this virtualization virtual machines list o k body results +func (m VirtualizationVirtualMachinesListOKBodyResults) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/netbox/models/vlan.go b/netbox/models/vlan.go new file mode 100644 index 0000000000000000000000000000000000000000..042e6386175c43d19ca4044716ab52c45e073f1a --- /dev/null +++ b/netbox/models/vlan.go @@ -0,0 +1,271 @@ +// 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" +) + +// VLAN v l a n +// swagger:model VLAN +type VLAN struct { + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // group + // Required: true + Group *NestedVLANGroup `json:"group"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // role + // Required: true + Role *NestedRole `json:"role"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // status + // Required: true + Status *VLANStatus `json:"status"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` + + // ID + // Required: true + // Maximum: 4094 + // Minimum: 1 + Vid *int64 `json:"vid"` +} + +// Validate validates this v l a n +func (m *VLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateGroup(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(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 *VLAN) 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 *VLAN) validateGroup(formats strfmt.Registry) error { + + if err := validate.Required("group", "body", m.Group); err != nil { + return err + } + + if m.Group != nil { + + if err := m.Group.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("group") + } + return err + } + } + + return nil +} + +func (m *VLAN) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *VLAN) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + if m.Role != nil { + + if err := m.Role.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("role") + } + return err + } + } + + return nil +} + +func (m *VLAN) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *VLAN) 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 *VLAN) 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 *VLAN) 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 *VLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLAN) UnmarshalBinary(b []byte) error { + var res VLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/vlangroup.go b/netbox/models/vlangroup.go new file mode 100644 index 0000000000000000000000000000000000000000..405901b994175bc50dfa2ab8621f2875b92d8e10 --- /dev/null +++ b/netbox/models/vlangroup.go @@ -0,0 +1,130 @@ +// 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" +) + +// VLANGroup v l a n group +// swagger:model VLANGroup +type VLANGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // site + // Required: true + Site *NestedSite `json:"site"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this v l a n group +func (m *VLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VLANGroup) 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 *VLANGroup) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + if m.Site != nil { + + if err := m.Site.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("site") + } + return err + } + } + + return nil +} + +func (m *VLANGroup) 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 *VLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLANGroup) UnmarshalBinary(b []byte) error { + var res VLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/vlanstatus.go b/netbox/models/vlanstatus.go new file mode 100644 index 0000000000000000000000000000000000000000..63f94d458ac83f9ae375051ca90699c7f677d3bc --- /dev/null +++ b/netbox/models/vlanstatus.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" +) + +// VLANStatus Status +// swagger:model vLANStatus +type VLANStatus struct { + + // label + // Required: true + Label *string `json:"label"` + + // value + // Required: true + Value *int64 `json:"value"` +} + +// Validate validates this v l a n status +func (m *VLANStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateValue(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VLANStatus) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *VLANStatus) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *VLANStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLANStatus) UnmarshalBinary(b []byte) error { + var res VLANStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/vrf.go b/netbox/models/vrf.go new file mode 100644 index 0000000000000000000000000000000000000000..8fcafbcf817b88fddca91cc07a16a407cc404ab2 --- /dev/null +++ b/netbox/models/vrf.go @@ -0,0 +1,159 @@ +// 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" +) + +// VRF v r f +// swagger:model VRF +type VRF struct { + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Display name + // Read Only: true + DisplayName string `json:"display_name,omitempty"` + + // Enforce unique space + // + // Prevent duplicate prefixes/IP addresses within this VRF + EnforceUnique bool `json:"enforce_unique,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Route distinguisher + // Required: true + // Max Length: 21 + Rd *string `json:"rd"` + + // tenant + // Required: true + Tenant *NestedTenant `json:"tenant"` +} + +// Validate validates this v r f +func (m *VRF) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRd(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTenant(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VRF) 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 *VRF) 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 *VRF) validateRd(formats strfmt.Registry) error { + + if err := validate.Required("rd", "body", m.Rd); err != nil { + return err + } + + if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { + return err + } + + return nil +} + +func (m *VRF) validateTenant(formats strfmt.Registry) error { + + if err := validate.Required("tenant", "body", m.Tenant); err != nil { + return err + } + + if 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 +} + +// MarshalBinary interface implementation +func (m *VRF) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VRF) UnmarshalBinary(b []byte) error { + var res VRF + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_aggregate.go b/netbox/models/writable_aggregate.go new file mode 100644 index 0000000000000000000000000000000000000000..04a55ad27a3baaed0721b199da8c48bf7dd635c1 --- /dev/null +++ b/netbox/models/writable_aggregate.go @@ -0,0 +1,115 @@ +// 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" +) + +// WritableAggregate writable aggregate +// swagger:model WritableAggregate +type WritableAggregate struct { + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Date added + DateAdded strfmt.Date `json:"date_added,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Prefix + // Required: true + Prefix *string `json:"prefix"` + + // RIR + // Required: true + Rir *int64 `json:"rir"` +} + +// Validate validates this writable aggregate +func (m *WritableAggregate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRir(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableAggregate) 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 *WritableAggregate) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +func (m *WritableAggregate) validateRir(formats strfmt.Registry) error { + + if err := validate.Required("rir", "body", m.Rir); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableAggregate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableAggregate) UnmarshalBinary(b []byte) error { + var res WritableAggregate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_circuit.go b/netbox/models/writable_circuit.go new file mode 100644 index 0000000000000000000000000000000000000000..41f490dc2d522f58dce33a835f0bbf29202e79c2 --- /dev/null +++ b/netbox/models/writable_circuit.go @@ -0,0 +1,171 @@ +// 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" +) + +// WritableCircuit writable circuit +// swagger:model WritableCircuit +type WritableCircuit struct { + + // Circuit ID + // Required: true + // Max Length: 50 + Cid *string `json:"cid"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Commit rate (Kbps) + // Maximum: 2.147483647e+09 + // Minimum: 0 + CommitRate *int64 `json:"commit_rate,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Date installed + InstallDate strfmt.Date `json:"install_date,omitempty"` + + // Provider + // Required: true + Provider *int64 `json:"provider"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // Type + // Required: true + Type *int64 `json:"type"` +} + +// Validate validates this writable circuit +func (m *WritableCircuit) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCid(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateCommitRate(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateProvider(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableCircuit) validateCid(formats strfmt.Registry) error { + + if err := validate.Required("cid", "body", m.Cid); err != nil { + return err + } + + if err := validate.MaxLength("cid", "body", string(*m.Cid), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuit) validateCommitRate(formats strfmt.Registry) error { + + if swag.IsZero(m.CommitRate) { // not required + return nil + } + + if err := validate.MinimumInt("commit_rate", "body", int64(*m.CommitRate), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("commit_rate", "body", int64(*m.CommitRate), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuit) 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 *WritableCircuit) validateProvider(formats strfmt.Registry) error { + + if err := validate.Required("provider", "body", m.Provider); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuit) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableCircuit) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableCircuit) UnmarshalBinary(b []byte) error { + var res WritableCircuit + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_circuit_termination.go b/netbox/models/writable_circuit_termination.go new file mode 100644 index 0000000000000000000000000000000000000000..1421d984c165572b4e47fae524c82d8f18006967 --- /dev/null +++ b/netbox/models/writable_circuit_termination.go @@ -0,0 +1,243 @@ +// 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" +) + +// WritableCircuitTermination writable circuit termination +// swagger:model WritableCircuitTermination +type WritableCircuitTermination struct { + + // Circuit + // Required: true + Circuit *int64 `json:"circuit"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface + Interface int64 `json:"interface,omitempty"` + + // Port speed (Kbps) + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + PortSpeed *int64 `json:"port_speed"` + + // Patch panel/port(s) + // Max Length: 100 + PpInfo string `json:"pp_info,omitempty"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Termination + // Required: true + TermSide *string `json:"term_side"` + + // Upstream speed (Kbps) + // + // Upstream speed, if different from port speed + // Maximum: 2.147483647e+09 + // Minimum: 0 + UpstreamSpeed *int64 `json:"upstream_speed,omitempty"` + + // Cross-connect ID + // Max Length: 50 + XconnectID string `json:"xconnect_id,omitempty"` +} + +// Validate validates this writable circuit termination +func (m *WritableCircuitTermination) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCircuit(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePpInfo(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateTermSide(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUpstreamSpeed(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateXconnectID(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableCircuitTermination) validateCircuit(formats strfmt.Registry) error { + + if err := validate.Required("circuit", "body", m.Circuit); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validatePortSpeed(formats strfmt.Registry) error { + + if err := validate.Required("port_speed", "body", m.PortSpeed); err != nil { + return err + } + + if err := validate.MinimumInt("port_speed", "body", int64(*m.PortSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("port_speed", "body", int64(*m.PortSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validatePpInfo(formats strfmt.Registry) error { + + if swag.IsZero(m.PpInfo) { // not required + return nil + } + + if err := validate.MaxLength("pp_info", "body", string(m.PpInfo), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +var writableCircuitTerminationTypeTermSidePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["A","Z"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableCircuitTerminationTypeTermSidePropEnum = append(writableCircuitTerminationTypeTermSidePropEnum, v) + } +} + +const ( + // WritableCircuitTerminationTermSideA captures enum value "A" + WritableCircuitTerminationTermSideA string = "A" + // WritableCircuitTerminationTermSideZ captures enum value "Z" + WritableCircuitTerminationTermSideZ string = "Z" +) + +// prop value enum +func (m *WritableCircuitTermination) validateTermSideEnum(path, location string, value string) error { + if err := validate.Enum(path, location, value, writableCircuitTerminationTypeTermSidePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableCircuitTermination) validateTermSide(formats strfmt.Registry) error { + + if err := validate.Required("term_side", "body", m.TermSide); err != nil { + return err + } + + // value enum + if err := m.validateTermSideEnum("term_side", "body", *m.TermSide); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validateUpstreamSpeed(formats strfmt.Registry) error { + + if swag.IsZero(m.UpstreamSpeed) { // not required + return nil + } + + if err := validate.MinimumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("upstream_speed", "body", int64(*m.UpstreamSpeed), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableCircuitTermination) validateXconnectID(formats strfmt.Registry) error { + + if swag.IsZero(m.XconnectID) { // not required + return nil + } + + if err := validate.MaxLength("xconnect_id", "body", string(m.XconnectID), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableCircuitTermination) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableCircuitTermination) UnmarshalBinary(b []byte) error { + var res WritableCircuitTermination + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_cluster.go b/netbox/models/writable_cluster.go new file mode 100644 index 0000000000000000000000000000000000000000..e61b2f7dce518615e7364e52fa2ceb7dd4e9bbb7 --- /dev/null +++ b/netbox/models/writable_cluster.go @@ -0,0 +1,104 @@ +// 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" +) + +// WritableCluster writable cluster +// swagger:model WritableCluster +type WritableCluster struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Group + Group int64 `json:"group,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Site + Site int64 `json:"site,omitempty"` + + // Type + // Required: true + Type *int64 `json:"type"` +} + +// Validate validates this writable cluster +func (m *WritableCluster) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableCluster) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableCluster) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableCluster) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableCluster) UnmarshalBinary(b []byte) error { + var res WritableCluster + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_console_port.go b/netbox/models/writable_console_port.go new file mode 100644 index 0000000000000000000000000000000000000000..bc5c34893abd0e897239fccc86e58418d4bab6cb --- /dev/null +++ b/netbox/models/writable_console_port.go @@ -0,0 +1,98 @@ +// 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" +) + +// WritableConsolePort writable console port +// swagger:model WritableConsolePort +type WritableConsolePort struct { + + // Connection status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // Console server port + CsPort int64 `json:"cs_port,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable console port +func (m *WritableConsolePort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableConsolePort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableConsolePort) 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 +} + +// MarshalBinary interface implementation +func (m *WritableConsolePort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConsolePort) UnmarshalBinary(b []byte) error { + var res WritableConsolePort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_console_port_template.go b/netbox/models/writable_console_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..c649d61f08f32d136f32128c353af8adf370616f --- /dev/null +++ b/netbox/models/writable_console_port_template.go @@ -0,0 +1,92 @@ +// 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" +) + +// WritableConsolePortTemplate writable console port template +// swagger:model WritableConsolePortTemplate +type WritableConsolePortTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable console port template +func (m *WritableConsolePortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableConsolePortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritableConsolePortTemplate) 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 +} + +// MarshalBinary interface implementation +func (m *WritableConsolePortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConsolePortTemplate) UnmarshalBinary(b []byte) error { + var res WritableConsolePortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_console_server_port.go b/netbox/models/writable_console_server_port.go new file mode 100644 index 0000000000000000000000000000000000000000..93d25a6fe492c4902e1d51fb2bcd5f3e4e7f9578 --- /dev/null +++ b/netbox/models/writable_console_server_port.go @@ -0,0 +1,92 @@ +// 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" +) + +// WritableConsoleServerPort writable console server port +// swagger:model WritableConsoleServerPort +type WritableConsoleServerPort struct { + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable console server port +func (m *WritableConsoleServerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableConsoleServerPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableConsoleServerPort) 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 +} + +// MarshalBinary interface implementation +func (m *WritableConsoleServerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConsoleServerPort) UnmarshalBinary(b []byte) error { + var res WritableConsoleServerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_console_server_port_template.go b/netbox/models/writable_console_server_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..1c0ed24a5a2cb4a17465b5d9d75d9821d590ad4f --- /dev/null +++ b/netbox/models/writable_console_server_port_template.go @@ -0,0 +1,92 @@ +// 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" +) + +// WritableConsoleServerPortTemplate writable console server port template +// swagger:model WritableConsoleServerPortTemplate +type WritableConsoleServerPortTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable console server port template +func (m *WritableConsoleServerPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableConsoleServerPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritableConsoleServerPortTemplate) 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 +} + +// MarshalBinary interface implementation +func (m *WritableConsoleServerPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableConsoleServerPortTemplate) UnmarshalBinary(b []byte) error { + var res WritableConsoleServerPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_device.go b/netbox/models/writable_device.go new file mode 100644 index 0000000000000000000000000000000000000000..0990a7b24e7ba700a701bde4e21f73a831f8e06b --- /dev/null +++ b/netbox/models/writable_device.go @@ -0,0 +1,312 @@ +// 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" +) + +// WritableDevice writable device +// swagger:model WritableDevice +type WritableDevice struct { + + // Asset tag + // + // A unique tag used to identify this device + // Max Length: 50 + AssetTag string `json:"asset_tag,omitempty"` + + // Cluster + Cluster int64 `json:"cluster,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Device role + // Required: true + DeviceRole *int64 `json:"device_role"` + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // Rack face + Face int64 `json:"face,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Max Length: 64 + Name string `json:"name,omitempty"` + + // Platform + Platform int64 `json:"platform,omitempty"` + + // Position (U) + // + // The lowest-numbered unit occupied by the device + // Maximum: 32767 + // Minimum: 1 + Position int64 `json:"position,omitempty"` + + // Primary IPv4 + PrimaryIp4 int64 `json:"primary_ip4,omitempty"` + + // Primary IPv6 + PrimaryIp6 int64 `json:"primary_ip6,omitempty"` + + // Rack + Rack int64 `json:"rack,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Status + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` +} + +// Validate validates this writable device +func (m *WritableDevice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDeviceRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFace(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePosition(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableDevice) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateDeviceRole(formats strfmt.Registry) error { + + if err := validate.Required("device_role", "body", m.DeviceRole); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +var writableDeviceTypeFacePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,1]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeFacePropEnum = append(writableDeviceTypeFacePropEnum, v) + } +} + +// prop value enum +func (m *WritableDevice) validateFaceEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceTypeFacePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDevice) validateFace(formats strfmt.Registry) error { + + if swag.IsZero(m.Face) { // not required + return nil + } + + // value enum + if err := m.validateFaceEnum("face", "body", m.Face); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 64); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validatePosition(formats strfmt.Registry) error { + + if swag.IsZero(m.Position) { // not required + return nil + } + + if err := validate.MinimumInt("position", "body", int64(m.Position), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("position", "body", int64(m.Position), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDevice) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +var writableDeviceTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,0,2,3,4,5]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeStatusPropEnum = append(writableDeviceTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableDevice) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDevice) validateStatus(formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableDevice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDevice) UnmarshalBinary(b []byte) error { + var res WritableDevice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_device_bay.go b/netbox/models/writable_device_bay.go new file mode 100644 index 0000000000000000000000000000000000000000..29c7e5e1f09e53a0c6a5c6c5da49adb28be05f27 --- /dev/null +++ b/netbox/models/writable_device_bay.go @@ -0,0 +1,95 @@ +// 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" +) + +// WritableDeviceBay writable device bay +// swagger:model WritableDeviceBay +type WritableDeviceBay struct { + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Installed device + InstalledDevice int64 `json:"installed_device,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable device bay +func (m *WritableDeviceBay) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableDeviceBay) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceBay) 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 +} + +// MarshalBinary interface implementation +func (m *WritableDeviceBay) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDeviceBay) UnmarshalBinary(b []byte) error { + var res WritableDeviceBay + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_device_bay_template.go b/netbox/models/writable_device_bay_template.go new file mode 100644 index 0000000000000000000000000000000000000000..ee17eda8e8f0d82065f80a7c445c24591c02a47c --- /dev/null +++ b/netbox/models/writable_device_bay_template.go @@ -0,0 +1,92 @@ +// 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" +) + +// WritableDeviceBayTemplate writable device bay template +// swagger:model WritableDeviceBayTemplate +type WritableDeviceBayTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable device bay template +func (m *WritableDeviceBayTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableDeviceBayTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceBayTemplate) 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 +} + +// MarshalBinary interface implementation +func (m *WritableDeviceBayTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDeviceBayTemplate) UnmarshalBinary(b []byte) error { + var res WritableDeviceBayTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_device_type.go b/netbox/models/writable_device_type.go new file mode 100644 index 0000000000000000000000000000000000000000..9a171133017f1b17ad8c19103ee329388a0696eb --- /dev/null +++ b/netbox/models/writable_device_type.go @@ -0,0 +1,285 @@ +// 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" +) + +// WritableDeviceType writable device type +// swagger:model WritableDeviceType +type WritableDeviceType struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface ordering + InterfaceOrdering int64 `json:"interface_ordering,omitempty"` + + // Is a console server + // + // This type of device has console server ports + IsConsoleServer bool `json:"is_console_server,omitempty"` + + // Is full depth + // + // Device consumes both front and rear rack faces + IsFullDepth bool `json:"is_full_depth,omitempty"` + + // Is a network device + // + // This type of device has network interfaces + IsNetworkDevice bool `json:"is_network_device,omitempty"` + + // Is a PDU + // + // This type of device has power outlets + IsPdu bool `json:"is_pdu,omitempty"` + + // Manufacturer + // Required: true + Manufacturer *int64 `json:"manufacturer"` + + // Model + // Required: true + // Max Length: 50 + Model *string `json:"model"` + + // Part number + // + // Discrete part number (optional) + // Max Length: 50 + PartNumber string `json:"part_number,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Parent/child status + // + // Parent devices house child devices in device bays. Select "None" if this device type is neither a parent nor a child. + SubdeviceRole *bool `json:"subdevice_role,omitempty"` + + // Height (U) + // Maximum: 32767 + // Minimum: 0 + UHeight *int64 `json:"u_height,omitempty"` +} + +// Validate validates this writable device type +func (m *WritableDeviceType) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInterfaceOrdering(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateManufacturer(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePartNumber(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSubdeviceRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var writableDeviceTypeTypeInterfaceOrderingPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeTypeInterfaceOrderingPropEnum = append(writableDeviceTypeTypeInterfaceOrderingPropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceType) validateInterfaceOrderingEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableDeviceTypeTypeInterfaceOrderingPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceType) validateInterfaceOrdering(formats strfmt.Registry) error { + + if swag.IsZero(m.InterfaceOrdering) { // not required + return nil + } + + // value enum + if err := m.validateInterfaceOrderingEnum("interface_ordering", "body", m.InterfaceOrdering); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validateManufacturer(formats strfmt.Registry) error { + + if err := validate.Required("manufacturer", "body", m.Manufacturer); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + if err := validate.MaxLength("model", "body", string(*m.Model), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validatePartNumber(formats strfmt.Registry) error { + + if swag.IsZero(m.PartNumber) { // not required + return nil + } + + if err := validate.MaxLength("part_number", "body", string(m.PartNumber), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) 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 +} + +var writableDeviceTypeTypeSubdeviceRolePropEnum []interface{} + +func init() { + var res []bool + if err := json.Unmarshal([]byte(`[null,true,false]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableDeviceTypeTypeSubdeviceRolePropEnum = append(writableDeviceTypeTypeSubdeviceRolePropEnum, v) + } +} + +// prop value enum +func (m *WritableDeviceType) validateSubdeviceRoleEnum(path, location string, value bool) error { + if err := validate.Enum(path, location, value, writableDeviceTypeTypeSubdeviceRolePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableDeviceType) validateSubdeviceRole(formats strfmt.Registry) error { + + if swag.IsZero(m.SubdeviceRole) { // not required + return nil + } + + // value enum + if err := m.validateSubdeviceRoleEnum("subdevice_role", "body", *m.SubdeviceRole); err != nil { + return err + } + + return nil +} + +func (m *WritableDeviceType) validateUHeight(formats strfmt.Registry) error { + + if swag.IsZero(m.UHeight) { // not required + return nil + } + + if err := validate.MinimumInt("u_height", "body", int64(*m.UHeight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("u_height", "body", int64(*m.UHeight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableDeviceType) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableDeviceType) UnmarshalBinary(b []byte) error { + var res WritableDeviceType + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_graph.go b/netbox/models/writable_graph.go new file mode 100644 index 0000000000000000000000000000000000000000..caebdbcf4ba181fa89c28d38e56f2cd62c9b478a --- /dev/null +++ b/netbox/models/writable_graph.go @@ -0,0 +1,195 @@ +// 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" +) + +// WritableGraph writable graph +// swagger:model WritableGraph +type WritableGraph struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Link URL + // Max Length: 200 + Link strfmt.URI `json:"link,omitempty"` + + // Name + // Required: true + // Max Length: 100 + Name *string `json:"name"` + + // Source URL + // Required: true + // Max Length: 500 + Source *string `json:"source"` + + // Type + // Required: true + Type *int64 `json:"type"` + + // Weight + // Maximum: 32767 + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this writable graph +func (m *WritableGraph) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLink(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSource(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableGraph) validateLink(formats strfmt.Registry) error { + + if swag.IsZero(m.Link) { // not required + return nil + } + + if err := validate.MaxLength("link", "body", string(m.Link), 200); err != nil { + return err + } + + if err := validate.FormatOf("link", "body", "uri", m.Link.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableGraph) 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), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableGraph) validateSource(formats strfmt.Registry) error { + + if err := validate.Required("source", "body", m.Source); err != nil { + return err + } + + if err := validate.MaxLength("source", "body", string(*m.Source), 500); err != nil { + return err + } + + return nil +} + +var writableGraphTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[100,200,300]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableGraphTypeTypePropEnum = append(writableGraphTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableGraph) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableGraphTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableGraph) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +func (m *WritableGraph) validateWeight(formats strfmt.Registry) error { + + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", int64(*m.Weight), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("weight", "body", int64(*m.Weight), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableGraph) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableGraph) UnmarshalBinary(b []byte) error { + var res WritableGraph + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_image_attachment.go b/netbox/models/writable_image_attachment.go new file mode 100644 index 0000000000000000000000000000000000000000..1b210e6940772ae6010122ae3f5608c2c9c3b3f4 --- /dev/null +++ b/netbox/models/writable_image_attachment.go @@ -0,0 +1,142 @@ +// 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" +) + +// WritableImageAttachment writable image attachment +// swagger:model WritableImageAttachment +type WritableImageAttachment struct { + + // Content type + // Required: true + ContentType *string `json:"content_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Image + // Required: true + // Read Only: true + Image strfmt.URI `json:"image"` + + // Name + // Max Length: 50 + Name string `json:"name,omitempty"` + + // Object id + // Required: true + // Maximum: 2.147483647e+09 + // Minimum: 0 + ObjectID *int64 `json:"object_id"` +} + +// Validate validates this writable image attachment +func (m *WritableImageAttachment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContentType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateImage(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateObjectID(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableImageAttachment) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("content_type", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *WritableImageAttachment) validateImage(formats strfmt.Registry) error { + + if err := validate.Required("image", "body", strfmt.URI(m.Image)); err != nil { + return err + } + + if err := validate.FormatOf("image", "body", "uri", m.Image.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableImageAttachment) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableImageAttachment) validateObjectID(formats strfmt.Registry) error { + + if err := validate.Required("object_id", "body", m.ObjectID); err != nil { + return err + } + + if err := validate.MinimumInt("object_id", "body", int64(*m.ObjectID), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("object_id", "body", int64(*m.ObjectID), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableImageAttachment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableImageAttachment) UnmarshalBinary(b []byte) error { + var res WritableImageAttachment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_interface.go b/netbox/models/writable_interface.go new file mode 100644 index 0000000000000000000000000000000000000000..096ebc66fdf431056f607a868ea126bb452d3283 --- /dev/null +++ b/netbox/models/writable_interface.go @@ -0,0 +1,199 @@ +// 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" +) + +// WritableInterface writable interface +// swagger:model WritableInterface +type WritableInterface struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // Enabled + Enabled bool `json:"enabled,omitempty"` + + // Form factor + FormFactor int64 `json:"form_factor,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Parent LAG + Lag int64 `json:"lag,omitempty"` + + // MAC Address + MacAddress string `json:"mac_address,omitempty"` + + // OOB Management + // + // This interface is used only for out-of-band management + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // MTU + // Maximum: 32767 + // Minimum: 0 + Mtu *int64 `json:"mtu,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` +} + +// Validate validates this writable interface +func (m *WritableInterface) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMtu(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableInterface) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableInterface) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +var writableInterfaceTypeFormFactorPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,200,800,1000,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1500,1510,1520,1550,1600,2600,2610,2620,2630,2640,3010,3020,3040,3080,3160,4000,4010,4040,4050,5000,5050,5100,5150,5200,32767]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableInterfaceTypeFormFactorPropEnum = append(writableInterfaceTypeFormFactorPropEnum, v) + } +} + +// prop value enum +func (m *WritableInterface) validateFormFactorEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableInterfaceTypeFormFactorPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableInterface) validateFormFactor(formats strfmt.Registry) error { + + if swag.IsZero(m.FormFactor) { // not required + return nil + } + + // value enum + if err := m.validateFormFactorEnum("form_factor", "body", m.FormFactor); err != nil { + return err + } + + return nil +} + +func (m *WritableInterface) validateMtu(formats strfmt.Registry) error { + + if swag.IsZero(m.Mtu) { // not required + return nil + } + + if err := validate.MinimumInt("mtu", "body", int64(*m.Mtu), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("mtu", "body", int64(*m.Mtu), 32767, false); err != nil { + return err + } + + return nil +} + +func (m *WritableInterface) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableInterface) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableInterface) UnmarshalBinary(b []byte) error { + var res WritableInterface + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_interface_connection.go b/netbox/models/writable_interface_connection.go new file mode 100644 index 0000000000000000000000000000000000000000..1366f1fe3674a470f84215331b2477f4fe5165cb --- /dev/null +++ b/netbox/models/writable_interface_connection.go @@ -0,0 +1,90 @@ +// 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" +) + +// WritableInterfaceConnection writable interface connection +// swagger:model WritableInterfaceConnection +type WritableInterfaceConnection struct { + + // Status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface a + // Required: true + InterfaceA *int64 `json:"interface_a"` + + // Interface b + // Required: true + InterfaceB *int64 `json:"interface_b"` +} + +// Validate validates this writable interface connection +func (m *WritableInterfaceConnection) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateInterfaceA(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateInterfaceB(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableInterfaceConnection) validateInterfaceA(formats strfmt.Registry) error { + + if err := validate.Required("interface_a", "body", m.InterfaceA); err != nil { + return err + } + + return nil +} + +func (m *WritableInterfaceConnection) validateInterfaceB(formats strfmt.Registry) error { + + if err := validate.Required("interface_b", "body", m.InterfaceB); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableInterfaceConnection) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableInterfaceConnection) UnmarshalBinary(b []byte) error { + var res WritableInterfaceConnection + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_interface_template.go b/netbox/models/writable_interface_template.go new file mode 100644 index 0000000000000000000000000000000000000000..d7451ceda7357b53f9d8394d92247271477b65f8 --- /dev/null +++ b/netbox/models/writable_interface_template.go @@ -0,0 +1,139 @@ +// 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" +) + +// WritableInterfaceTemplate writable interface template +// swagger:model WritableInterfaceTemplate +type WritableInterfaceTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // Form factor + FormFactor int64 `json:"form_factor,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Management only + MgmtOnly bool `json:"mgmt_only,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` +} + +// Validate validates this writable interface template +func (m *WritableInterfaceTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFormFactor(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableInterfaceTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +var writableInterfaceTemplateTypeFormFactorPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,200,800,1000,1150,1170,1050,1100,1200,1300,1310,1320,1350,1400,1500,1510,1520,1550,1600,2600,2610,2620,2630,2640,3010,3020,3040,3080,3160,4000,4010,4040,4050,5000,5050,5100,5150,5200,32767]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableInterfaceTemplateTypeFormFactorPropEnum = append(writableInterfaceTemplateTypeFormFactorPropEnum, v) + } +} + +// prop value enum +func (m *WritableInterfaceTemplate) validateFormFactorEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableInterfaceTemplateTypeFormFactorPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableInterfaceTemplate) validateFormFactor(formats strfmt.Registry) error { + + if swag.IsZero(m.FormFactor) { // not required + return nil + } + + // value enum + if err := m.validateFormFactorEnum("form_factor", "body", m.FormFactor); err != nil { + return err + } + + return nil +} + +func (m *WritableInterfaceTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 64); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableInterfaceTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableInterfaceTemplate) UnmarshalBinary(b []byte) error { + var res WritableInterfaceTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_inventory_item.go b/netbox/models/writable_inventory_item.go new file mode 100644 index 0000000000000000000000000000000000000000..da4ff2f7166ec440356dd89f68d4940efc607ea5 --- /dev/null +++ b/netbox/models/writable_inventory_item.go @@ -0,0 +1,191 @@ +// 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" +) + +// WritableInventoryItem writable inventory item +// swagger:model WritableInventoryItem +type WritableInventoryItem struct { + + // Asset tag + // + // A unique tag used to identify this item + // Max Length: 50 + AssetTag string `json:"asset_tag,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // Discovered + Discovered bool `json:"discovered,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Manufacturer + Manufacturer int64 `json:"manufacturer,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Parent + Parent int64 `json:"parent,omitempty"` + + // Part ID + // Max Length: 50 + PartID string `json:"part_id,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` +} + +// Validate validates this writable inventory item +func (m *WritableInventoryItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssetTag(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePartID(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableInventoryItem) validateAssetTag(formats strfmt.Registry) error { + + if swag.IsZero(m.AssetTag) { // not required + return nil + } + + if err := validate.MaxLength("asset_tag", "body", string(m.AssetTag), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableInventoryItem) 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 *WritableInventoryItem) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableInventoryItem) 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 *WritableInventoryItem) validatePartID(formats strfmt.Registry) error { + + if swag.IsZero(m.PartID) { // not required + return nil + } + + if err := validate.MaxLength("part_id", "body", string(m.PartID), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableInventoryItem) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableInventoryItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableInventoryItem) UnmarshalBinary(b []byte) error { + var res WritableInventoryItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_ip_address.go b/netbox/models/writable_ip_address.go new file mode 100644 index 0000000000000000000000000000000000000000..116d8bc85df5d0aaf06fd47da821dec5ee69d6d1 --- /dev/null +++ b/netbox/models/writable_ip_address.go @@ -0,0 +1,200 @@ +// 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" +) + +// WritableIPAddress writable IP address +// swagger:model WritableIPAddress +type WritableIPAddress struct { + + // Address + // + // IPv4 or IPv6 address (with mask) + // Required: true + Address *string `json:"address"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Interface + Interface int64 `json:"interface,omitempty"` + + // NAT (Inside) + // + // The IP for which this address is the "outside" IP + NatInside int64 `json:"nat_inside,omitempty"` + + // Role + // + // The functional role of this IP + Role int64 `json:"role,omitempty"` + + // Status + // + // The operational status of this IP + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // VRF + Vrf int64 `json:"vrf,omitempty"` +} + +// Validate validates this writable IP address +func (m *WritableIPAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableIPAddress) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + return nil +} + +func (m *WritableIPAddress) validateDescription(formats strfmt.Registry) error { + + if swag.IsZero(m.Description) { // not required + return nil + } + + if err := validate.MaxLength("description", "body", string(m.Description), 100); err != nil { + return err + } + + return nil +} + +var writableIpAddressTypeRolePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[10,20,30,40,41,42,43,44]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableIpAddressTypeRolePropEnum = append(writableIpAddressTypeRolePropEnum, v) + } +} + +// prop value enum +func (m *WritableIPAddress) validateRoleEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableIpAddressTypeRolePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableIPAddress) validateRole(formats strfmt.Registry) error { + + if swag.IsZero(m.Role) { // not required + return nil + } + + // value enum + if err := m.validateRoleEnum("role", "body", m.Role); err != nil { + return err + } + + return nil +} + +var writableIpAddressTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2,3,5]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableIpAddressTypeStatusPropEnum = append(writableIpAddressTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableIPAddress) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableIpAddressTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableIPAddress) 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 *WritableIPAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableIPAddress) UnmarshalBinary(b []byte) error { + var res WritableIPAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_power_outlet.go b/netbox/models/writable_power_outlet.go new file mode 100644 index 0000000000000000000000000000000000000000..82cd13fb6c204fd5441a8ec2e48ff9d4a2371326 --- /dev/null +++ b/netbox/models/writable_power_outlet.go @@ -0,0 +1,92 @@ +// 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" +) + +// WritablePowerOutlet writable power outlet +// swagger:model WritablePowerOutlet +type WritablePowerOutlet struct { + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable power outlet +func (m *WritablePowerOutlet) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerOutlet) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerOutlet) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerOutlet) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerOutlet) UnmarshalBinary(b []byte) error { + var res WritablePowerOutlet + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_power_outlet_template.go b/netbox/models/writable_power_outlet_template.go new file mode 100644 index 0000000000000000000000000000000000000000..cf4511fe148b653e7c80bf044d7ff70727dcb27b --- /dev/null +++ b/netbox/models/writable_power_outlet_template.go @@ -0,0 +1,92 @@ +// 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" +) + +// WritablePowerOutletTemplate writable power outlet template +// swagger:model WritablePowerOutletTemplate +type WritablePowerOutletTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable power outlet template +func (m *WritablePowerOutletTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerOutletTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerOutletTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerOutletTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerOutletTemplate) UnmarshalBinary(b []byte) error { + var res WritablePowerOutletTemplate + 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 new file mode 100644 index 0000000000000000000000000000000000000000..1975e9c9d2a8361ea4d958b64991df7843e3a565 --- /dev/null +++ b/netbox/models/writable_power_port.go @@ -0,0 +1,98 @@ +// 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" +) + +// WritablePowerPort writable power port +// swagger:model WritablePowerPort +type WritablePowerPort struct { + + // Connection status + ConnectionStatus bool `json:"connection_status,omitempty"` + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Power outlet + PowerOutlet int64 `json:"power_outlet,omitempty"` +} + +// Validate validates this writable power port +func (m *WritablePowerPort) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerPort) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerPort) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerPort) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerPort) UnmarshalBinary(b []byte) error { + var res WritablePowerPort + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_power_port_template.go b/netbox/models/writable_power_port_template.go new file mode 100644 index 0000000000000000000000000000000000000000..3f959dc21388183804e55f2af753ae4e6d957b85 --- /dev/null +++ b/netbox/models/writable_power_port_template.go @@ -0,0 +1,92 @@ +// 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" +) + +// WritablePowerPortTemplate writable power port template +// swagger:model WritablePowerPortTemplate +type WritablePowerPortTemplate struct { + + // Device type + // Required: true + DeviceType *int64 `json:"device_type"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` +} + +// Validate validates this writable power port template +func (m *WritablePowerPortTemplate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeviceType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePowerPortTemplate) validateDeviceType(formats strfmt.Registry) error { + + if err := validate.Required("device_type", "body", m.DeviceType); err != nil { + return err + } + + return nil +} + +func (m *WritablePowerPortTemplate) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritablePowerPortTemplate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePowerPortTemplate) UnmarshalBinary(b []byte) error { + var res WritablePowerPortTemplate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_prefix.go b/netbox/models/writable_prefix.go new file mode 100644 index 0000000000000000000000000000000000000000..eca4f005b2897681c85529beda6626aabe2ef780 --- /dev/null +++ b/netbox/models/writable_prefix.go @@ -0,0 +1,164 @@ +// 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" +) + +// WritablePrefix writable prefix +// swagger:model WritablePrefix +type WritablePrefix struct { + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Is a pool + // + // All IP addresses within this prefix are considered usable + IsPool bool `json:"is_pool,omitempty"` + + // Prefix + // + // IPv4 or IPv6 network with mask + // Required: true + Prefix *string `json:"prefix"` + + // Role + // + // The primary function of this prefix + Role int64 `json:"role,omitempty"` + + // Site + Site int64 `json:"site,omitempty"` + + // Status + // + // Operational status of this prefix + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // VLAN + Vlan int64 `json:"vlan,omitempty"` + + // VRF + Vrf int64 `json:"vrf,omitempty"` +} + +// Validate validates this writable prefix +func (m *WritablePrefix) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePrefix(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritablePrefix) 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 *WritablePrefix) validatePrefix(formats strfmt.Registry) error { + + if err := validate.Required("prefix", "body", m.Prefix); err != nil { + return err + } + + return nil +} + +var writablePrefixTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[0,1,2,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writablePrefixTypeStatusPropEnum = append(writablePrefixTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritablePrefix) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writablePrefixTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritablePrefix) 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 *WritablePrefix) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritablePrefix) UnmarshalBinary(b []byte) error { + var res WritablePrefix + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_provider.go b/netbox/models/writable_provider.go new file mode 100644 index 0000000000000000000000000000000000000000..86606a722ee04c74c9471f5e4b8dffa55b62ec55 --- /dev/null +++ b/netbox/models/writable_provider.go @@ -0,0 +1,189 @@ +// 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" +) + +// WritableProvider writable provider +// swagger:model WritableProvider +type WritableProvider struct { + + // Account number + // Max Length: 30 + Account string `json:"account,omitempty"` + + // Admin contact + AdminContact string `json:"admin_contact,omitempty"` + + // ASN + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn int64 `json:"asn,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // NOC contact + NocContact string `json:"noc_contact,omitempty"` + + // Portal + // Max Length: 200 + PortalURL strfmt.URI `json:"portal_url,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable provider +func (m *WritableProvider) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAccount(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateAsn(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePortalURL(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableProvider) validateAccount(formats strfmt.Registry) error { + + if swag.IsZero(m.Account) { // not required + return nil + } + + if err := validate.MaxLength("account", "body", string(m.Account), 30); err != nil { + return err + } + + return nil +} + +func (m *WritableProvider) validateAsn(formats strfmt.Registry) error { + + if swag.IsZero(m.Asn) { // not required + return nil + } + + if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableProvider) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableProvider) validatePortalURL(formats strfmt.Registry) error { + + if swag.IsZero(m.PortalURL) { // not required + return nil + } + + if err := validate.MaxLength("portal_url", "body", string(m.PortalURL), 200); err != nil { + return err + } + + if err := validate.FormatOf("portal_url", "body", "uri", m.PortalURL.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableProvider) validateSlug(formats strfmt.Registry) error { + + if err := validate.Required("slug", "body", m.Slug); err != nil { + return err + } + + if err := validate.MaxLength("slug", "body", string(*m.Slug), 50); err != nil { + return err + } + + if err := validate.Pattern("slug", "body", string(*m.Slug), `^[-a-zA-Z0-9_]+$`); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableProvider) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableProvider) UnmarshalBinary(b []byte) error { + var res WritableProvider + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_rack.go b/netbox/models/writable_rack.go new file mode 100644 index 0000000000000000000000000000000000000000..2350a3f75b0a7f774715d32baa0bad423cb0c1dc --- /dev/null +++ b/netbox/models/writable_rack.go @@ -0,0 +1,271 @@ +// 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" +) + +// WritableRack writable rack +// swagger:model WritableRack +type WritableRack struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Descending units + // + // Units are numbered top-to-bottom + DescUnits bool `json:"desc_units,omitempty"` + + // Facility ID + // Max Length: 50 + FacilityID string `json:"facility_id,omitempty"` + + // Group + Group int64 `json:"group,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Role + Role int64 `json:"role,omitempty"` + + // Serial number + // Max Length: 50 + Serial string `json:"serial,omitempty"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // Type + Type int64 `json:"type,omitempty"` + + // Height (U) + // Maximum: 100 + // Minimum: 1 + UHeight int64 `json:"u_height,omitempty"` + + // Width + // + // Rail-to-rail width + Width int64 `json:"width,omitempty"` +} + +// Validate validates this writable rack +func (m *WritableRack) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateFacilityID(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSerial(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUHeight(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateWidth(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRack) validateFacilityID(formats strfmt.Registry) error { + + if swag.IsZero(m.FacilityID) { // not required + return nil + } + + if err := validate.MaxLength("facility_id", "body", string(m.FacilityID), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) 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 *WritableRack) validateSerial(formats strfmt.Registry) error { + + if swag.IsZero(m.Serial) { // not required + return nil + } + + if err := validate.MaxLength("serial", "body", string(m.Serial), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +var writableRackTypeTypePropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[100,200,300,1000,1100]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableRackTypeTypePropEnum = append(writableRackTypeTypePropEnum, v) + } +} + +// prop value enum +func (m *WritableRack) validateTypeEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableRackTypeTypePropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableRack) validateType(formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + // value enum + if err := m.validateTypeEnum("type", "body", m.Type); err != nil { + return err + } + + return nil +} + +func (m *WritableRack) validateUHeight(formats strfmt.Registry) error { + + if swag.IsZero(m.UHeight) { // not required + return nil + } + + if err := validate.MinimumInt("u_height", "body", int64(m.UHeight), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("u_height", "body", int64(m.UHeight), 100, false); err != nil { + return err + } + + return nil +} + +var writableRackTypeWidthPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[19,23]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableRackTypeWidthPropEnum = append(writableRackTypeWidthPropEnum, v) + } +} + +// prop value enum +func (m *WritableRack) validateWidthEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableRackTypeWidthPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableRack) validateWidth(formats strfmt.Registry) error { + + if swag.IsZero(m.Width) { // not required + return nil + } + + // value enum + if err := m.validateWidthEnum("width", "body", m.Width); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableRack) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRack) UnmarshalBinary(b []byte) error { + var res WritableRack + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_rack_group.go b/netbox/models/writable_rack_group.go new file mode 100644 index 0000000000000000000000000000000000000000..ff7e80bbfa183dfb115ee466fb2ec6d4d495acc5 --- /dev/null +++ b/netbox/models/writable_rack_group.go @@ -0,0 +1,120 @@ +// 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" +) + +// WritableRackGroup writable rack group +// swagger:model WritableRackGroup +type WritableRackGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Site + // Required: true + Site *int64 `json:"site"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable rack group +func (m *WritableRackGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSite(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRackGroup) 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 *WritableRackGroup) validateSite(formats strfmt.Registry) error { + + if err := validate.Required("site", "body", m.Site); err != nil { + return err + } + + return nil +} + +func (m *WritableRackGroup) 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 *WritableRackGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRackGroup) UnmarshalBinary(b []byte) error { + var res WritableRackGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_rack_reservation.go b/netbox/models/writable_rack_reservation.go new file mode 100644 index 0000000000000000000000000000000000000000..377dece85d818eaaeb14f7036ab909a243fb8170 --- /dev/null +++ b/netbox/models/writable_rack_reservation.go @@ -0,0 +1,146 @@ +// 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" + "github.com/go-openapi/validate" +) + +// WritableRackReservation writable rack reservation +// swagger:model WritableRackReservation +type WritableRackReservation struct { + + // Description + // Required: true + // Max Length: 100 + Description *string `json:"description"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Rack + // Required: true + Rack *int64 `json:"rack"` + + // units + // Required: true + Units []*int64 `json:"units"` + + // User + // Required: true + User *int64 `json:"user"` +} + +// Validate validates this writable rack reservation +func (m *WritableRackReservation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRack(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUnits(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateUser(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRackReservation) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + if err := validate.MaxLength("description", "body", string(*m.Description), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableRackReservation) validateRack(formats strfmt.Registry) error { + + if err := validate.Required("rack", "body", m.Rack); err != nil { + return err + } + + return nil +} + +func (m *WritableRackReservation) validateUnits(formats strfmt.Registry) error { + + if err := validate.Required("units", "body", m.Units); err != nil { + return err + } + + for i := 0; i < len(m.Units); i++ { + + if swag.IsZero(m.Units[i]) { // not required + continue + } + + if err := validate.MinimumInt("units"+"."+strconv.Itoa(i), "body", int64(*m.Units[i]), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("units"+"."+strconv.Itoa(i), "body", int64(*m.Units[i]), 32767, false); err != nil { + return err + } + + } + + return nil +} + +func (m *WritableRackReservation) validateUser(formats strfmt.Registry) error { + + if err := validate.Required("user", "body", m.User); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableRackReservation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRackReservation) UnmarshalBinary(b []byte) error { + var res WritableRackReservation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_region.go b/netbox/models/writable_region.go new file mode 100644 index 0000000000000000000000000000000000000000..a930ea37f2515f9164ed2b9b444610994d8b3c80 --- /dev/null +++ b/netbox/models/writable_region.go @@ -0,0 +1,105 @@ +// 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" +) + +// WritableRegion writable region +// swagger:model WritableRegion +type WritableRegion struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Parent + Parent int64 `json:"parent,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable region +func (m *WritableRegion) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableRegion) 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 *WritableRegion) 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 *WritableRegion) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableRegion) UnmarshalBinary(b []byte) error { + var res WritableRegion + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_secret.go b/netbox/models/writable_secret.go new file mode 100644 index 0000000000000000000000000000000000000000..f799401e7ed7c8fbc2939bd8bb6ed7cff6c00f31 --- /dev/null +++ b/netbox/models/writable_secret.go @@ -0,0 +1,127 @@ +// 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" +) + +// WritableSecret writable secret +// swagger:model WritableSecret +type WritableSecret struct { + + // Device + // Required: true + Device *int64 `json:"device"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Max Length: 100 + Name string `json:"name,omitempty"` + + // Plaintext + // Required: true + Plaintext *string `json:"plaintext"` + + // Role + // Required: true + Role *int64 `json:"role"` +} + +// Validate validates this writable secret +func (m *WritableSecret) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDevice(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePlaintext(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRole(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableSecret) validateDevice(formats strfmt.Registry) error { + + if err := validate.Required("device", "body", m.Device); err != nil { + return err + } + + return nil +} + +func (m *WritableSecret) validateName(formats strfmt.Registry) error { + + if swag.IsZero(m.Name) { // not required + return nil + } + + if err := validate.MaxLength("name", "body", string(m.Name), 100); err != nil { + return err + } + + return nil +} + +func (m *WritableSecret) validatePlaintext(formats strfmt.Registry) error { + + if err := validate.Required("plaintext", "body", m.Plaintext); err != nil { + return err + } + + return nil +} + +func (m *WritableSecret) validateRole(formats strfmt.Registry) error { + + if err := validate.Required("role", "body", m.Role); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableSecret) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableSecret) UnmarshalBinary(b []byte) error { + var res WritableSecret + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_service.go b/netbox/models/writable_service.go new file mode 100644 index 0000000000000000000000000000000000000000..9a5a2d273fd23bd83db28fa212af529d4d050a70 --- /dev/null +++ b/netbox/models/writable_service.go @@ -0,0 +1,197 @@ +// 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" +) + +// WritableService writable service +// swagger:model WritableService +type WritableService struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device + Device int64 `json:"device,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // ipaddresses + // Unique: true + Ipaddresses []int64 `json:"ipaddresses"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Port number + // Required: true + // Maximum: 65535 + // Minimum: 1 + Port *int64 `json:"port"` + + // Protocol + // Required: true + Protocol *int64 `json:"protocol"` + + // Virtual machine + VirtualMachine int64 `json:"virtual_machine,omitempty"` +} + +// Validate validates this writable service +func (m *WritableService) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateIpaddresses(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePort(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateProtocol(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableService) 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 *WritableService) validateIpaddresses(formats strfmt.Registry) error { + + if swag.IsZero(m.Ipaddresses) { // not required + return nil + } + + if err := validate.UniqueItems("ipaddresses", "body", m.Ipaddresses); err != nil { + return err + } + + return nil +} + +func (m *WritableService) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 30); err != nil { + return err + } + + return nil +} + +func (m *WritableService) validatePort(formats strfmt.Registry) error { + + if err := validate.Required("port", "body", m.Port); err != nil { + return err + } + + if err := validate.MinimumInt("port", "body", int64(*m.Port), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("port", "body", int64(*m.Port), 65535, false); err != nil { + return err + } + + return nil +} + +var writableServiceTypeProtocolPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[6,17]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableServiceTypeProtocolPropEnum = append(writableServiceTypeProtocolPropEnum, v) + } +} + +// prop value enum +func (m *WritableService) validateProtocolEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableServiceTypeProtocolPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableService) validateProtocol(formats strfmt.Registry) error { + + if err := validate.Required("protocol", "body", m.Protocol); err != nil { + return err + } + + // value enum + if err := m.validateProtocolEnum("protocol", "body", *m.Protocol); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableService) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableService) UnmarshalBinary(b []byte) error { + var res WritableService + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_site.go b/netbox/models/writable_site.go new file mode 100644 index 0000000000000000000000000000000000000000..0cf9f53676bd5d9d3cb2dd630a09e89f918f6754 --- /dev/null +++ b/netbox/models/writable_site.go @@ -0,0 +1,277 @@ +// 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" +) + +// WritableSite writable site +// swagger:model WritableSite +type WritableSite struct { + + // ASN + // Maximum: 4.294967295e+09 + // Minimum: 1 + Asn int64 `json:"asn,omitempty"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Contact E-mail + // Max Length: 254 + ContactEmail strfmt.Email `json:"contact_email,omitempty"` + + // Contact name + // Max Length: 50 + ContactName string `json:"contact_name,omitempty"` + + // Contact phone + // Max Length: 20 + ContactPhone string `json:"contact_phone,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Facility + // Max Length: 50 + Facility string `json:"facility,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Physical address + // Max Length: 200 + PhysicalAddress string `json:"physical_address,omitempty"` + + // Region + Region int64 `json:"region,omitempty"` + + // Shipping address + // Max Length: 200 + ShippingAddress string `json:"shipping_address,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` +} + +// Validate validates this writable site +func (m *WritableSite) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAsn(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactEmail(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateContactPhone(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateFacility(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validatePhysicalAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateShippingAddress(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableSite) validateAsn(formats strfmt.Registry) error { + + if swag.IsZero(m.Asn) { // not required + return nil + } + + if err := validate.MinimumInt("asn", "body", int64(m.Asn), 1, false); err != nil { + return err + } + + if err := validate.MaximumInt("asn", "body", int64(m.Asn), 4.294967295e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateContactEmail(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactEmail) { // not required + return nil + } + + if err := validate.MaxLength("contact_email", "body", string(m.ContactEmail), 254); err != nil { + return err + } + + if err := validate.FormatOf("contact_email", "body", "email", m.ContactEmail.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateContactName(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactName) { // not required + return nil + } + + if err := validate.MaxLength("contact_name", "body", string(m.ContactName), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateContactPhone(formats strfmt.Registry) error { + + if swag.IsZero(m.ContactPhone) { // not required + return nil + } + + if err := validate.MaxLength("contact_phone", "body", string(m.ContactPhone), 20); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateFacility(formats strfmt.Registry) error { + + if swag.IsZero(m.Facility) { // not required + return nil + } + + if err := validate.MaxLength("facility", "body", string(m.Facility), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + if err := validate.MaxLength("name", "body", string(*m.Name), 50); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validatePhysicalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.PhysicalAddress) { // not required + return nil + } + + if err := validate.MaxLength("physical_address", "body", string(m.PhysicalAddress), 200); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) validateShippingAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.ShippingAddress) { // not required + return nil + } + + if err := validate.MaxLength("shipping_address", "body", string(m.ShippingAddress), 200); err != nil { + return err + } + + return nil +} + +func (m *WritableSite) 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 *WritableSite) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableSite) UnmarshalBinary(b []byte) error { + var res WritableSite + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_tenant.go b/netbox/models/writable_tenant.go new file mode 100644 index 0000000000000000000000000000000000000000..f5b677f974e1a36e409f887d03e5a399954d95a0 --- /dev/null +++ b/netbox/models/writable_tenant.go @@ -0,0 +1,135 @@ +// 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" +) + +// WritableTenant writable tenant +// swagger:model WritableTenant +type WritableTenant struct { + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // + // Long-form name (optional) + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Group + Group int64 `json:"group,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 30 + Name *string `json:"name"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable tenant +func (m *WritableTenant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableTenant) 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 *WritableTenant) 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), 30); err != nil { + return err + } + + return nil +} + +func (m *WritableTenant) 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 *WritableTenant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableTenant) UnmarshalBinary(b []byte) error { + var res WritableTenant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_topology_map.go b/netbox/models/writable_topology_map.go new file mode 100644 index 0000000000000000000000000000000000000000..42dcaae99e08ef893dbd4014b0205538954ec5b7 --- /dev/null +++ b/netbox/models/writable_topology_map.go @@ -0,0 +1,147 @@ +// 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" +) + +// WritableTopologyMap writable topology map +// swagger:model WritableTopologyMap +type WritableTopologyMap struct { + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Device patterns + // + // Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined. + // Required: true + DevicePatterns *string `json:"device_patterns"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Site + Site int64 `json:"site,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable topology map +func (m *WritableTopologyMap) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDevicePatterns(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableTopologyMap) 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 *WritableTopologyMap) validateDevicePatterns(formats strfmt.Registry) error { + + if err := validate.Required("device_patterns", "body", m.DevicePatterns); err != nil { + return err + } + + return nil +} + +func (m *WritableTopologyMap) 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 *WritableTopologyMap) 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 *WritableTopologyMap) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableTopologyMap) UnmarshalBinary(b []byte) error { + var res WritableTopologyMap + 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 new file mode 100644 index 0000000000000000000000000000000000000000..18c8c9c89958724d4f622f2682f68c4df9ee536e --- /dev/null +++ b/netbox/models/writable_virtual_machine.go @@ -0,0 +1,238 @@ +// 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" +) + +// WritableVirtualMachine writable virtual machine +// swagger:model WritableVirtualMachine +type WritableVirtualMachine struct { + + // Cluster + // Required: true + Cluster *int64 `json:"cluster"` + + // Comments + Comments string `json:"comments,omitempty"` + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Disk (GB) + // Maximum: 2.147483647e+09 + // Minimum: 0 + Disk *int64 `json:"disk,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Memory (MB) + // Maximum: 2.147483647e+09 + // Minimum: 0 + Memory *int64 `json:"memory,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Platform + Platform int64 `json:"platform,omitempty"` + + // Primary IPv4 + PrimaryIp4 int64 `json:"primary_ip4,omitempty"` + + // Primary IPv6 + PrimaryIp6 int64 `json:"primary_ip6,omitempty"` + + // Role + Role int64 `json:"role,omitempty"` + + // Status + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // VCPUs + // Maximum: 32767 + // Minimum: 0 + Vcpus *int64 `json:"vcpus,omitempty"` +} + +// Validate validates this writable virtual machine +func (m *WritableVirtualMachine) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCluster(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateDisk(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateMemory(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVcpus(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVirtualMachine) validateCluster(formats strfmt.Registry) error { + + if err := validate.Required("cluster", "body", m.Cluster); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachine) validateDisk(formats strfmt.Registry) error { + + if swag.IsZero(m.Disk) { // not required + return nil + } + + if err := validate.MinimumInt("disk", "body", int64(*m.Disk), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("disk", "body", int64(*m.Disk), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachine) validateMemory(formats strfmt.Registry) error { + + if swag.IsZero(m.Memory) { // not required + return nil + } + + if err := validate.MinimumInt("memory", "body", int64(*m.Memory), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("memory", "body", int64(*m.Memory), 2.147483647e+09, false); err != nil { + return err + } + + return nil +} + +func (m *WritableVirtualMachine) 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 +} + +var writableVirtualMachineTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,0,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableVirtualMachineTypeStatusPropEnum = append(writableVirtualMachineTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableVirtualMachine) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableVirtualMachineTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableVirtualMachine) 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 *WritableVirtualMachine) validateVcpus(formats strfmt.Registry) error { + + if swag.IsZero(m.Vcpus) { // not required + return nil + } + + if err := validate.MinimumInt("vcpus", "body", int64(*m.Vcpus), 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("vcpus", "body", int64(*m.Vcpus), 32767, false); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVirtualMachine) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVirtualMachine) UnmarshalBinary(b []byte) error { + var res WritableVirtualMachine + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_vlan.go b/netbox/models/writable_vlan.go new file mode 100644 index 0000000000000000000000000000000000000000..a0e2791c14d87d1385dc3ede6a5a35d760d18ed6 --- /dev/null +++ b/netbox/models/writable_vlan.go @@ -0,0 +1,183 @@ +// 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" +) + +// WritableVLAN writable v l a n +// swagger:model WritableVLAN +type WritableVLAN struct { + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Group + Group int64 `json:"group,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 64 + Name *string `json:"name"` + + // Role + Role int64 `json:"role,omitempty"` + + // Site + Site int64 `json:"site,omitempty"` + + // Status + Status int64 `json:"status,omitempty"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` + + // ID + // Required: true + // Maximum: 4094 + // Minimum: 1 + Vid *int64 `json:"vid"` +} + +// Validate validates this writable v l a n +func (m *WritableVLAN) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateVid(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVLAN) 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 *WritableVLAN) 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 +} + +var writableVLANTypeStatusPropEnum []interface{} + +func init() { + var res []int64 + if err := json.Unmarshal([]byte(`[1,2,3]`), &res); err != nil { + panic(err) + } + for _, v := range res { + writableVLANTypeStatusPropEnum = append(writableVLANTypeStatusPropEnum, v) + } +} + +// prop value enum +func (m *WritableVLAN) validateStatusEnum(path, location string, value int64) error { + if err := validate.Enum(path, location, value, writableVLANTypeStatusPropEnum); err != nil { + return err + } + return nil +} + +func (m *WritableVLAN) 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 *WritableVLAN) 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 *WritableVLAN) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVLAN) UnmarshalBinary(b []byte) error { + var res WritableVLAN + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_vlangroup.go b/netbox/models/writable_vlangroup.go new file mode 100644 index 0000000000000000000000000000000000000000..43731356843cd80d7769ba4d440f0e252e64a41a --- /dev/null +++ b/netbox/models/writable_vlangroup.go @@ -0,0 +1,105 @@ +// 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" +) + +// WritableVLANGroup writable v l a n group +// swagger:model WritableVLANGroup +type WritableVLANGroup struct { + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Site + Site int64 `json:"site,omitempty"` + + // Slug + // Required: true + // Max Length: 50 + // Pattern: ^[-a-zA-Z0-9_]+$ + Slug *string `json:"slug"` +} + +// Validate validates this writable v l a n group +func (m *WritableVLANGroup) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateSlug(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVLANGroup) 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 *WritableVLANGroup) 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 *WritableVLANGroup) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVLANGroup) UnmarshalBinary(b []byte) error { + var res WritableVLANGroup + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/models/writable_vrf.go b/netbox/models/writable_vrf.go new file mode 100644 index 0000000000000000000000000000000000000000..d9efce9a80bcca9e064db81bb6fc9b27574df6fd --- /dev/null +++ b/netbox/models/writable_vrf.go @@ -0,0 +1,130 @@ +// 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" +) + +// WritableVRF writable v r f +// swagger:model WritableVRF +type WritableVRF struct { + + // Custom fields + CustomFields interface{} `json:"custom_fields,omitempty"` + + // Description + // Max Length: 100 + Description string `json:"description,omitempty"` + + // Enforce unique space + // + // Prevent duplicate prefixes/IP addresses within this VRF + EnforceUnique bool `json:"enforce_unique,omitempty"` + + // ID + // Read Only: true + ID int64 `json:"id,omitempty"` + + // Name + // Required: true + // Max Length: 50 + Name *string `json:"name"` + + // Route distinguisher + // Required: true + // Max Length: 21 + Rd *string `json:"rd"` + + // Tenant + Tenant int64 `json:"tenant,omitempty"` +} + +// Validate validates this writable v r f +func (m *WritableVRF) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDescription(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + // prop + res = append(res, err) + } + + if err := m.validateRd(formats); err != nil { + // prop + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WritableVRF) 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 *WritableVRF) 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 *WritableVRF) validateRd(formats strfmt.Registry) error { + + if err := validate.Required("rd", "body", m.Rd); err != nil { + return err + } + + if err := validate.MaxLength("rd", "body", string(*m.Rd), 21); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WritableVRF) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WritableVRF) UnmarshalBinary(b []byte) error { + var res WritableVRF + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/netbox/netbox.go b/netbox/netbox.go deleted file mode 100644 index 298eeebb1c66647ec22a54572630d37df9e5eadc..0000000000000000000000000000000000000000 --- a/netbox/netbox.go +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Package netbox provides an API client for DigitalOcean's NetBox IPAM and -// DCIM service. -package netbox - -import "net/url" - -// A Valuer is an object which can generate a url.Values map from itself. -// Valuer implementations are used to generate request URL parameters -// that NetBox can use to filter data. -type Valuer interface { - Values() (url.Values, error) -} - -// A Family is an IP address family, used by NetBox to filter either IPv4 -// or IPv6 addresses. Use its Valid method or compare against the predefined -// Family constants to determine if the contained value is a valid Family. -type Family int - -// Family constants which can be used with NetBox. -const ( - FamilyIPv4 Family = 4 - FamilyIPv6 Family = 6 -) - -// String returns the string representation of a Family. -func (f Family) String() string { - switch f { - case FamilyIPv4: - return "IPv4" - case FamilyIPv6: - return "IPv6" - default: - return "Unknown" - } -} - -// Valid determines if a Family is valid. -func (f Family) Valid() bool { - return f == FamilyIPv4 || f == FamilyIPv6 -} - -// A Status is an operational status of an object. -type Status int - -const ( - // StatusContainer indicates an object is a summary of child prefixes. - StatusContainer Status = 0 - - // StatusActive indicates an object is active and in use. - StatusActive Status = 1 - - // StatusReserved indicates an object is reserved for future use. - StatusReserved Status = 2 - - // StatusDeprecated indicates an object is no longer in use. - StatusDeprecated Status = 3 -) - -// String returns the string representation of a Status. -func (s Status) String() string { - switch s { - case StatusContainer: - return "Container" - case StatusActive: - return "Active" - case StatusReserved: - return "Reserved" - case StatusDeprecated: - return "Deprecated" - default: - return "Unknown" - } -} diff --git a/netbox/netbox_test.go b/netbox/netbox_test.go deleted file mode 100644 index aa4834a8926c39fca175f73b06d5a5c54f7fda96..0000000000000000000000000000000000000000 --- a/netbox/netbox_test.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "encoding/json" - "fmt" - "math" - "net/http" - "net/http/httptest" - "testing" -) - -func TestFamilyValid(t *testing.T) { - var tests = []struct { - desc string - f Family - ok bool - }{ - { - desc: "Test math.MinInt64", - f: math.MinInt64, - }, - { - desc: "Test math.MaxInt64", - f: math.MaxInt64, - }, - { - desc: "Test FamilyIPv4", - f: FamilyIPv4, - ok: true, - }, - { - desc: "Test FamilyIPv6", - f: FamilyIPv6, - ok: true, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - if want, got := tt.ok, tt.f.Valid(); want != got { - t.Fatalf("unexpected Family(%d).Valid():\n- want: %v\n- got: %v", - tt.f, want, got) - } - }) - } -} - -type testSimple struct { - ID int `json:"id"` - Name string `json:"name"` - Slug string `json:"slug"` -} - -// ExampleNewClient demonstrates usage of the Client type. -func ExampleNewClient() { - // Sets up a minimal, mocked NetBox server - addr, done := exampleServer() - defer done() - - // Creates a client configured to use the test server - c, err := NewClient(addr, "", nil) - if err != nil { - panic(fmt.Sprintf("failed to create netbox.Client: %v", err)) - } - - res := testSimple{} - req, err := c.NewRequest(http.MethodGet, "/", nil) - if err != nil { - panic(err) - } - - err = c.Do(req, &res) - if err != nil { - panic(err) - } - - fmt.Printf("%v\n", res) -} - -// exampleServer creates a test HTTP server which returns its address and -// can be closed using the returned closure. -func exampleServer() (string, func()) { - s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - simple := testSimple{ - ID: 1, - Name: "Test 1", - Slug: "test-1", - } - - _ = json.NewEncoder(w).Encode(simple) - })) - - return s.URL, func() { s.Close() } -} diff --git a/netbox/page.go b/netbox/page.go deleted file mode 100644 index 23e2d5d152db0632b7ebd13d9f2ca6296f79491e..0000000000000000000000000000000000000000 --- a/netbox/page.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "encoding/json" - "errors" - "net/http" - "net/url" - "strconv" -) - -// A Page contains all necessary information about the current position -// in a paged result. It is used to walk over all pages from List calls. -type Page struct { - limit int - offset int - done bool - c *Client - data pageData - endpoint string - options Valuer - err error -} - -// NewPage Returns a new Page to walk over List calls. -func NewPage(client *Client, endpoint string, options Valuer) *Page { - return &Page{ - limit: 50, // netbox server default - c: client, - endpoint: endpoint, - options: options, - } -} - -// pageData is the internal representation of a page. -type pageData struct { - Count int `json:"count"` - NextURL string `json:"next"` - PreviousURL string `json:"previous"` - Results json.RawMessage `json:"results"` -} - -// Values implements the Valuer interface. One could pass options -// to a List call. These must be extended by limit and offset to -// get the appropriate next page. -func (p *Page) Values() (url.Values, error) { - if p == nil { - return nil, errors.New("page not defined") - } - v := url.Values{} - if p.options != nil { - opts, err := p.options.Values() - if err != nil { - return nil, err - } - if opts != nil { - v = opts - } - } - v.Set("limit", strconv.Itoa(p.limit)) - v.Set("offset", strconv.Itoa(p.offset)) - - return v, nil -} - -// Next advances to the next page of API results. When Next returns false, -// no more results are available. -func (p *Page) Next() bool { - if p == nil { - return false - } - if p.done { - return false - } - - req, err := p.c.NewRequest(http.MethodGet, p.endpoint, p) - if err != nil { - p.err = err - return false - } - - p.data = pageData{} - err = p.c.Do(req, &p.data) - if err != nil { - p.err = err - return false - } - - if p.data.NextURL == "" { - // We are on the last page, so we still need to return true to - // indicate that there is still data to process. But we set - // p.done to true, so the next "Next()" returns false. - p.done = true - } else { - p.setNextURL(p.data.NextURL) - } - return true - -} - -// setNext sets limit and offset parameter for the next page. -func (p *Page) setNext(limit int, offset int) { - p.limit = limit - p.offset = offset -} - -// setNextURL extracts limit and offset from the nextURL, obtained from the result. -// Under the hood, it uses setNext to finally set those parameters. -func (p *Page) setNextURL(urlStr string) { - nextURL, err := url.Parse(urlStr) - if err != nil { - // We dont want to cancel this run, since there is data, - // but do not want to run into Next - p.setErr(err) - return - } - - query, err := url.ParseQuery(nextURL.RawQuery) - if err != nil { - // Same like above - p.setErr(err) - return - } - - limits := query["limit"] - offsets := query["offset"] - if len(limits) == 0 { - p.setErr(errors.New("no such query parameter limit")) - return - } - if len(offsets) == 0 { - p.setErr(errors.New("no such query parameter offset")) - return - } - - limit, err := strconv.Atoi(limits[0]) - if err != nil { - p.setErr(err) - return - } - - offset, err := strconv.Atoi(offsets[0]) - if err != nil { - p.setErr(err) - return - } - p.setNext(limit, offset) -} - -// Err returns the internal err field. This should be called right after -// the for to get any errors occured during Next() -func (p *Page) Err() error { - return p.err -} - -// setErr sets an internal err field. -func (p *Page) setErr(err error) { - if p.err == nil { - p.err = err - } -} diff --git a/netbox/page_test.go b/netbox/page_test.go deleted file mode 100644 index 0af570f712ab175cbd5be1ac82a711bc40d141d2..0000000000000000000000000000000000000000 --- a/netbox/page_test.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "errors" - "fmt" - "net/http" - "net/url" - "reflect" - "strconv" - "testing" -) - -type testOptions struct{} - -func (t *testOptions) Values() (url.Values, error) { - return url.Values{ - "Hello": []string{"World"}, - "limit": []string{"30"}, - }, nil -} - -func TestPageValues(t *testing.T) { - - var tests = []struct { - desc string - page *Page - want url.Values - err error - }{ - { - desc: "nil page", - page: nil, - want: nil, - err: errors.New("page not defined"), - }, - { - desc: "options nil", - page: NewPage(nil, "/", nil), - want: url.Values{ - "limit": []string{"50"}, - "offset": []string{"0"}, - }, - err: nil, - }, - { - desc: "options set", - page: NewPage(nil, "/", &testOptions{}), - want: url.Values{ - "Hello": []string{"World"}, - "limit": []string{"50"}, - "offset": []string{"0"}, - }, - err: nil, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - res, err := tt.page.Values() - if want, got := tt.err, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unecpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected values:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestNext(t *testing.T) { - var pages = []pageData{ - { - Count: 99, - NextURL: "http://example.com/?limit=50&offset=50", - PreviousURL: "", - Results: []byte("{\"Hello\": \"World\"}"), - }, - { - Count: 99, - NextURL: "", - PreviousURL: "http://example.com/?limit=50&offset=0", - Results: []byte("{\"Hello\": \"World\"}"), - }, - } - - c, done := testClient(t, testHandler(t, http.MethodGet, "/", pages[0])) - defer done() - - p := NewPage(c, "/", nil) - if !p.Next() { - t.Fatal("Expected another page, got none.") - } - p.c, done = testClient(t, testHandler(t, http.MethodGet, "/", pages[1])) - defer done() - if !p.Next() { - t.Fatal("Expected another page, got none.") - } - if p.Next() { - t.Fatal("Did not expect another page, but got one.") - } - if err := p.Err(); err != nil { - t.Fatalf("Did not expect an error: %v", err) - } -} - -func TestPageWithError(t *testing.T) { - c, done := testClient(t, func(w http.ResponseWriter, r *http.Request) { - w.WriteHeader(http.StatusForbidden) - w.Write([]byte("foo")) - }) - defer done() - - p := NewPage(c, "/", &testOptions{}) - if p.Next() { - t.Fatal("Did not expect any page, but got one.") - } - if want, got := errors.New("403 - foo"), p.Err(); !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } -} - -func TestErr(t *testing.T) { - var tests = []struct { - desc string - set error - want error - }{ - { - desc: "Err nil", - set: nil, - want: nil, - }, - { - desc: "Err set", - set: errors.New("This is broken"), - want: errors.New("This is broken"), - }, - } - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - p := NewPage(nil, "/", nil) - p.setErr(tt.set) - if want, got := tt.want, p.Err(); !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestSetNext(t *testing.T) { - p := NewPage(nil, "/", nil) - p.setNext(99, 88) - - if want, got := 99, p.limit; want != got { - t.Fatalf("unexpected limit:\n- want: %v\n- got: %v", want, got) - } - if want, got := 88, p.offset; want != got { - t.Fatalf("unexpected offset:\n- want: %v\n- got: %v", want, got) - } -} - -func TestSetNextURL(t *testing.T) { - var tests = []struct { - desc string - url string - wantOffset int - wantLimit int - err error - }{ - { - desc: "No Params returned", - url: "http://example.com", - wantOffset: 0, - wantLimit: 50, - err: errors.New("no such query parameter limit"), - }, - { - desc: "No Offset returned", - url: "http://example.com?limit=20", - wantOffset: 0, - wantLimit: 50, - err: errors.New("no such query parameter offset"), - }, - { - desc: "Limit not an int", - url: "http://example.com?limit=hello&offset=world", - wantOffset: 0, - wantLimit: 50, - err: &strconv.NumError{ - Func: "Atoi", - Num: "hello", - Err: strconv.ErrSyntax, - }, - }, - { - desc: "Offset not an int", - url: "http://example.com?limit=50&offset=world", - wantOffset: 0, - wantLimit: 50, - err: &strconv.NumError{ - Func: "Atoi", - Num: "world", - Err: strconv.ErrSyntax, - }, - }, - { - desc: "Correct limit and offset", - url: "http://example.com?limit=99&offset=88", - wantOffset: 88, - wantLimit: 99, - err: nil, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - p := NewPage(nil, "/", nil) - p.setNextURL(tt.url) - if want, got := tt.wantOffset, p.offset; want != got { - t.Fatalf("unexpected offset:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.wantLimit, p.limit; want != got { - t.Fatalf("unexpected limit:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.err, p.Err(); reflect.TypeOf(want) != reflect.TypeOf(got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} diff --git a/netbox/tenancy.go b/netbox/tenancy.go deleted file mode 100644 index fb5b3e9b2bd136ae9c404febb76b250b92c2b31d..0000000000000000000000000000000000000000 --- a/netbox/tenancy.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -// A TenancyService is used in a Client to access NetBox's Tenancy API methods. -type TenancyService struct { - c *Client - TenantGroups *TenantGroupsService - Tenants *TenantsService -} - -// NewTenancyService returns a TenancyService initialized with all sub-services. -func NewTenancyService(client *Client) *TenancyService { - return &TenancyService{ - c: client, - TenantGroups: &TenantGroupsService{ - c: client, - }, - Tenants: &TenantsService{ - c: client, - }, - } -} diff --git a/netbox/tenancy_tenant-groups.go b/netbox/tenancy_tenant-groups.go deleted file mode 100644 index 8e1a62ad2a14fbf0aeb041c8f16596f2318da7b4..0000000000000000000000000000000000000000 --- a/netbox/tenancy_tenant-groups.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_functions.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// TenantGroupsService is used in a Client to access NetBox's tenancy/tenant-groups API methods. -type TenantGroupsService struct { - c *Client -} - -// Get retrieves an TenantGroup object from NetBox by its ID. -func (s *TenantGroupsService) Get(id int) (*TenantGroup, error) { - req, err := s.c.NewRequest( - http.MethodGet, - fmt.Sprintf("api/tenancy/tenant-groups/%d/", id), - nil, - ) - if err != nil { - return nil, err - } - - t := new(TenantGroup) - err = s.c.Do(req, t) - if err != nil { - return nil, err - } - return t, nil -} - -// List returns a Page associated with an NetBox API Endpoint. -func (s *TenantGroupsService) List() *Page { - return NewPage(s.c, "api/tenancy/tenant-groups/", nil) -} - -// Extract retrives a list of TenantGroup objects from page. -func (s *TenantGroupsService) Extract(page *Page) ([]*TenantGroup, error) { - if err := page.Err(); err != nil { - return nil, err - } - - var groups []*TenantGroup - if err := json.Unmarshal(page.data.Results, &groups); err != nil { - return nil, err - } - return groups, nil -} - -// Create creates a new TenantGroup object in NetBox and returns the ID of the new object. -func (s *TenantGroupsService) Create(data *TenantGroup) (int, error) { - req, err := s.c.NewJSONRequest(http.MethodPost, "api/tenancy/tenant-groups/", nil, data) - if err != nil { - return 0, err - } - - g := new(TenantGroup) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Update changes an existing TenantGroup object in NetBox, and returns the ID of the new object. -func (s *TenantGroupsService) Update(data *TenantGroup) (int, error) { - req, err := s.c.NewJSONRequest( - http.MethodPatch, - fmt.Sprintf("api/tenancy/tenant-groups/%d/", data.ID), - nil, - data, - ) - if err != nil { - return 0, err - } - - // g is just used to verify correct api result. - // data is not changed, because the g is not the full representation that one would - // get with Get. But if the response was unmarshaled into TenantGroup correctly, - // everything went fine, and we do not need to update data. - g := new(TenantGroup) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Delete deletes an existing TenantGroup object from NetBox. -func (s *TenantGroupsService) Delete(data *TenantGroup) error { - req, err := s.c.NewRequest( - http.MethodDelete, - fmt.Sprintf("api/tenancy/tenant-groups/%d/", data.ID), - nil, - ) - if err != nil { - return err - } - - return s.c.Do(req, nil) -} diff --git a/netbox/tenancy_tenant-groups_basic_test.go b/netbox/tenancy_tenant-groups_basic_test.go deleted file mode 100644 index 3af212483acf34c801bfa17aff6021ec785c876d..0000000000000000000000000000000000000000 --- a/netbox/tenancy_tenant-groups_basic_test.go +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_basic_tests.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "errors" - "fmt" - "net/http" - "reflect" - "testing" -) - -// Using this to override MarshalJSON -// In all cases when posting data to netbox-API, the TenantGroup.MarshalJSON is what you want, -// but not here as a return in testHandler -type serverDataTenantGroup TenantGroup - -func convertToServerDataTenantGroup(data []*TenantGroup) []*serverDataTenantGroup { - dataWant := make([]*serverDataTenantGroup, len(data)) - for i := range data { - tmp := serverDataTenantGroup(*data[i]) - dataWant[i] = &tmp - } - return dataWant -} - -func TestBasicTenantGroupGet(t *testing.T) { - var tests = []struct { - desc string - want *TenantGroup - }{ - { - desc: "Simple TenantGroup", - want: testTenantGroup(1), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - serverData := serverDataTenantGroup(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/tenancy/tenant-groups/1/", &serverData)) - defer done() - - res, err := c.Tenancy.TenantGroups.Get(1) - if err != nil { - t.Fatalf("unexpected error from Client.Tenancy.TenantGroups.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected TenantGroup:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicTenantGroupGet404(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodGet, "/api/tenancy/tenant-groups/1/", &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - http.StatusNotFound)) - defer done() - - res, err := c.Tenancy.TenantGroups.Get(1) - errstr := "404 - Not found." - if want, got := errors.New(errstr), err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error from Client.Tenancy.TenantGroups.Get:\n- want: %v\n- got: %v", want, got) - } - - if res != nil { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", nil, res) - } -} - -func TestBasicListExtractTenantGroup(t *testing.T) { - want := []*TenantGroup{ - testTenantGroup(1), - testTenantGroup(2), - } - serverWant := convertToServerDataTenantGroup(want) - serverData, _ := json.Marshal(serverWant) - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/tenancy/tenant-groups/", &pageData{ - Count: 2, - NextURL: "", - PreviousURL: "", - Results: serverData, - })) - defer done() - - page := c.Tenancy.TenantGroups.List() - - if page == nil { - t.Fatalf("unexpexted result from c.Tenancy.TenantGroups.List.") - } - - got := []*TenantGroup{} - counter := 0 - for page.Next() { - var err error - got, err = c.Tenancy.TenantGroups.Extract(page) - if err != nil { - t.Fatalf("unexpected error from c.Tenancy.TenantGroups.Extract: %v", err) - } - counter = counter + 1 - if counter > 2 { // Safe guard - break - } - } - if counter != 1 { - t.Fatalf("unexpected page count:\n- want: 1\n- got: %d", counter) - } - - if !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", want, got) - } - - if page.Err() != nil { - t.Fatalf("unexpected error from page:\n- want: %v\n- got: %v", want, got) - } -} - -func TestBasicCreateTenantGroup(t *testing.T) { - var tests = []struct { - desc string - data *TenantGroup - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Create with ID 0", - data: testTenantGroupCreate(1), - want: 1, - status: 0, - errstr: "", - serverData: testTenantGroup(1), - }, - { - desc: "Create duplicate", - data: testTenantGroupCreate(1), - want: 0, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"TenantGroupsService with this name already exists.\"]}\n", - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"TenantGroupsService with this name already exists."}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPost, "/api/tenancy/tenant-groups/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.Tenancy.TenantGroups.Create(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected TenantGroup:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicUpdateTenantGroup(t *testing.T) { - var tests = []struct { - desc string - data *TenantGroup - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Update with ID 1", - data: testTenantGroup(1), - want: 1, - serverData: testTenantGroup(1), - status: 0, - errstr: "", - }, - { - desc: "Update not found", - data: testTenantGroup(1), - want: 0, - serverData: &struct { - Detail string - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - { - desc: "Update to duplicate", - data: testTenantGroup(1), - want: 0, - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"TenantGroupsService with this name already exists."}, - }, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"TenantGroupsService with this name already exists.\"]}\n", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPatch, "/api/tenancy/tenant-groups/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.Tenancy.TenantGroups.Update(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected TenantGroup:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicDeleteTenantGroup(t *testing.T) { - var tests = []struct { - desc string - data *TenantGroup - serverData interface{} - status int - errstr string - }{ - { - desc: "Delete ID 1", - data: testTenantGroup(1), - serverData: testTenantGroup(1), - status: 0, - errstr: "", - }, - { - desc: "Delete not Found", - data: testTenantGroup(1), - serverData: &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodDelete, "/api/tenancy/tenant-groups/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - err := c.Tenancy.TenantGroups.Delete(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} diff --git a/netbox/tenancy_tenant-groups_test.go b/netbox/tenancy_tenant-groups_test.go deleted file mode 100644 index 351110344a90abdfce71e44f165528b4c22c95a8..0000000000000000000000000000000000000000 --- a/netbox/tenancy_tenant-groups_test.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "bytes" - "encoding/json" - "fmt" - "reflect" - "testing" -) - -func TestTenantGroupUnmarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data []byte - want *TenantGroup - }{ - { - desc: "full", - data: []byte(`{ "id": 1, "name": "Tenant Group 1", "slug": "tenant-group-1", "custom_fields": {} }`), - want: testTenantGroup(1), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - result := new(TenantGroup) - err := json.Unmarshal(tt.data, result) - if err != nil { - t.Fatalf("unexpected error from TenantGroup.UnmarshalJSON: %v", err) - } - - if want, got := tt.want, result; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected TenantGroup:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestTenantGroupMarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data *TenantGroup - want []byte - }{ - { - desc: "With TenantGroup.ID", - data: testTenantGroup(1), - want: []byte(`{"id":1,"name":"Tenant Group 1","slug":"tenant-group-1"}`), - }, - { - desc: "No TenantGroup.ID", - data: testTenantGroup(0), - want: []byte(`{"name":"Tenant Group 0","slug":"tenant-group-0"}`), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - result, err := json.Marshal(tt.data) - if err != nil { - t.Fatalf("unexpected error from TenantGroup.MarshalJSON: %v", err) - } - - if want, got := tt.want, result; bytes.Compare(want, got) != 0 { - t.Fatalf("unexpected TenantGroup:\n- want: %s\n- got: %s", want, got) - } - }) - } -} diff --git a/netbox/tenancy_tenant-groups_types.go b/netbox/tenancy_tenant-groups_types.go deleted file mode 100644 index 813ef83d5829e3894af75bf591d3016cb6bcaa8f..0000000000000000000000000000000000000000 --- a/netbox/tenancy_tenant-groups_types.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -// A TenantGroup is a representation of netbox tenant-groups -type TenantGroup struct { - ID int `json:"id,omitempty"` - Name string `json:"name"` - Slug string `json:"slug"` -} - -//go:generate go run generate_functions.go -type-name TenantGroup -service-name TenantGroupsService -endpoint tenancy -service tenant-groups -without-list-opts -//go:generate go run generate_basic_tests.go -type-name TenantGroup -service-name TenantGroupsService -endpoint tenancy -service tenant-groups -client-endpoint Tenancy -client-service TenantGroups -without-list-opts diff --git a/netbox/tenancy_tenants.go b/netbox/tenancy_tenants.go deleted file mode 100644 index 0c265acf8db817f25fa03143c90327f1bdfa3def..0000000000000000000000000000000000000000 --- a/netbox/tenancy_tenants.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_functions.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "fmt" - "net/http" -) - -// TenantsService is used in a Client to access NetBox's tenancy/tenants API methods. -type TenantsService struct { - c *Client -} - -// Get retrieves an Tenant object from NetBox by its ID. -func (s *TenantsService) Get(id int) (*Tenant, error) { - req, err := s.c.NewRequest( - http.MethodGet, - fmt.Sprintf("api/tenancy/tenants/%d/", id), - nil, - ) - if err != nil { - return nil, err - } - - t := new(Tenant) - err = s.c.Do(req, t) - if err != nil { - return nil, err - } - return t, nil -} - -// List returns a Page associated with an NetBox API Endpoint. -func (s *TenantsService) List(options *ListTenantOptions) *Page { - return NewPage(s.c, "api/tenancy/tenants/", options) -} - -// Extract retrives a list of Tenant objects from page. -func (s *TenantsService) Extract(page *Page) ([]*Tenant, error) { - if err := page.Err(); err != nil { - return nil, err - } - - var groups []*Tenant - if err := json.Unmarshal(page.data.Results, &groups); err != nil { - return nil, err - } - return groups, nil -} - -// Create creates a new Tenant object in NetBox and returns the ID of the new object. -func (s *TenantsService) Create(data *Tenant) (int, error) { - req, err := s.c.NewJSONRequest(http.MethodPost, "api/tenancy/tenants/", nil, data) - if err != nil { - return 0, err - } - - g := new(updateTenant) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Update changes an existing Tenant object in NetBox, and returns the ID of the new object. -func (s *TenantsService) Update(data *Tenant) (int, error) { - req, err := s.c.NewJSONRequest( - http.MethodPatch, - fmt.Sprintf("api/tenancy/tenants/%d/", data.ID), - nil, - data, - ) - if err != nil { - return 0, err - } - - // g is just used to verify correct api result. - // data is not changed, because the g is not the full representation that one would - // get with Get. But if the response was unmarshaled into updateTenant correctly, - // everything went fine, and we do not need to update data. - g := new(updateTenant) - err = s.c.Do(req, g) - if err != nil { - return 0, err - } - return g.ID, nil -} - -// Delete deletes an existing Tenant object from NetBox. -func (s *TenantsService) Delete(data *Tenant) error { - req, err := s.c.NewRequest( - http.MethodDelete, - fmt.Sprintf("api/tenancy/tenants/%d/", data.ID), - nil, - ) - if err != nil { - return err - } - - return s.c.Do(req, nil) -} diff --git a/netbox/tenancy_tenants_basic_test.go b/netbox/tenancy_tenants_basic_test.go deleted file mode 100644 index 6e87fd6616b1cfd3178c916486c972903d747f1a..0000000000000000000000000000000000000000 --- a/netbox/tenancy_tenants_basic_test.go +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Code generated by generate_basic_tests.go. DO NOT EDIT. - -package netbox - -import ( - "encoding/json" - "errors" - "fmt" - "net/http" - "reflect" - "testing" -) - -// Using this to override MarshalJSON -// In all cases when posting data to netbox-API, the Tenant.MarshalJSON is what you want, -// but not here as a return in testHandler -type serverDataTenant Tenant - -func convertToServerDataTenant(data []*Tenant) []*serverDataTenant { - dataWant := make([]*serverDataTenant, len(data)) - for i := range data { - tmp := serverDataTenant(*data[i]) - dataWant[i] = &tmp - } - return dataWant -} - -func TestBasicTenantGet(t *testing.T) { - var tests = []struct { - desc string - want *Tenant - }{ - { - desc: "Simple Tenant", - want: testTenant(1), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - serverData := serverDataTenant(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/tenancy/tenants/1/", &serverData)) - defer done() - - res, err := c.Tenancy.Tenants.Get(1) - if err != nil { - t.Fatalf("unexpected error from Client.Tenancy.Tenants.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Tenant:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicTenantGet404(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodGet, "/api/tenancy/tenants/1/", &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - http.StatusNotFound)) - defer done() - - res, err := c.Tenancy.Tenants.Get(1) - errstr := "404 - Not found." - if want, got := errors.New(errstr), err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error from Client.Tenancy.Tenants.Get:\n- want: %v\n- got: %v", want, got) - } - - if res != nil { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", nil, res) - } -} - -func TestBasicListExtractTenant(t *testing.T) { - want := []*Tenant{ - testTenant(1), - testTenant(2), - } - serverWant := convertToServerDataTenant(want) - serverData, _ := json.Marshal(serverWant) - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/tenancy/tenants/", &pageData{ - Count: 2, - NextURL: "", - PreviousURL: "", - Results: serverData, - })) - defer done() - - page := c.Tenancy.Tenants.List(nil) - - if page == nil { - t.Fatalf("unexpexted result from c.Tenancy.Tenants.List.") - } - - got := []*Tenant{} - counter := 0 - for page.Next() { - var err error - got, err = c.Tenancy.Tenants.Extract(page) - if err != nil { - t.Fatalf("unexpected error from c.Tenancy.Tenants.Extract: %v", err) - } - counter = counter + 1 - if counter > 2 { // Safe guard - break - } - } - if counter != 1 { - t.Fatalf("unexpected page count:\n- want: 1\n- got: %d", counter) - } - - if !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected result:\n- want: %v\n- got: %v", want, got) - } - - if page.Err() != nil { - t.Fatalf("unexpected error from page:\n- want: %v\n- got: %v", want, got) - } -} - -func TestBasicCreateTenant(t *testing.T) { - var tests = []struct { - desc string - data *Tenant - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Create with ID 0", - data: testTenantCreate(1), - want: 1, - status: 0, - errstr: "", - serverData: testTenant(1), - }, - { - desc: "Create duplicate", - data: testTenantCreate(1), - want: 0, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"TenantsService with this name already exists.\"]}\n", - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"TenantsService with this name already exists."}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPost, "/api/tenancy/tenants/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.Tenancy.Tenants.Create(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Tenant:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicUpdateTenant(t *testing.T) { - var tests = []struct { - desc string - data *Tenant - want int - serverData interface{} - status int - errstr string - }{ - { - desc: "Update with ID 1", - data: testTenant(1), - want: 1, - serverData: testTenant(1), - status: 0, - errstr: "", - }, - { - desc: "Update not found", - data: testTenant(1), - want: 0, - serverData: &struct { - Detail string - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - { - desc: "Update to duplicate", - data: testTenant(1), - want: 0, - serverData: &struct { - Name []string `json:"name"` - }{ - Name: []string{"TenantsService with this name already exists."}, - }, - status: http.StatusBadRequest, - errstr: "400 - {\"name\":[\"TenantsService with this name already exists.\"]}\n", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodPatch, "/api/tenancy/tenants/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - res, err := c.Tenancy.Tenants.Update(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Tenant:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestBasicDeleteTenant(t *testing.T) { - var tests = []struct { - desc string - data *Tenant - serverData interface{} - status int - errstr string - }{ - { - desc: "Delete ID 1", - data: testTenant(1), - serverData: testTenant(1), - status: 0, - errstr: "", - }, - { - desc: "Delete not Found", - data: testTenant(1), - serverData: &struct { - Detail string `json:"detail"` - }{ - Detail: "Not found.", - }, - status: http.StatusNotFound, - errstr: "404 - Not found.", - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - c, done := testClient(t, testStatusHandler(t, http.MethodDelete, "/api/tenancy/tenants/1/", tt.serverData, tt.status)) - defer done() - - var terr error - if tt.errstr != "" { - terr = errors.New(tt.errstr) // Using errstr and initialize real err here, to satisfy golint - } - - err := c.Tenancy.Tenants.Delete(tt.data) - if want, got := terr, err; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected error:\n- want: %v\n- got: %v", want, got) - } - }) - } -} diff --git a/netbox/tenancy_tenants_test.go b/netbox/tenancy_tenants_test.go deleted file mode 100644 index 5e74b31be18ff87340e977f7a0efa8c0eea4210b..0000000000000000000000000000000000000000 --- a/netbox/tenancy_tenants_test.go +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "bytes" - "encoding/json" - "fmt" - "net/http" - "net/url" - "reflect" - "testing" -) - -func TestTenantGet(t *testing.T) { - var tests = []struct { - desc string - want *Tenant - }{ - { - desc: "Without TenantGroup", - want: testTenantWithGroup(1, nil), - }, - { - desc: "With TenantGroup", - want: testTenantWithGroup(1, testTenantGroup(1)), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - serverData := serverDataTenant(*tt.want) - - c, done := testClient(t, testHandler(t, http.MethodGet, "/api/tenancy/tenants/1/", &serverData)) - defer done() - - res, err := c.Tenancy.Tenants.Get(1) - if err != nil { - t.Fatalf("unexpected error from Client.Tenancy.Tenants.Get: %v", err) - } - - if want, got := tt.want, res; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Tenant:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestTenantUnmarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data []byte - want *Tenant - }{ - { - desc: "Nil Group", - data: []byte(`{ "id": 1, "name": "Tenant 1", "slug": "tenant-1", "group": null, "description": "Tenant 1 Description", "comments": "Tenant 1 Comments", "custom_fields": {} }`), - want: testTenantWithGroup(1, nil), - }, - { - desc: "With Group", - data: []byte(`{ "id": 1, "name": "Tenant 1", "slug": "tenant-1", "group": {"id": 1, "name": "Tenant Group 1", "slug": "tenant-group-1"}, "description": "Tenant 1 Description", "comments": "Tenant 1 Comments", "custom_fields": {} }`), - want: testTenant(1), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - result := new(Tenant) - err := json.Unmarshal(tt.data, result) - if err != nil { - t.Fatalf("unexpected error from Tenant.UnmarshalJSON: %v", err) - } - - if want, got := tt.want, result; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected Tenant:\n- want: %v\n- got: %v", want, got) - } - }) - } -} - -func TestTenantMarshalJSON(t *testing.T) { - var tests = []struct { - desc string - data *Tenant - want []byte - }{ - { - desc: "Nil Group", - data: testTenantWithGroup(1, nil), - want: []byte(`{"id":1,"name":"Tenant 1","slug":"tenant-1","description":"Tenant 1 Description","comments":"Tenant 1 Comments"}`), - }, - { - desc: "With Group", - data: testTenant(1), - want: []byte(`{"id":1,"name":"Tenant 1","slug":"tenant-1","description":"Tenant 1 Description","comments":"Tenant 1 Comments","group":1}`), - }, - { - desc: "No Tenant.ID", - data: testTenantWithGroup(0, nil), - want: []byte(`{"name":"Tenant 0","slug":"tenant-0","description":"Tenant 0 Description","comments":"Tenant 0 Comments"}`), - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - result, err := json.Marshal(tt.data) - if err != nil { - t.Fatalf("unexpected error from Tenant.MarshalJSON: %v", err) - } - - if want, got := tt.want, result; bytes.Compare(want, got) != 0 { - t.Fatalf("unexpected Tenant:\n- want: %s\n- got: %s", want, got) - } - }) - } -} - -func TestListTenantOptions(t *testing.T) { - var tests = []struct { - desc string - o *ListTenantOptions - v url.Values - }{ - { - desc: "empty options", - }, - { - desc: "full options", - o: &ListTenantOptions{ - Name: "Hello", - IDIn: "1,2,3", - GroupID: 1, - Query: "World", - }, - v: url.Values{ - "name": []string{"Hello"}, - "id__in": []string{"1,2,3"}, - "group_id": []string{"1"}, - "q": []string{"World"}, - }, - }, - { - desc: "group vs group_id", - o: &ListTenantOptions{ - GroupID: 1, - Group: "Group1", - }, - v: url.Values{ - "group_id": []string{"1"}, - }, - }, - { - desc: "group name", - o: &ListTenantOptions{ - Group: "Group 1", - }, - v: url.Values{ - "group": []string{"Group 1"}, - }, - }, - } - - for i, tt := range tests { - t.Run(fmt.Sprintf("[%d] %s", i, tt.desc), func(t *testing.T) { - v, err := tt.o.Values() - if err != nil { - t.Fatalf("unexpected Values error: %v", err) - } - - if want, got := tt.v, v; !reflect.DeepEqual(want, got) { - t.Fatalf("unexpected url.Values map:\n- want: %v\n- got: %v", want, got) - } - }) - } -} diff --git a/netbox/tenancy_tenants_types.go b/netbox/tenancy_tenants_types.go deleted file mode 100644 index 75fbfd02684368b4d1c92420026ea8e4cc0b2375..0000000000000000000000000000000000000000 --- a/netbox/tenancy_tenants_types.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2017 The go-netbox Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package netbox - -import ( - "encoding/json" - "net/url" - "strconv" -) - -// A Tenant is a representation of netbox tenants -type Tenant struct { - ID int `json:"id,omitempty"` - Name string `json:"name"` - Slug string `json:"slug"` - Description string `json:"description"` - Comments string `json:"comments"` - Group *TenantGroup `json:"Group"` -} - -// A updateTenant is the internal representation of tenants -// needed to POST/PUT/PATCH to Netbox API -type updateTenant struct { - ID int `json:"id,omitempty"` - Name string `json:"name"` - Slug string `json:"slug"` - Description string `json:"description"` - Comments string `json:"comments"` - Group int `json:"group,omitempty"` -} - -// MarshalJSON marshals an Tenant into JSON bytes. -func (t *Tenant) MarshalJSON() ([]byte, error) { - group := 0 - if t.Group != nil { - group = t.Group.ID - } - return json.Marshal(updateTenant{ - ID: t.ID, - Name: t.Name, - Slug: t.Slug, - Description: t.Description, - Comments: t.Comments, - Group: group, - }) -} - -// ListTenantOptions is used as an argument for Client.Tenancy.Tenants.List. -// Integer fields with an *ID suffix are preferred over their string -// counterparts, and if both are set, only the *ID field will be used. -type ListTenantOptions struct { - Name string - IDIn string - GroupID int - Group string - - Query string -} - -// Values generates a url.Values map from the data in ListTenantOptions. -func (o *ListTenantOptions) Values() (url.Values, error) { - if o == nil { - return nil, nil - } - - v := url.Values{} - - switch { - case o.GroupID != 0: - v.Set("group_id", strconv.Itoa(o.GroupID)) - case o.Group != "": - v.Set("group", o.Group) - } - - if o.Name != "" { - v.Set("name", o.Name) - } - - if o.IDIn != "" { - v.Set("id__in", o.IDIn) - } - - if o.Query != "" { - v.Set("q", o.Query) - } - - return v, nil -} - -//go:generate go run generate_functions.go -type-name Tenant -update-type-name updateTenant -service-name TenantsService -endpoint tenancy -service tenants -//go:generate go run generate_basic_tests.go -type-name Tenant -service-name TenantsService -endpoint tenancy -service tenants -client-endpoint Tenancy -client-service Tenants diff --git a/swagger.json b/swagger.json new file mode 100644 index 0000000000000000000000000000000000000000..1931dab253b440d12acd4d80102425de311bf75e --- /dev/null +++ b/swagger.json @@ -0,0 +1,17323 @@ +{ + "swagger": "2.0", + "info": { + "title": "NetBox API", + "description": "API to access NetBox", + "termsOfService": "https://github.com/digitalocean/netbox", + "contact": { + "email": "netbox@digitalocean.com" + }, + "license": { + "name": "Apache v2 License" + }, + "version": "2.2" + }, + "host": "localhost:8000", + "schemes": [ + "http" + ], + "basePath": "/api", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "securityDefinitions": { + "basic": { + "type": "basic" + } + }, + "security": [ + { + "basic": [] + } + ], + "paths": { + "/circuits/_choices/": { + "get": { + "operationId": "circuits__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [] + }, + "/circuits/_choices/{id}/": { + "get": { + "operationId": "circuits__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/circuits/circuit-terminations/": { + "get": { + "operationId": "circuits_circuit-terminations_list", + "description": "", + "parameters": [ + { + "name": "term_side", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "port_speed", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "upstream_speed", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "xconnect_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "circuit_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/CircuitTermination" + } + } + } + } + } + }, + "tags": [ + "circuits" + ] + }, + "post": { + "operationId": "circuits_circuit-terminations_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCircuitTermination" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCircuitTermination" + } + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [] + }, + "/circuits/circuit-terminations/{id}/": { + "get": { + "operationId": "circuits_circuit-terminations_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/CircuitTermination" + } + } + }, + "tags": [ + "circuits" + ] + }, + "put": { + "operationId": "circuits_circuit-terminations_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCircuitTermination" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCircuitTermination" + } + } + }, + "tags": [ + "circuits" + ] + }, + "patch": { + "operationId": "circuits_circuit-terminations_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCircuitTermination" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCircuitTermination" + } + } + }, + "tags": [ + "circuits" + ] + }, + "delete": { + "operationId": "circuits_circuit-terminations_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this circuit termination.", + "required": true, + "type": "integer" + } + ] + }, + "/circuits/circuit-types/": { + "get": { + "operationId": "circuits_circuit-types_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "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/CircuitType" + } + } + } + } + } + }, + "tags": [ + "circuits" + ] + }, + "post": { + "operationId": "circuits_circuit-types_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CircuitType" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/CircuitType" + } + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [] + }, + "/circuits/circuit-types/{id}/": { + "get": { + "operationId": "circuits_circuit-types_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/CircuitType" + } + } + }, + "tags": [ + "circuits" + ] + }, + "put": { + "operationId": "circuits_circuit-types_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CircuitType" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/CircuitType" + } + } + }, + "tags": [ + "circuits" + ] + }, + "patch": { + "operationId": "circuits_circuit-types_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CircuitType" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/CircuitType" + } + } + }, + "tags": [ + "circuits" + ] + }, + "delete": { + "operationId": "circuits_circuit-types_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this circuit type.", + "required": true, + "type": "integer" + } + ] + }, + "/circuits/circuits/": { + "get": { + "operationId": "circuits_circuits_list", + "description": "", + "parameters": [ + { + "name": "cid", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "install_date", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "commit_rate", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "provider_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "provider", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "type_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "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/Circuit" + } + } + } + } + } + }, + "tags": [ + "circuits" + ] + }, + "post": { + "operationId": "circuits_circuits_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCircuit" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCircuit" + } + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [] + }, + "/circuits/circuits/{id}/": { + "get": { + "operationId": "circuits_circuits_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Circuit" + } + } + }, + "tags": [ + "circuits" + ] + }, + "put": { + "operationId": "circuits_circuits_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCircuit" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCircuit" + } + } + }, + "tags": [ + "circuits" + ] + }, + "patch": { + "operationId": "circuits_circuits_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCircuit" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCircuit" + } + } + }, + "tags": [ + "circuits" + ] + }, + "delete": { + "operationId": "circuits_circuits_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this circuit.", + "required": true, + "type": "integer" + } + ] + }, + "/circuits/providers/": { + "get": { + "operationId": "circuits_providers_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "asn", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "account", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "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/Provider" + } + } + } + } + } + }, + "tags": [ + "circuits" + ] + }, + "post": { + "operationId": "circuits_providers_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableProvider" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableProvider" + } + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [] + }, + "/circuits/providers/{id}/": { + "get": { + "operationId": "circuits_providers_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Provider" + } + } + }, + "tags": [ + "circuits" + ] + }, + "put": { + "operationId": "circuits_providers_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableProvider" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableProvider" + } + } + }, + "tags": [ + "circuits" + ] + }, + "patch": { + "operationId": "circuits_providers_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableProvider" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableProvider" + } + } + }, + "tags": [ + "circuits" + ] + }, + "delete": { + "operationId": "circuits_providers_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this provider.", + "required": true, + "type": "integer" + } + ] + }, + "/circuits/providers/{id}/graphs/": { + "get": { + "operationId": "circuits_providers_graphs", + "description": "A convenience method for rendering graphs for a particular provider.", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Provider" + } + } + }, + "tags": [ + "circuits" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this provider.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/_choices/": { + "get": { + "operationId": "dcim__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/_choices/{id}/": { + "get": { + "operationId": "dcim__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/dcim/connected-device/": { + "get": { + "operationId": "dcim_connected-device_list", + "description": "This endpoint allows a user to determine what device (if any) is connected to a given peer device and peer\ninterface. This is useful in a situation where a device boots with no configuration, but can detect its neighbors\nvia a protocol such as LLDP. Two query parameters must be included in the request:\n\n* `peer-device`: The name of the peer device\n* `peer-interface`: The name of the peer interface", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/console-connections/": { + "get": { + "operationId": "dcim_console-connections_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "connection_status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsolePort" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/console-port-templates/": { + "get": { + "operationId": "dcim_console-port-templates_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsolePortTemplate" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_console-port-templates_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsolePortTemplate" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsolePortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/console-port-templates/{id}/": { + "get": { + "operationId": "dcim_console-port-templates_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ConsolePortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_console-port-templates_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsolePortTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsolePortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_console-port-templates_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsolePortTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsolePortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_console-port-templates_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this console port template.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/console-ports/": { + "get": { + "operationId": "dcim_console-ports_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/ConsolePort" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_console-ports_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsolePort" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsolePort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/console-ports/{id}/": { + "get": { + "operationId": "dcim_console-ports_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ConsolePort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_console-ports_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsolePort" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsolePort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_console-ports_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsolePort" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsolePort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_console-ports_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this console port.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/console-server-port-templates/": { + "get": { + "operationId": "dcim_console-server-port-templates_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ConsoleServerPortTemplate" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_console-server-port-templates_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsoleServerPortTemplate" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsoleServerPortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/console-server-port-templates/{id}/": { + "get": { + "operationId": "dcim_console-server-port-templates_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ConsoleServerPortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_console-server-port-templates_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsoleServerPortTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsoleServerPortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_console-server-port-templates_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsoleServerPortTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsoleServerPortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_console-server-port-templates_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this console server port template.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/console-server-ports/": { + "get": { + "operationId": "dcim_console-server-ports_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/ConsoleServerPort" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_console-server-ports_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsoleServerPort" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsoleServerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/console-server-ports/{id}/": { + "get": { + "operationId": "dcim_console-server-ports_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ConsoleServerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_console-server-ports_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsoleServerPort" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsoleServerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_console-server-ports_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableConsoleServerPort" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableConsoleServerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_console-server-ports_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this console server port.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/device-bay-templates/": { + "get": { + "operationId": "dcim_device-bay-templates_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/DeviceBayTemplate" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_device-bay-templates_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceBayTemplate" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceBayTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/device-bay-templates/{id}/": { + "get": { + "operationId": "dcim_device-bay-templates_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceBayTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_device-bay-templates_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceBayTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceBayTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_device-bay-templates_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceBayTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceBayTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_device-bay-templates_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this device bay template.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/device-bays/": { + "get": { + "operationId": "dcim_device-bays_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/DeviceBay" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_device-bays_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceBay" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceBay" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/device-bays/{id}/": { + "get": { + "operationId": "dcim_device-bays_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceBay" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_device-bays_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceBay" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceBay" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_device-bays_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceBay" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceBay" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_device-bays_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this device bay.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/device-roles/": { + "get": { + "operationId": "dcim_device-roles_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "color", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vm_role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "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/DeviceRole" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_device-roles_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeviceRole" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceRole" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/device-roles/{id}/": { + "get": { + "operationId": "dcim_device-roles_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceRole" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_device-roles_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeviceRole" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceRole" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_device-roles_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DeviceRole" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceRole" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_device-roles_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this device role.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/device-types/": { + "get": { + "operationId": "dcim_device-types_list", + "description": "", + "parameters": [ + { + "name": "model", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "part_number", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "u_height", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "is_full_depth", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_console_server", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_pdu", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_network_device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "subdevice_role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "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/DeviceType" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_device-types_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceType" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceType" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/device-types/{id}/": { + "get": { + "operationId": "dcim_device-types_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/DeviceType" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_device-types_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceType" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceType" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_device-types_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDeviceType" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDeviceType" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_device-types_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this device type.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/devices/": { + "get": { + "operationId": "dcim_devices_list", + "description": "", + "parameters": [ + { + "name": "serial", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "position", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_type_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "platform_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "platform", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "asset_tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rack_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rack_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "model", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_full_depth", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_console_server", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_pdu", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_network_device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mac_address", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "has_primary_ip", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Device" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_devices_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDevice" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDevice" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/devices/{id}/": { + "get": { + "operationId": "dcim_devices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Device" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_devices_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDevice" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDevice" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_devices_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableDevice" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableDevice" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_devices_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this device.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/devices/{id}/napalm/": { + "get": { + "operationId": "dcim_devices_napalm", + "description": "Execute a NAPALM method on a Device", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Device" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this device.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/interface-connections/": { + "get": { + "operationId": "dcim_interface-connections_list", + "description": "", + "parameters": [ + { + "name": "connection_status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InterfaceConnection" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_interface-connections_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterfaceConnection" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterfaceConnection" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/interface-connections/{id}/": { + "get": { + "operationId": "dcim_interface-connections_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/InterfaceConnection" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_interface-connections_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterfaceConnection" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterfaceConnection" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_interface-connections_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterfaceConnection" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterfaceConnection" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_interface-connections_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this interface connection.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/interface-templates/": { + "get": { + "operationId": "dcim_interface-templates_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "form_factor", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mgmt_only", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/InterfaceTemplate" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_interface-templates_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterfaceTemplate" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterfaceTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/interface-templates/{id}/": { + "get": { + "operationId": "dcim_interface-templates_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/InterfaceTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_interface-templates_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterfaceTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterfaceTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_interface-templates_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterfaceTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterfaceTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_interface-templates_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this interface template.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/interfaces/": { + "get": { + "operationId": "dcim_interfaces_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "form_factor", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "enabled", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mtu", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "mgmt_only", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "lag_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mac_address", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Interface" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_interfaces_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/interfaces/{id}/": { + "get": { + "operationId": "dcim_interfaces_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Interface" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_interfaces_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_interfaces_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_interfaces_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this interface.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/interfaces/{id}/graphs/": { + "get": { + "operationId": "dcim_interfaces_graphs", + "description": "A convenience method for rendering graphs for a particular interface.", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Interface" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this interface.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/inventory-items/": { + "get": { + "operationId": "dcim_inventory-items_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "part_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "serial", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "asset_tag", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "discovered", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "parent_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "manufacturer", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "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/InventoryItem" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_inventory-items_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInventoryItem" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInventoryItem" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/inventory-items/{id}/": { + "get": { + "operationId": "dcim_inventory-items_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/InventoryItem" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_inventory-items_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInventoryItem" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInventoryItem" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_inventory-items_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInventoryItem" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInventoryItem" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_inventory-items_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this inventory item.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/manufacturers/": { + "get": { + "operationId": "dcim_manufacturers_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "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/Manufacturer" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_manufacturers_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Manufacturer" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Manufacturer" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/manufacturers/{id}/": { + "get": { + "operationId": "dcim_manufacturers_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Manufacturer" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_manufacturers_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Manufacturer" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Manufacturer" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_manufacturers_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Manufacturer" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Manufacturer" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_manufacturers_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this manufacturer.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/platforms/": { + "get": { + "operationId": "dcim_platforms_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "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/Platform" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_platforms_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Platform" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Platform" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/platforms/{id}/": { + "get": { + "operationId": "dcim_platforms_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Platform" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_platforms_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Platform" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Platform" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_platforms_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Platform" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Platform" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_platforms_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this platform.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/power-connections/": { + "get": { + "operationId": "dcim_power-connections_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "connection_status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PowerPort" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/power-outlet-templates/": { + "get": { + "operationId": "dcim_power-outlet-templates_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PowerOutletTemplate" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_power-outlet-templates_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerOutletTemplate" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerOutletTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/power-outlet-templates/{id}/": { + "get": { + "operationId": "dcim_power-outlet-templates_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/PowerOutletTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_power-outlet-templates_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerOutletTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerOutletTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_power-outlet-templates_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerOutletTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerOutletTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_power-outlet-templates_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this power outlet template.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/power-outlets/": { + "get": { + "operationId": "dcim_power-outlets_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/PowerOutlet" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_power-outlets_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerOutlet" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerOutlet" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/power-outlets/{id}/": { + "get": { + "operationId": "dcim_power-outlets_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/PowerOutlet" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_power-outlets_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerOutlet" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerOutlet" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_power-outlets_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerOutlet" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerOutlet" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_power-outlets_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this power outlet.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/power-port-templates/": { + "get": { + "operationId": "dcim_power-port-templates_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "devicetype_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/PowerPortTemplate" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_power-port-templates_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerPortTemplate" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerPortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/power-port-templates/{id}/": { + "get": { + "operationId": "dcim_power-port-templates_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/PowerPortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_power-port-templates_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerPortTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerPortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_power-port-templates_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerPortTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerPortTemplate" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_power-port-templates_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this power port template.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/power-ports/": { + "get": { + "operationId": "dcim_power-ports_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/PowerPort" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_power-ports_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerPort" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/power-ports/{id}/": { + "get": { + "operationId": "dcim_power-ports_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/PowerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_power-ports_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerPort" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_power-ports_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePowerPort" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePowerPort" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_power-ports_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this power port.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/rack-groups/": { + "get": { + "operationId": "dcim_rack-groups_list", + "description": "", + "parameters": [ + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RackGroup" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_rack-groups_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRackGroup" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRackGroup" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/rack-groups/{id}/": { + "get": { + "operationId": "dcim_rack-groups_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/RackGroup" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_rack-groups_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRackGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRackGroup" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_rack-groups_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRackGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRackGroup" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_rack-groups_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this rack group.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/rack-reservations/": { + "get": { + "operationId": "dcim_rack-reservations_list", + "description": "", + "parameters": [ + { + "name": "created", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rack_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "user_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "user", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/RackReservation" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_rack-reservations_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRackReservation" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRackReservation" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/rack-reservations/{id}/": { + "get": { + "operationId": "dcim_rack-reservations_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/RackReservation" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_rack-reservations_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRackReservation" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRackReservation" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_rack-reservations_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRackReservation" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRackReservation" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_rack-reservations_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this rack reservation.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/rack-roles/": { + "get": { + "operationId": "dcim_rack-roles_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "color", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/RackRole" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_rack-roles_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RackRole" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/RackRole" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/rack-roles/{id}/": { + "get": { + "operationId": "dcim_rack-roles_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/RackRole" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_rack-roles_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RackRole" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/RackRole" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_rack-roles_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RackRole" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/RackRole" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_rack-roles_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this rack role.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/racks/": { + "get": { + "operationId": "dcim_racks_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "serial", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "width", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "u_height", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "desc_units", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "facility_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Rack" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_racks_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRack" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRack" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/racks/{id}/": { + "get": { + "operationId": "dcim_racks_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Rack" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_racks_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRack" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRack" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_racks_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRack" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRack" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_racks_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this rack.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/racks/{id}/units/": { + "get": { + "operationId": "dcim_racks_units", + "description": "List rack units (by rack)", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Rack" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this rack.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/regions/": { + "get": { + "operationId": "dcim_regions_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "parent_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "parent", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Region" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_regions_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRegion" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRegion" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/regions/{id}/": { + "get": { + "operationId": "dcim_regions_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Region" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_regions_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRegion" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRegion" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_regions_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableRegion" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableRegion" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_regions_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this region.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/sites/": { + "get": { + "operationId": "dcim_sites_list", + "description": "", + "parameters": [ + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "facility", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "asn", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "contact_name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "contact_phone", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "contact_email", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "region_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "region", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "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/Site" + } + } + } + } + } + }, + "tags": [ + "dcim" + ] + }, + "post": { + "operationId": "dcim_sites_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSite" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableSite" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [] + }, + "/dcim/sites/{id}/": { + "get": { + "operationId": "dcim_sites_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Site" + } + } + }, + "tags": [ + "dcim" + ] + }, + "put": { + "operationId": "dcim_sites_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSite" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableSite" + } + } + }, + "tags": [ + "dcim" + ] + }, + "patch": { + "operationId": "dcim_sites_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSite" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableSite" + } + } + }, + "tags": [ + "dcim" + ] + }, + "delete": { + "operationId": "dcim_sites_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this site.", + "required": true, + "type": "integer" + } + ] + }, + "/dcim/sites/{id}/graphs/": { + "get": { + "operationId": "dcim_sites_graphs", + "description": "A convenience method for rendering graphs for a particular site.", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Site" + } + } + }, + "tags": [ + "dcim" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this site.", + "required": true, + "type": "integer" + } + ] + }, + "/extras/_choices/": { + "get": { + "operationId": "extras__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [] + }, + "/extras/_choices/{id}/": { + "get": { + "operationId": "extras__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/extras/export-templates/": { + "get": { + "operationId": "extras_export-templates_list", + "description": "", + "parameters": [ + { + "name": "content_type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/ExportTemplate" + } + } + } + } + } + }, + "tags": [ + "extras" + ] + }, + "post": { + "operationId": "extras_export-templates_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ExportTemplate" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/ExportTemplate" + } + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [] + }, + "/extras/export-templates/{id}/": { + "get": { + "operationId": "extras_export-templates_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ExportTemplate" + } + } + }, + "tags": [ + "extras" + ] + }, + "put": { + "operationId": "extras_export-templates_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ExportTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ExportTemplate" + } + } + }, + "tags": [ + "extras" + ] + }, + "patch": { + "operationId": "extras_export-templates_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ExportTemplate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ExportTemplate" + } + } + }, + "tags": [ + "extras" + ] + }, + "delete": { + "operationId": "extras_export-templates_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this export template.", + "required": true, + "type": "integer" + } + ] + }, + "/extras/graphs/": { + "get": { + "operationId": "extras_graphs_list", + "description": "", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Graph" + } + } + } + } + } + }, + "tags": [ + "extras" + ] + }, + "post": { + "operationId": "extras_graphs_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableGraph" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableGraph" + } + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [] + }, + "/extras/graphs/{id}/": { + "get": { + "operationId": "extras_graphs_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Graph" + } + } + }, + "tags": [ + "extras" + ] + }, + "put": { + "operationId": "extras_graphs_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableGraph" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableGraph" + } + } + }, + "tags": [ + "extras" + ] + }, + "patch": { + "operationId": "extras_graphs_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableGraph" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableGraph" + } + } + }, + "tags": [ + "extras" + ] + }, + "delete": { + "operationId": "extras_graphs_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this graph.", + "required": true, + "type": "integer" + } + ] + }, + "/extras/image-attachments/": { + "get": { + "operationId": "extras_image-attachments_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/ImageAttachment" + } + } + } + } + } + }, + "tags": [ + "extras" + ] + }, + "post": { + "operationId": "extras_image-attachments_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableImageAttachment" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableImageAttachment" + } + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [] + }, + "/extras/image-attachments/{id}/": { + "get": { + "operationId": "extras_image-attachments_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ImageAttachment" + } + } + }, + "tags": [ + "extras" + ] + }, + "put": { + "operationId": "extras_image-attachments_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableImageAttachment" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableImageAttachment" + } + } + }, + "tags": [ + "extras" + ] + }, + "patch": { + "operationId": "extras_image-attachments_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableImageAttachment" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableImageAttachment" + } + } + }, + "tags": [ + "extras" + ] + }, + "delete": { + "operationId": "extras_image-attachments_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this image attachment.", + "required": true, + "type": "integer" + } + ] + }, + "/extras/recent-activity/": { + "get": { + "operationId": "extras_recent-activity_list", + "description": "List all UserActions to provide a log of recent activity.", + "parameters": [ + { + "name": "user", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "username", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/UserAction" + } + } + } + } + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [] + }, + "/extras/recent-activity/{id}/": { + "get": { + "operationId": "extras_recent-activity_read", + "description": "List all UserActions to provide a log of recent activity.", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/UserAction" + } + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this user action.", + "required": true, + "type": "integer" + } + ] + }, + "/extras/topology-maps/": { + "get": { + "operationId": "extras_topology-maps_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "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/TopologyMap" + } + } + } + } + } + }, + "tags": [ + "extras" + ] + }, + "post": { + "operationId": "extras_topology-maps_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTopologyMap" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableTopologyMap" + } + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [] + }, + "/extras/topology-maps/{id}/": { + "get": { + "operationId": "extras_topology-maps_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TopologyMap" + } + } + }, + "tags": [ + "extras" + ] + }, + "put": { + "operationId": "extras_topology-maps_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTopologyMap" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableTopologyMap" + } + } + }, + "tags": [ + "extras" + ] + }, + "patch": { + "operationId": "extras_topology-maps_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTopologyMap" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableTopologyMap" + } + } + }, + "tags": [ + "extras" + ] + }, + "delete": { + "operationId": "extras_topology-maps_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this topology map.", + "required": true, + "type": "integer" + } + ] + }, + "/extras/topology-maps/{id}/render/": { + "get": { + "operationId": "extras_topology-maps_render", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TopologyMap" + } + } + }, + "tags": [ + "extras" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this topology map.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/_choices/": { + "get": { + "operationId": "ipam__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/_choices/{id}/": { + "get": { + "operationId": "ipam__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/ipam/aggregates/": { + "get": { + "operationId": "ipam_aggregates_list", + "description": "", + "parameters": [ + { + "name": "family", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "date_added", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rir_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rir", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/Aggregate" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_aggregates_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableAggregate" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableAggregate" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/aggregates/{id}/": { + "get": { + "operationId": "ipam_aggregates_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Aggregate" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_aggregates_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableAggregate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableAggregate" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_aggregates_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableAggregate" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableAggregate" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_aggregates_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this aggregate.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/ip-addresses/": { + "get": { + "operationId": "ipam_ip-addresses_list", + "description": "", + "parameters": [ + { + "name": "family", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "parent", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mask_length", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "vrf_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vrf", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_machine_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_machine", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "interface_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/IPAddress" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_ip-addresses_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableIPAddress" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableIPAddress" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/ip-addresses/{id}/": { + "get": { + "operationId": "ipam_ip-addresses_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/IPAddress" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_ip-addresses_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableIPAddress" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableIPAddress" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_ip-addresses_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableIPAddress" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableIPAddress" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_ip-addresses_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this IP address.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/prefixes/": { + "get": { + "operationId": "ipam_prefixes_list", + "description": "", + "parameters": [ + { + "name": "family", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_pool", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "parent", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "within", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "within_include", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "contains", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mask_length", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "vrf_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vrf", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vlan_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "vlan_vid", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/Prefix" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_prefixes_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePrefix" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePrefix" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/prefixes/{id}/": { + "get": { + "operationId": "ipam_prefixes_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Prefix" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_prefixes_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePrefix" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePrefix" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_prefixes_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritablePrefix" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritablePrefix" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_prefixes_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this prefix.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/prefixes/{id}/available-ips/": { + "get": { + "operationId": "ipam_prefixes_available-ips_read", + "description": "A convenience method for returning available IP addresses within a prefix. By default, the number of IPs\nreturned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be passed,\nhowever results will not be paginated.", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Prefix" + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_prefixes_available-ips_create", + "description": "A convenience method for returning available IP addresses within a prefix. By default, the number of IPs\nreturned will be equivalent to PAGINATE_COUNT. An arbitrary limit (up to MAX_PAGE_SIZE, if set) may be passed,\nhowever results will not be paginated.", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Prefix" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Prefix" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this prefix.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/rirs/": { + "get": { + "operationId": "ipam_rirs_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "is_private", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "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/RIR" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_rirs_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RIR" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/RIR" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/rirs/{id}/": { + "get": { + "operationId": "ipam_rirs_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/RIR" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_rirs_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RIR" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/RIR" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_rirs_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RIR" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/RIR" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_rirs_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this RIR.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/roles/": { + "get": { + "operationId": "ipam_roles_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "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/Role" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_roles_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Role" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/Role" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/roles/{id}/": { + "get": { + "operationId": "ipam_roles_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Role" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_roles_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Role" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Role" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_roles_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Role" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Role" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_roles_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this role.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/services/": { + "get": { + "operationId": "ipam_services_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "protocol", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "port", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_machine_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_machine", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "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/Service" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_services_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableService" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableService" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/services/{id}/": { + "get": { + "operationId": "ipam_services_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Service" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_services_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableService" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableService" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_services_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableService" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableService" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_services_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this service.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/vlan-groups/": { + "get": { + "operationId": "ipam_vlan-groups_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "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/VLANGroup" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_vlan-groups_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLANGroup" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVLANGroup" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/vlan-groups/{id}/": { + "get": { + "operationId": "ipam_vlan-groups_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VLANGroup" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_vlan-groups_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLANGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVLANGroup" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_vlan-groups_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLANGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVLANGroup" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_vlan-groups_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this VLAN group.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/vlans/": { + "get": { + "operationId": "ipam_vlans_list", + "description": "", + "parameters": [ + { + "name": "vid", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VLAN" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_vlans_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/vlans/{id}/": { + "get": { + "operationId": "ipam_vlans_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VLAN" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_vlans_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_vlans_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVLAN" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_vlans_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this VLAN.", + "required": true, + "type": "integer" + } + ] + }, + "/ipam/vrfs/": { + "get": { + "operationId": "ipam_vrfs_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "rd", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "enforce_unique", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VRF" + } + } + } + } + } + }, + "tags": [ + "ipam" + ] + }, + "post": { + "operationId": "ipam_vrfs_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [] + }, + "/ipam/vrfs/{id}/": { + "get": { + "operationId": "ipam_vrfs_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VRF" + } + } + }, + "tags": [ + "ipam" + ] + }, + "put": { + "operationId": "ipam_vrfs_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + }, + "tags": [ + "ipam" + ] + }, + "patch": { + "operationId": "ipam_vrfs_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVRF" + } + } + }, + "tags": [ + "ipam" + ] + }, + "delete": { + "operationId": "ipam_vrfs_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "ipam" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this VRF.", + "required": true, + "type": "integer" + } + ] + }, + "/secrets/_choices/": { + "get": { + "operationId": "secrets__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/_choices/{id}/": { + "get": { + "operationId": "secrets__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/secrets/generate-rsa-key-pair/": { + "get": { + "operationId": "secrets_generate-rsa-key-pair_list", + "description": "This endpoint can be used to generate a new RSA key pair. The keys are returned in PEM format.\n\n {\n \"public_key\": \"<public key>\",\n \"private_key\": \"<private key>\"\n }", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/get-session-key/": { + "post": { + "operationId": "secrets_get-session-key_create", + "description": "Retrieve a temporary session key to use for encrypting and decrypting secrets via the API. The user's private RSA\nkey is POSTed with the name `private_key`. An example:\n\n curl -v -X POST -H \"Authorization: Token <token>\" -H \"Accept: application/json; indent=4\" \\\n --data-urlencode \"private_key@<filename>\" https://netbox/api/secrets/get-session-key/\n\nThis request will yield a base64-encoded session key to be included in an `X-Session-Key` header in future requests:\n\n {\n \"session_key\": \"+8t4SI6XikgVmB5+/urhozx9O5qCQANyOk1MNe6taRf=\"\n }\n\nThis endpoint accepts one optional parameter: `preserve_key`. If True and a session key exists, the existing session\nkey will be returned instead of a new one.", + "parameters": [], + "responses": { + "201": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/secret-roles/": { + "get": { + "operationId": "secrets_secret-roles_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/SecretRole" + } + } + } + } + } + }, + "tags": [ + "secrets" + ] + }, + "post": { + "operationId": "secrets_secret-roles_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/secret-roles/{id}/": { + "get": { + "operationId": "secrets_secret-roles_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + }, + "tags": [ + "secrets" + ] + }, + "put": { + "operationId": "secrets_secret-roles_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + }, + "tags": [ + "secrets" + ] + }, + "patch": { + "operationId": "secrets_secret-roles_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/SecretRole" + } + } + }, + "tags": [ + "secrets" + ] + }, + "delete": { + "operationId": "secrets_secret-roles_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this secret role.", + "required": true, + "type": "integer" + } + ] + }, + "/secrets/secrets/": { + "get": { + "operationId": "secrets_secrets_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "device", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Secret" + } + } + } + } + } + }, + "tags": [ + "secrets" + ] + }, + "post": { + "operationId": "secrets_secrets_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [] + }, + "/secrets/secrets/{id}/": { + "get": { + "operationId": "secrets_secrets_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Secret" + } + } + }, + "tags": [ + "secrets" + ] + }, + "put": { + "operationId": "secrets_secrets_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + }, + "tags": [ + "secrets" + ] + }, + "patch": { + "operationId": "secrets_secrets_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableSecret" + } + } + }, + "tags": [ + "secrets" + ] + }, + "delete": { + "operationId": "secrets_secrets_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "secrets" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this secret.", + "required": true, + "type": "integer" + } + ] + }, + "/tenancy/_choices/": { + "get": { + "operationId": "tenancy__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [] + }, + "/tenancy/_choices/{id}/": { + "get": { + "operationId": "tenancy__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/tenancy/tenant-groups/": { + "get": { + "operationId": "tenancy_tenant-groups_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "slug", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/TenantGroup" + } + } + } + } + } + }, + "tags": [ + "tenancy" + ] + }, + "post": { + "operationId": "tenancy_tenant-groups_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [] + }, + "/tenancy/tenant-groups/{id}/": { + "get": { + "operationId": "tenancy_tenant-groups_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "put": { + "operationId": "tenancy_tenant-groups_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "patch": { + "operationId": "tenancy_tenant-groups_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/TenantGroup" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "delete": { + "operationId": "tenancy_tenant-groups_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this tenant group.", + "required": true, + "type": "integer" + } + ] + }, + "/tenancy/tenants/": { + "get": { + "operationId": "tenancy_tenants_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Tenant" + } + } + } + } + } + }, + "tags": [ + "tenancy" + ] + }, + "post": { + "operationId": "tenancy_tenants_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [] + }, + "/tenancy/tenants/{id}/": { + "get": { + "operationId": "tenancy_tenants_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Tenant" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "put": { + "operationId": "tenancy_tenants_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "patch": { + "operationId": "tenancy_tenants_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableTenant" + } + } + }, + "tags": [ + "tenancy" + ] + }, + "delete": { + "operationId": "tenancy_tenants_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "tenancy" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this tenant.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/_choices/": { + "get": { + "operationId": "virtualization__choices_list", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/_choices/{id}/": { + "get": { + "operationId": "virtualization__choices_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "type": "string" + } + ] + }, + "/virtualization/cluster-groups/": { + "get": { + "operationId": "virtualization_cluster-groups_list", + "description": "", + "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/ClusterGroup" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_cluster-groups_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/cluster-groups/{id}/": { + "get": { + "operationId": "virtualization_cluster-groups_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_cluster-groups_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_cluster-groups_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterGroup" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_cluster-groups_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this cluster group.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/cluster-types/": { + "get": { + "operationId": "virtualization_cluster-types_list", + "description": "", + "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/ClusterType" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_cluster-types_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/cluster-types/{id}/": { + "get": { + "operationId": "virtualization_cluster-types_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_cluster-types_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_cluster-types_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/ClusterType" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_cluster-types_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this cluster type.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/clusters/": { + "get": { + "operationId": "virtualization_clusters_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "type_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Cluster" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_clusters_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/clusters/{id}/": { + "get": { + "operationId": "virtualization_clusters_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Cluster" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_clusters_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_clusters_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableCluster" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_clusters_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this cluster.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/interfaces/": { + "get": { + "operationId": "virtualization_interfaces_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "enabled", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mtu", + "in": "query", + "description": "", + "required": false, + "type": "number" + }, + { + "name": "virtual_machine_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "virtual_machine", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "mac_address", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/Interface" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_interfaces_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/interfaces/{id}/": { + "get": { + "operationId": "virtualization_interfaces_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/Interface" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_interfaces_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_interfaces_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableInterface" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_interfaces_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this interface.", + "required": true, + "type": "integer" + } + ] + }, + "/virtualization/virtual-machines/": { + "get": { + "operationId": "virtualization_virtual-machines_list", + "description": "", + "parameters": [ + { + "name": "name", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "id__in", + "in": "query", + "description": "Multiple values may be separated by commas.", + "required": false, + "type": "number" + }, + { + "name": "q", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "status", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_group_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_group", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_type_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_type", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "cluster_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "site", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "role", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "tenant", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "platform_id", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "platform", + "in": "query", + "description": "", + "required": false, + "type": "string" + }, + { + "name": "limit", + "in": "query", + "description": "Number of results to return per page.", + "required": false, + "type": "integer" + }, + { + "name": "offset", + "in": "query", + "description": "The initial index from which to return the results.", + "required": false, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "required": [ + "count", + "results" + ], + "type": "object", + "properties": { + "count": { + "type": "integer" + }, + "next": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "previous": { + "type": "string", + "format": "uri", + "x-nullable": true + }, + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/VirtualMachine" + } + } + } + } + } + }, + "tags": [ + "virtualization" + ] + }, + "post": { + "operationId": "virtualization_virtual-machines_create", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachine" + } + } + ], + "responses": { + "201": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVirtualMachine" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [] + }, + "/virtualization/virtual-machines/{id}/": { + "get": { + "operationId": "virtualization_virtual-machines_read", + "description": "", + "parameters": [], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/VirtualMachine" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "put": { + "operationId": "virtualization_virtual-machines_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachine" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVirtualMachine" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "patch": { + "operationId": "virtualization_virtual-machines_partial_update", + "description": "", + "parameters": [ + { + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WritableVirtualMachine" + } + } + ], + "responses": { + "200": { + "description": "", + "schema": { + "$ref": "#/definitions/WritableVirtualMachine" + } + } + }, + "tags": [ + "virtualization" + ] + }, + "delete": { + "operationId": "virtualization_virtual-machines_delete", + "description": "", + "parameters": [], + "responses": { + "204": { + "description": "" + } + }, + "tags": [ + "virtualization" + ] + }, + "parameters": [ + { + "name": "id", + "in": "path", + "description": "A unique integer value identifying this virtual machine.", + "required": true, + "type": "integer" + } + ] + } + }, + "definitions": { + "NestedCircuit": { + "title": "Circuit", + "required": [ + "cid" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "cid": { + "title": "Circuit ID", + "type": "string", + "maxLength": 50 + } + } + }, + "NestedSite": { + "title": "Site", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "NestedDevice": { + "title": "Device", + "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 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + } + } + }, + "NestedInterface": { + "title": "Lag", + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + } + } + }, + "InterfaceNestedCircuit": { + "title": "Circuit", + "required": [ + "cid" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "cid": { + "title": "Circuit ID", + "type": "string", + "maxLength": 50 + } + } + }, + "InterfaceCircuitTermination": { + "title": "Circuit termination", + "required": [ + "circuit", + "term_side", + "port_speed" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "circuit": { + "$ref": "#/definitions/InterfaceNestedCircuit" + }, + "term_side": { + "title": "Termination", + "type": "string", + "enum": [ + "A", + "Z" + ] + }, + "port_speed": { + "title": "Port speed (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "upstream_speed": { + "title": "Upstream speed (Kbps)", + "description": "Upstream speed, if different from port speed", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "xconnect_id": { + "title": "Cross-connect ID", + "type": "string", + "maxLength": 50 + }, + "pp_info": { + "title": "Patch panel/port(s)", + "type": "string", + "maxLength": 100 + } + } + }, + "Interface": { + "title": "Interface", + "required": [ + "device", + "name", + "form_factor", + "lag", + "circuit_termination" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "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" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "is_connected": { + "title": "Is connected", + "type": "string", + "readOnly": true + }, + "interface_connection": { + "title": "Interface connection", + "type": "string", + "readOnly": true + }, + "circuit_termination": { + "$ref": "#/definitions/InterfaceCircuitTermination" + } + } + }, + "CircuitTermination": { + "required": [ + "circuit", + "term_side", + "site", + "interface", + "port_speed" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "circuit": { + "$ref": "#/definitions/NestedCircuit" + }, + "term_side": { + "title": "Termination", + "type": "string", + "enum": [ + "A", + "Z" + ] + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "interface": { + "$ref": "#/definitions/Interface" + }, + "port_speed": { + "title": "Port speed (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "upstream_speed": { + "title": "Upstream speed (Kbps)", + "description": "Upstream speed, if different from port speed", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "xconnect_id": { + "title": "Cross-connect ID", + "type": "string", + "maxLength": 50 + }, + "pp_info": { + "title": "Patch panel/port(s)", + "type": "string", + "maxLength": 100 + } + } + }, + "WritableCircuitTermination": { + "required": [ + "circuit", + "term_side", + "site", + "port_speed" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "circuit": { + "title": "Circuit", + "type": "integer" + }, + "term_side": { + "title": "Termination", + "type": "string", + "enum": [ + "A", + "Z" + ] + }, + "site": { + "title": "Site", + "type": "integer" + }, + "interface": { + "title": "Interface", + "type": "integer" + }, + "port_speed": { + "title": "Port speed (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "upstream_speed": { + "title": "Upstream speed (Kbps)", + "description": "Upstream speed, if different from port speed", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "xconnect_id": { + "title": "Cross-connect ID", + "type": "string", + "maxLength": 50 + }, + "pp_info": { + "title": "Patch panel/port(s)", + "type": "string", + "maxLength": 100 + } + } + }, + "CircuitType": { + "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 + } + } + }, + "NestedProvider": { + "title": "Provider", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "NestedCircuitType": { + "title": "Type", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "NestedTenant": { + "title": "Tenant", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 30 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "Circuit": { + "required": [ + "cid", + "provider", + "type", + "tenant" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "cid": { + "title": "Circuit ID", + "type": "string", + "maxLength": 50 + }, + "provider": { + "$ref": "#/definitions/NestedProvider" + }, + "type": { + "$ref": "#/definitions/NestedCircuitType" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "install_date": { + "title": "Date installed", + "type": "string", + "format": "date" + }, + "commit_rate": { + "title": "Commit rate (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableCircuit": { + "required": [ + "cid", + "provider", + "type" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "cid": { + "title": "Circuit ID", + "type": "string", + "maxLength": 50 + }, + "provider": { + "title": "Provider", + "type": "integer" + }, + "type": { + "title": "Type", + "type": "integer" + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "install_date": { + "title": "Date installed", + "type": "string", + "format": "date" + }, + "commit_rate": { + "title": "Commit rate (Kbps)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "Provider": { + "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 + }, + "asn": { + "title": "ASN", + "type": "integer", + "maximum": 4294967295, + "minimum": 1 + }, + "account": { + "title": "Account number", + "type": "string", + "maxLength": 30 + }, + "portal_url": { + "title": "Portal", + "type": "string", + "format": "uri", + "maxLength": 200 + }, + "noc_contact": { + "title": "NOC contact", + "type": "string" + }, + "admin_contact": { + "title": "Admin contact", + "type": "string" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableProvider": { + "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 + }, + "asn": { + "title": "ASN", + "type": "integer", + "maximum": 4294967295, + "minimum": 1 + }, + "account": { + "title": "Account number", + "type": "string", + "maxLength": 30 + }, + "portal_url": { + "title": "Portal", + "type": "string", + "format": "uri", + "maxLength": 200 + }, + "noc_contact": { + "title": "NOC contact", + "type": "string" + }, + "admin_contact": { + "title": "Admin contact", + "type": "string" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "ConsoleServerPort": { + "title": "Cs port", + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "connected_console": { + "title": "Connected console", + "type": "string", + "readOnly": true + } + } + }, + "ConsolePort": { + "required": [ + "device", + "name", + "cs_port" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "cs_port": { + "$ref": "#/definitions/ConsoleServerPort" + }, + "connection_status": { + "title": "Connection status", + "type": "boolean" + } + } + }, + "NestedManufacturer": { + "title": "Manufacturer", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "NestedDeviceType": { + "title": "Device type", + "required": [ + "manufacturer", + "model", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "manufacturer": { + "$ref": "#/definitions/NestedManufacturer" + }, + "model": { + "title": "Model", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "ConsolePortTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritableConsolePortTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "title": "Device type", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritableConsolePort": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "cs_port": { + "title": "Console server port", + "type": "integer" + }, + "connection_status": { + "title": "Connection status", + "type": "boolean" + } + } + }, + "ConsoleServerPortTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritableConsoleServerPortTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "title": "Device type", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritableConsoleServerPort": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "DeviceBayTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritableDeviceBayTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "title": "Device type", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "DeviceBay": { + "required": [ + "device", + "name", + "installed_device" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "installed_device": { + "$ref": "#/definitions/NestedDevice" + } + } + }, + "WritableDeviceBay": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "installed_device": { + "title": "Installed device", + "type": "integer" + } + } + }, + "DeviceRole": { + "required": [ + "name", + "slug", + "color" + ], + "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 + }, + "color": { + "title": "Color", + "type": "string", + "pattern": "^[0-9a-f]{6}$", + "maxLength": 6 + }, + "vm_role": { + "title": "VM Role", + "description": "Virtual machines may be assigned to this role", + "type": "boolean" + } + } + }, + "DeviceType": { + "required": [ + "manufacturer", + "model", + "slug", + "interface_ordering", + "subdevice_role" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "manufacturer": { + "$ref": "#/definitions/NestedManufacturer" + }, + "model": { + "title": "Model", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + }, + "part_number": { + "title": "Part number", + "description": "Discrete part number (optional)", + "type": "string", + "maxLength": 50 + }, + "u_height": { + "title": "Height (U)", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "is_full_depth": { + "title": "Is full depth", + "description": "Device consumes both front and rear rack faces", + "type": "boolean" + }, + "interface_ordering": { + "title": "Interface ordering", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "is_console_server": { + "title": "Is a console server", + "description": "This type of device has console server ports", + "type": "boolean" + }, + "is_pdu": { + "title": "Is a PDU", + "description": "This type of device has power outlets", + "type": "boolean" + }, + "is_network_device": { + "title": "Is a network device", + "description": "This type of device has network interfaces", + "type": "boolean" + }, + "subdevice_role": { + "title": "Subdevice role", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + } + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "instance_count": { + "title": "Instance count", + "type": "integer", + "readOnly": true + } + } + }, + "WritableDeviceType": { + "required": [ + "manufacturer", + "model", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "manufacturer": { + "title": "Manufacturer", + "type": "integer" + }, + "model": { + "title": "Model", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + }, + "part_number": { + "title": "Part number", + "description": "Discrete part number (optional)", + "type": "string", + "maxLength": 50 + }, + "u_height": { + "title": "Height (U)", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "is_full_depth": { + "title": "Is full depth", + "description": "Device consumes both front and rear rack faces", + "type": "boolean" + }, + "interface_ordering": { + "title": "Interface ordering", + "type": "integer", + "enum": [ + 1, + 2 + ] + }, + "is_console_server": { + "title": "Is a console server", + "description": "This type of device has console server ports", + "type": "boolean" + }, + "is_pdu": { + "title": "Is a PDU", + "description": "This type of device has power outlets", + "type": "boolean" + }, + "is_network_device": { + "title": "Is a network device", + "description": "This type of device has network interfaces", + "type": "boolean" + }, + "subdevice_role": { + "title": "Parent/child status", + "description": "Parent devices house child devices in device bays. Select \"None\" if this device type is neither a parent nor a child.", + "type": "boolean", + "enum": [ + null, + true, + false + ], + "x-nullable": true + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "NestedDeviceRole": { + "title": "Device role", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "NestedPlatform": { + "title": "Platform", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "NestedRack": { + "title": "Rack", + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + } + } + }, + "DeviceIPAddress": { + "title": "Primary ip", + "required": [ + "address" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "family": { + "title": "Family", + "type": "integer", + "readOnly": true + }, + "address": { + "title": "Address", + "description": "IPv4 or IPv6 address (with mask)", + "type": "string" + } + } + }, + "NestedCluster": { + "title": "Cluster", + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100 + } + } + }, + "Device": { + "required": [ + "device_type", + "device_role", + "tenant", + "platform", + "site", + "rack", + "position", + "face", + "status", + "primary_ip", + "primary_ip4", + "primary_ip6", + "cluster" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "device_role": { + "$ref": "#/definitions/NestedDeviceRole" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "platform": { + "$ref": "#/definitions/NestedPlatform" + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this device", + "type": "string", + "maxLength": 50 + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "rack": { + "$ref": "#/definitions/NestedRack" + }, + "position": { + "title": "Position (U)", + "description": "The lowest-numbered unit occupied by the device", + "type": "integer", + "maximum": 32767, + "minimum": 1 + }, + "face": { + "title": "Face", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + } + }, + "parent_device": { + "title": "Parent device", + "type": "string", + "readOnly": true + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "primary_ip": { + "$ref": "#/definitions/DeviceIPAddress" + }, + "primary_ip4": { + "$ref": "#/definitions/DeviceIPAddress" + }, + "primary_ip6": { + "$ref": "#/definitions/DeviceIPAddress" + }, + "cluster": { + "$ref": "#/definitions/NestedCluster" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableDevice": { + "required": [ + "device_type", + "device_role", + "site" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "device_type": { + "title": "Device type", + "type": "integer" + }, + "device_role": { + "title": "Device role", + "type": "integer" + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "platform": { + "title": "Platform", + "type": "integer" + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this device", + "type": "string", + "maxLength": 50 + }, + "site": { + "title": "Site", + "type": "integer" + }, + "rack": { + "title": "Rack", + "type": "integer" + }, + "position": { + "title": "Position (U)", + "description": "The lowest-numbered unit occupied by the device", + "type": "integer", + "maximum": 32767, + "minimum": 1 + }, + "face": { + "title": "Rack face", + "type": "integer", + "enum": [ + 0, + 1 + ] + }, + "status": { + "title": "Status", + "type": "integer", + "enum": [ + 1, + 0, + 2, + 3, + 4, + 5 + ] + }, + "primary_ip4": { + "title": "Primary IPv4", + "type": "integer" + }, + "primary_ip6": { + "title": "Primary IPv6", + "type": "integer" + }, + "cluster": { + "title": "Cluster", + "type": "integer" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "PeerInterface": { + "title": "Interface a", + "required": [ + "device", + "name", + "form_factor", + "lag" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "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" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "InterfaceConnection": { + "required": [ + "interface_a", + "interface_b", + "connection_status" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "interface_a": { + "$ref": "#/definitions/PeerInterface" + }, + "interface_b": { + "$ref": "#/definitions/PeerInterface" + }, + "connection_status": { + "title": "Connection status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "boolean", + "x-nullable": true + } + } + } + } + }, + "WritableInterfaceConnection": { + "required": [ + "interface_a", + "interface_b" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "interface_a": { + "title": "Interface a", + "type": "integer" + }, + "interface_b": { + "title": "Interface b", + "type": "integer" + }, + "connection_status": { + "title": "Status", + "type": "boolean" + } + } + }, + "InterfaceTemplate": { + "required": [ + "device_type", + "name", + "form_factor" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "form_factor": { + "title": "Form factor", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "mgmt_only": { + "title": "Management only", + "type": "boolean" + } + } + }, + "WritableInterfaceTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "title": "Device type", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "form_factor": { + "title": "Form factor", + "type": "integer", + "enum": [ + 0, + 200, + 800, + 1000, + 1150, + 1170, + 1050, + 1100, + 1200, + 1300, + 1310, + 1320, + 1350, + 1400, + 1500, + 1510, + 1520, + 1550, + 1600, + 2600, + 2610, + 2620, + 2630, + 2640, + 3010, + 3020, + 3040, + 3080, + 3160, + 4000, + 4010, + 4040, + 4050, + 5000, + 5050, + 5100, + 5150, + 5200, + 32767 + ] + }, + "mgmt_only": { + "title": "Management only", + "type": "boolean" + } + } + }, + "WritableInterface": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "form_factor": { + "title": "Form factor", + "type": "integer", + "enum": [ + 0, + 200, + 800, + 1000, + 1150, + 1170, + 1050, + 1100, + 1200, + 1300, + 1310, + 1320, + 1350, + 1400, + 1500, + 1510, + 1520, + 1550, + 1600, + 2600, + 2610, + 2620, + 2630, + 2640, + 3010, + 3020, + 3040, + 3080, + 3160, + 4000, + 4010, + 4040, + 4050, + 5000, + 5050, + 5100, + 5150, + 5200, + 32767 + ] + }, + "enabled": { + "title": "Enabled", + "type": "boolean" + }, + "lag": { + "title": "Parent LAG", + "type": "integer" + }, + "mtu": { + "title": "MTU", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "mac_address": { + "title": "MAC Address", + "type": "string" + }, + "mgmt_only": { + "title": "OOB Management", + "description": "This interface is used only for out-of-band management", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "InventoryItem": { + "required": [ + "device", + "parent", + "name", + "manufacturer" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "parent": { + "title": "Parent", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "manufacturer": { + "$ref": "#/definitions/NestedManufacturer" + }, + "part_id": { + "title": "Part ID", + "type": "string", + "maxLength": 50 + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this item", + "type": "string", + "maxLength": 50 + }, + "discovered": { + "title": "Discovered", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "WritableInventoryItem": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "parent": { + "title": "Parent", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "manufacturer": { + "title": "Manufacturer", + "type": "integer" + }, + "part_id": { + "title": "Part ID", + "type": "string", + "maxLength": 50 + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "asset_tag": { + "title": "Asset tag", + "description": "A unique tag used to identify this item", + "type": "string", + "maxLength": 50 + }, + "discovered": { + "title": "Discovered", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "Manufacturer": { + "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 + } + } + }, + "Platform": { + "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 + }, + "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", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "connected_port": { + "title": "Connected port", + "type": "string", + "readOnly": true + } + } + }, + "PowerPort": { + "required": [ + "device", + "name", + "power_outlet" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "power_outlet": { + "$ref": "#/definitions/PowerOutlet" + }, + "connection_status": { + "title": "Connection status", + "type": "boolean" + } + } + }, + "PowerOutletTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritablePowerOutletTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "title": "Device type", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritablePowerOutlet": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "PowerPortTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "$ref": "#/definitions/NestedDeviceType" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritablePowerPortTemplate": { + "required": [ + "device_type", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device_type": { + "title": "Device type", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + } + } + }, + "WritablePowerPort": { + "required": [ + "device", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "power_outlet": { + "title": "Power outlet", + "type": "integer" + }, + "connection_status": { + "title": "Connection status", + "type": "boolean" + } + } + }, + "RackGroup": { + "required": [ + "name", + "slug", + "site" + ], + "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 + }, + "site": { + "$ref": "#/definitions/NestedSite" + } + } + }, + "WritableRackGroup": { + "required": [ + "name", + "slug", + "site" + ], + "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 + }, + "site": { + "title": "Site", + "type": "integer" + } + } + }, + "RackReservation": { + "required": [ + "rack", + "units", + "user", + "description" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "rack": { + "$ref": "#/definitions/NestedRack" + }, + "units": { + "type": "array", + "items": { + "title": "Units", + "type": "integer", + "maximum": 32767, + "minimum": 0 + } + }, + "created": { + "title": "Created", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "user": { + "title": "User", + "type": "integer" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "WritableRackReservation": { + "required": [ + "rack", + "units", + "user", + "description" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "rack": { + "title": "Rack", + "type": "integer" + }, + "units": { + "type": "array", + "items": { + "title": "Units", + "type": "integer", + "maximum": 32767, + "minimum": 0 + } + }, + "user": { + "title": "User", + "type": "integer" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "RackRole": { + "required": [ + "name", + "slug", + "color" + ], + "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 + }, + "color": { + "title": "Color", + "type": "string", + "pattern": "^[0-9a-f]{6}$", + "maxLength": 6 + } + } + }, + "NestedRackGroup": { + "title": "Group", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "NestedRackRole": { + "title": "Role", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "Rack": { + "required": [ + "name", + "facility_id", + "site", + "group", + "tenant", + "role", + "type", + "width" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "facility_id": { + "title": "Facility ID", + "type": "string", + "maxLength": 50 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "group": { + "$ref": "#/definitions/NestedRackGroup" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "role": { + "$ref": "#/definitions/NestedRackRole" + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "width": { + "title": "Width", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "u_height": { + "title": "Height (U)", + "type": "integer", + "maximum": 100, + "minimum": 1 + }, + "desc_units": { + "title": "Descending units", + "description": "Units are numbered top-to-bottom", + "type": "boolean" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableRack": { + "required": [ + "name", + "site" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "facility_id": { + "title": "Facility ID", + "type": "string", + "maxLength": 50 + }, + "site": { + "title": "Site", + "type": "integer" + }, + "group": { + "title": "Group", + "type": "integer" + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "role": { + "title": "Role", + "type": "integer" + }, + "serial": { + "title": "Serial number", + "type": "string", + "maxLength": 50 + }, + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 100, + 200, + 300, + 1000, + 1100 + ] + }, + "width": { + "title": "Width", + "description": "Rail-to-rail width", + "type": "integer", + "enum": [ + 19, + 23 + ] + }, + "u_height": { + "title": "Height (U)", + "type": "integer", + "maximum": 100, + "minimum": 1 + }, + "desc_units": { + "title": "Descending units", + "description": "Units are numbered top-to-bottom", + "type": "boolean" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "NestedRegion": { + "title": "Parent", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "Region": { + "required": [ + "name", + "slug", + "parent" + ], + "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 + }, + "parent": { + "$ref": "#/definitions/NestedRegion" + } + } + }, + "WritableRegion": { + "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 + }, + "parent": { + "title": "Parent", + "type": "integer" + } + } + }, + "Site": { + "required": [ + "name", + "slug", + "region", + "tenant" + ], + "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 + }, + "region": { + "$ref": "#/definitions/NestedRegion" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "facility": { + "title": "Facility", + "type": "string", + "maxLength": 50 + }, + "asn": { + "title": "ASN", + "type": "integer", + "maximum": 4294967295, + "minimum": 1 + }, + "physical_address": { + "title": "Physical address", + "type": "string", + "maxLength": 200 + }, + "shipping_address": { + "title": "Shipping address", + "type": "string", + "maxLength": 200 + }, + "contact_name": { + "title": "Contact name", + "type": "string", + "maxLength": 50 + }, + "contact_phone": { + "title": "Contact phone", + "type": "string", + "maxLength": 20 + }, + "contact_email": { + "title": "Contact E-mail", + "type": "string", + "format": "email", + "maxLength": 254 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + }, + "count_prefixes": { + "title": "Count prefixes", + "type": "string", + "readOnly": true + }, + "count_vlans": { + "title": "Count vlans", + "type": "string", + "readOnly": true + }, + "count_racks": { + "title": "Count racks", + "type": "string", + "readOnly": true + }, + "count_devices": { + "title": "Count devices", + "type": "string", + "readOnly": true + }, + "count_circuits": { + "title": "Count circuits", + "type": "string", + "readOnly": true + } + } + }, + "WritableSite": { + "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 + }, + "region": { + "title": "Region", + "type": "integer" + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "facility": { + "title": "Facility", + "type": "string", + "maxLength": 50 + }, + "asn": { + "title": "ASN", + "type": "integer", + "maximum": 4294967295, + "minimum": 1 + }, + "physical_address": { + "title": "Physical address", + "type": "string", + "maxLength": 200 + }, + "shipping_address": { + "title": "Shipping address", + "type": "string", + "maxLength": 200 + }, + "contact_name": { + "title": "Contact name", + "type": "string", + "maxLength": 50 + }, + "contact_phone": { + "title": "Contact phone", + "type": "string", + "maxLength": 20 + }, + "contact_email": { + "title": "Contact E-mail", + "type": "string", + "format": "email", + "maxLength": 254 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "ExportTemplate": { + "required": [ + "content_type", + "name", + "template_code" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "content_type": { + "title": "Content type", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100 + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 200 + }, + "template_code": { + "title": "Template code", + "type": "string" + }, + "mime_type": { + "title": "Mime type", + "type": "string", + "maxLength": 15 + }, + "file_extension": { + "title": "File extension", + "type": "string", + "maxLength": 15 + } + } + }, + "Graph": { + "required": [ + "type", + "name", + "source" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "type": { + "title": "Type", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "weight": { + "title": "Weight", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100 + }, + "source": { + "title": "Source URL", + "type": "string", + "maxLength": 500 + }, + "link": { + "title": "Link URL", + "type": "string", + "format": "uri", + "maxLength": 200 + } + } + }, + "WritableGraph": { + "required": [ + "type", + "name", + "source" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "type": { + "title": "Type", + "type": "integer", + "enum": [ + 100, + 200, + 300 + ] + }, + "weight": { + "title": "Weight", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100 + }, + "source": { + "title": "Source URL", + "type": "string", + "maxLength": 500 + }, + "link": { + "title": "Link URL", + "type": "string", + "format": "uri", + "maxLength": 200 + } + } + }, + "ImageAttachment": { + "required": [ + "image", + "image_height", + "image_width" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "parent": { + "title": "Parent", + "type": "string", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "image": { + "title": "Image", + "type": "string", + "readOnly": true, + "format": "uri" + }, + "image_height": { + "title": "Image height", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "image_width": { + "title": "Image width", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "created": { + "title": "Created", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "WritableImageAttachment": { + "required": [ + "content_type", + "object_id", + "image" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "content_type": { + "title": "Content type", + "type": "string" + }, + "object_id": { + "title": "Object id", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "image": { + "title": "Image", + "type": "string", + "readOnly": true, + "format": "uri" + } + } + }, + "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", + "action" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "time": { + "title": "Time", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "user": { + "$ref": "#/definitions/NestedUser" + }, + "action": { + "title": "Action", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "message": { + "title": "Message", + "type": "string" + } + } + }, + "TopologyMap": { + "required": [ + "name", + "slug", + "site", + "device_patterns" + ], + "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 + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "device_patterns": { + "title": "Device patterns", + "description": "Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined.", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "WritableTopologyMap": { + "required": [ + "name", + "slug", + "device_patterns" + ], + "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 + }, + "site": { + "title": "Site", + "type": "integer" + }, + "device_patterns": { + "title": "Device patterns", + "description": "Identify devices to include in the diagram using regular expressions, one per line. Each line will result in a new tier of the drawing. Separate multiple regexes within a line using semicolons. Devices will be rendered in the order they are defined.", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "NestedRIR": { + "title": "Rir", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "Aggregate": { + "required": [ + "family", + "prefix", + "rir" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "family": { + "title": "Family", + "type": "integer", + "enum": [ + 4, + 6 + ] + }, + "prefix": { + "title": "Prefix", + "type": "string" + }, + "rir": { + "$ref": "#/definitions/NestedRIR" + }, + "date_added": { + "title": "Date added", + "type": "string", + "format": "date" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableAggregate": { + "required": [ + "prefix", + "rir" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "prefix": { + "title": "Prefix", + "type": "string" + }, + "rir": { + "title": "RIR", + "type": "integer" + }, + "date_added": { + "title": "Date added", + "type": "string", + "format": "date" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "NestedVRF": { + "title": "Vrf", + "required": [ + "name", + "rd" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "rd": { + "title": "Route distinguisher", + "type": "string", + "maxLength": 21 + } + } + }, + "NestedVirtualMachine": { + "title": "Virtual machine", + "required": [ + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 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" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "is_connected": { + "title": "Is connected", + "type": "string", + "readOnly": true + }, + "interface_connection": { + "title": "Interface connection", + "type": "string", + "readOnly": true + }, + "circuit_termination": { + "$ref": "#/definitions/InterfaceCircuitTermination" + } + } + }, + "NestedIPAddress": { + "title": "Nat inside", + "required": [ + "address" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "family": { + "title": "Family", + "type": "integer", + "readOnly": true + }, + "address": { + "title": "Address", + "description": "IPv4 or IPv6 address (with mask)", + "type": "string" + } + } + }, + "IPAddress": { + "required": [ + "address", + "vrf", + "tenant", + "status", + "role", + "interface", + "nat_inside", + "nat_outside" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "family": { + "title": "Family", + "type": "integer", + "readOnly": true + }, + "address": { + "title": "Address", + "description": "IPv4 or IPv6 address (with mask)", + "type": "string" + }, + "vrf": { + "$ref": "#/definitions/NestedVRF" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "role": { + "title": "Role", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "interface": { + "$ref": "#/definitions/IPAddressInterface" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "nat_inside": { + "$ref": "#/definitions/NestedIPAddress" + }, + "nat_outside": { + "$ref": "#/definitions/NestedIPAddress" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableIPAddress": { + "required": [ + "address" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "address": { + "title": "Address", + "description": "IPv4 or IPv6 address (with mask)", + "type": "string" + }, + "vrf": { + "title": "VRF", + "type": "integer" + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "status": { + "title": "Status", + "description": "The operational status of this IP", + "type": "integer", + "enum": [ + 1, + 2, + 3, + 5 + ] + }, + "role": { + "title": "Role", + "description": "The functional role of this IP", + "type": "integer", + "enum": [ + 10, + 20, + 30, + 40, + 41, + 42, + 43, + 44 + ] + }, + "interface": { + "title": "Interface", + "type": "integer" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "nat_inside": { + "title": "NAT (Inside)", + "description": "The IP for which this address is the \"outside\" IP", + "type": "integer" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "NestedVLAN": { + "title": "Vlan", + "required": [ + "vid", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "vid": { + "title": "ID", + "type": "integer", + "maximum": 4094, + "minimum": 1 + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + } + } + }, + "NestedRole": { + "title": "Role", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "Prefix": { + "required": [ + "prefix", + "site", + "vrf", + "tenant", + "vlan", + "status", + "role" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "family": { + "title": "Family", + "type": "integer", + "readOnly": true + }, + "prefix": { + "title": "Prefix", + "description": "IPv4 or IPv6 network with mask", + "type": "string" + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "vrf": { + "$ref": "#/definitions/NestedVRF" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "vlan": { + "$ref": "#/definitions/NestedVLAN" + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "role": { + "$ref": "#/definitions/NestedRole" + }, + "is_pool": { + "title": "Is a pool", + "description": "All IP addresses within this prefix are considered usable", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritablePrefix": { + "required": [ + "prefix" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "prefix": { + "title": "Prefix", + "description": "IPv4 or IPv6 network with mask", + "type": "string" + }, + "site": { + "title": "Site", + "type": "integer" + }, + "vrf": { + "title": "VRF", + "type": "integer" + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "vlan": { + "title": "VLAN", + "type": "integer" + }, + "status": { + "title": "Status", + "description": "Operational status of this prefix", + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3 + ] + }, + "role": { + "title": "Role", + "description": "The primary function of this prefix", + "type": "integer" + }, + "is_pool": { + "title": "Is a pool", + "description": "All IP addresses within this prefix are considered usable", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "RIR": { + "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 + }, + "is_private": { + "title": "Private", + "description": "IP space managed by this RIR is considered private", + "type": "boolean" + } + } + }, + "Role": { + "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 + }, + "weight": { + "title": "Weight", + "type": "integer", + "maximum": 32767, + "minimum": 0 + } + } + }, + "Service": { + "required": [ + "device", + "virtual_machine", + "name", + "port", + "protocol", + "ipaddresses" + ], + "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": 30 + }, + "port": { + "title": "Port number", + "type": "integer", + "maximum": 65535, + "minimum": 1 + }, + "protocol": { + "title": "Protocol", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "ipaddresses": { + "type": "array", + "items": { + "$ref": "#/definitions/NestedIPAddress" + } + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "WritableService": { + "required": [ + "name", + "port", + "protocol" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "virtual_machine": { + "title": "Virtual machine", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 30 + }, + "port": { + "title": "Port number", + "type": "integer", + "maximum": 65535, + "minimum": 1 + }, + "protocol": { + "title": "Protocol", + "type": "integer", + "enum": [ + 6, + 17 + ] + }, + "ipaddresses": { + "type": "array", + "items": { + "title": "IP addresses", + "type": "integer" + }, + "uniqueItems": true + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + } + } + }, + "VLANGroup": { + "required": [ + "name", + "slug", + "site" + ], + "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 + }, + "site": { + "$ref": "#/definitions/NestedSite" + } + } + }, + "WritableVLANGroup": { + "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 + }, + "site": { + "title": "Site", + "type": "integer" + } + } + }, + "NestedVLANGroup": { + "title": "Group", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "VLAN": { + "required": [ + "site", + "group", + "vid", + "name", + "tenant", + "status", + "role" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "group": { + "$ref": "#/definitions/NestedVLANGroup" + }, + "vid": { + "title": "ID", + "type": "integer", + "maximum": 4094, + "minimum": 1 + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "role": { + "$ref": "#/definitions/NestedRole" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableVLAN": { + "required": [ + "vid", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "site": { + "title": "Site", + "type": "integer" + }, + "group": { + "title": "Group", + "type": "integer" + }, + "vid": { + "title": "ID", + "type": "integer", + "maximum": 4094, + "minimum": 1 + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "status": { + "title": "Status", + "type": "integer", + "enum": [ + 1, + 2, + 3 + ] + }, + "role": { + "title": "Role", + "type": "integer" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "VRF": { + "required": [ + "name", + "rd", + "tenant" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "rd": { + "title": "Route distinguisher", + "type": "string", + "maxLength": 21 + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "enforce_unique": { + "title": "Enforce unique space", + "description": "Prevent duplicate prefixes/IP addresses within this VRF", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "display_name": { + "title": "Display name", + "type": "string", + "readOnly": true + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableVRF": { + "required": [ + "name", + "rd" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "rd": { + "title": "Route distinguisher", + "type": "string", + "maxLength": 21 + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "enforce_unique": { + "title": "Enforce unique space", + "description": "Prevent duplicate prefixes/IP addresses within this VRF", + "type": "boolean" + }, + "description": { + "title": "Description", + "type": "string", + "maxLength": 100 + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "SecretRole": { + "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 + } + } + }, + "NestedSecretRole": { + "title": "Role", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "Secret": { + "required": [ + "device", + "role", + "name" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "$ref": "#/definitions/NestedDevice" + }, + "role": { + "$ref": "#/definitions/NestedSecretRole" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100 + }, + "plaintext": { + "title": "Plaintext", + "type": "string", + "readOnly": true + }, + "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 + } + } + }, + "WritableSecret": { + "required": [ + "device", + "role", + "plaintext" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "device": { + "title": "Device", + "type": "integer" + }, + "role": { + "title": "Role", + "type": "integer" + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100 + }, + "plaintext": { + "title": "Plaintext", + "type": "string" + } + } + }, + "TenantGroup": { + "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 + } + } + }, + "NestedTenantGroup": { + "title": "Group", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "Tenant": { + "required": [ + "name", + "slug", + "group" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 30 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + }, + "group": { + "$ref": "#/definitions/NestedTenantGroup" + }, + "description": { + "title": "Description", + "description": "Long-form name (optional)", + "type": "string", + "maxLength": 100 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableTenant": { + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 30 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + }, + "group": { + "title": "Group", + "type": "integer" + }, + "description": { + "title": "Description", + "description": "Long-form name (optional)", + "type": "string", + "maxLength": 100 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "ClusterGroup": { + "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 + } + } + }, + "ClusterType": { + "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 + } + } + }, + "NestedClusterType": { + "title": "Type", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "NestedClusterGroup": { + "title": "Group", + "required": [ + "name", + "slug" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 50 + }, + "slug": { + "title": "Slug", + "type": "string", + "format": "slug", + "pattern": "^[-a-zA-Z0-9_]+$", + "maxLength": 50 + } + } + }, + "Cluster": { + "required": [ + "name", + "type", + "group", + "site" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100 + }, + "type": { + "$ref": "#/definitions/NestedClusterType" + }, + "group": { + "$ref": "#/definitions/NestedClusterGroup" + }, + "site": { + "$ref": "#/definitions/NestedSite" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableCluster": { + "required": [ + "name", + "type" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 100 + }, + "type": { + "title": "Type", + "type": "integer" + }, + "group": { + "title": "Group", + "type": "integer" + }, + "site": { + "title": "Site", + "type": "integer" + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "VirtualMachineIPAddress": { + "title": "Primary ip", + "required": [ + "address" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "url": { + "title": "Url", + "type": "string", + "format": "uri", + "readOnly": true + }, + "family": { + "title": "Family", + "type": "integer", + "readOnly": true + }, + "address": { + "title": "Address", + "description": "IPv4 or IPv6 address (with mask)", + "type": "string" + } + } + }, + "VirtualMachine": { + "required": [ + "name", + "status", + "cluster", + "role", + "tenant", + "platform", + "primary_ip", + "primary_ip4", + "primary_ip6" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "status": { + "title": "Status", + "required": [ + "label", + "value" + ], + "type": "object", + "properties": { + "label": { + "type": "string" + }, + "value": { + "type": "integer" + } + } + }, + "cluster": { + "$ref": "#/definitions/NestedCluster" + }, + "role": { + "$ref": "#/definitions/NestedDeviceRole" + }, + "tenant": { + "$ref": "#/definitions/NestedTenant" + }, + "platform": { + "$ref": "#/definitions/NestedPlatform" + }, + "primary_ip": { + "$ref": "#/definitions/VirtualMachineIPAddress" + }, + "primary_ip4": { + "$ref": "#/definitions/VirtualMachineIPAddress" + }, + "primary_ip6": { + "$ref": "#/definitions/VirtualMachineIPAddress" + }, + "vcpus": { + "title": "VCPUs", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "memory": { + "title": "Memory (MB)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "disk": { + "title": "Disk (GB)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + }, + "WritableVirtualMachine": { + "required": [ + "name", + "cluster" + ], + "type": "object", + "properties": { + "id": { + "title": "ID", + "type": "integer", + "readOnly": true + }, + "name": { + "title": "Name", + "type": "string", + "maxLength": 64 + }, + "status": { + "title": "Status", + "type": "integer", + "enum": [ + 1, + 0, + 3 + ] + }, + "cluster": { + "title": "Cluster", + "type": "integer" + }, + "role": { + "title": "Role", + "type": "integer" + }, + "tenant": { + "title": "Tenant", + "type": "integer" + }, + "platform": { + "title": "Platform", + "type": "integer" + }, + "primary_ip4": { + "title": "Primary IPv4", + "type": "integer" + }, + "primary_ip6": { + "title": "Primary IPv6", + "type": "integer" + }, + "vcpus": { + "title": "VCPUs", + "type": "integer", + "maximum": 32767, + "minimum": 0 + }, + "memory": { + "title": "Memory (MB)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "disk": { + "title": "Disk (GB)", + "type": "integer", + "maximum": 2147483647, + "minimum": 0 + }, + "comments": { + "title": "Comments", + "type": "string" + }, + "custom_fields": { + "title": "Custom fields", + "type": "object" + } + } + } + } +}