Serge Bazanski | cc25bdf | 2018-10-25 14:02:58 +0200 | [diff] [blame] | 1 | // Code generated by go-swagger; DO NOT EDIT. |
| 2 | |
| 3 | // Copyright 2018 The go-netbox Authors. |
| 4 | // |
| 5 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | // you may not use this file except in compliance with the License. |
| 7 | // You may obtain a copy of the License at |
| 8 | // |
| 9 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | // |
| 11 | // Unless required by applicable law or agreed to in writing, software |
| 12 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | // See the License for the specific language governing permissions and |
| 15 | // limitations under the License. |
| 16 | |
| 17 | package dcim |
| 18 | |
| 19 | // This file was generated by the swagger tool. |
| 20 | // Editing this file might prove futile when you re-run the swagger generate command |
| 21 | |
| 22 | import ( |
| 23 | "net/http" |
| 24 | "time" |
| 25 | |
| 26 | "golang.org/x/net/context" |
| 27 | |
| 28 | "github.com/go-openapi/errors" |
| 29 | "github.com/go-openapi/runtime" |
| 30 | cr "github.com/go-openapi/runtime/client" |
| 31 | "github.com/go-openapi/swag" |
| 32 | |
| 33 | strfmt "github.com/go-openapi/strfmt" |
| 34 | ) |
| 35 | |
| 36 | // NewDcimDevicesDeleteParams creates a new DcimDevicesDeleteParams object |
| 37 | // with the default values initialized. |
| 38 | func NewDcimDevicesDeleteParams() *DcimDevicesDeleteParams { |
| 39 | var () |
| 40 | return &DcimDevicesDeleteParams{ |
| 41 | |
| 42 | timeout: cr.DefaultTimeout, |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | // NewDcimDevicesDeleteParamsWithTimeout creates a new DcimDevicesDeleteParams object |
| 47 | // with the default values initialized, and the ability to set a timeout on a request |
| 48 | func NewDcimDevicesDeleteParamsWithTimeout(timeout time.Duration) *DcimDevicesDeleteParams { |
| 49 | var () |
| 50 | return &DcimDevicesDeleteParams{ |
| 51 | |
| 52 | timeout: timeout, |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | // NewDcimDevicesDeleteParamsWithContext creates a new DcimDevicesDeleteParams object |
| 57 | // with the default values initialized, and the ability to set a context for a request |
| 58 | func NewDcimDevicesDeleteParamsWithContext(ctx context.Context) *DcimDevicesDeleteParams { |
| 59 | var () |
| 60 | return &DcimDevicesDeleteParams{ |
| 61 | |
| 62 | Context: ctx, |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | // NewDcimDevicesDeleteParamsWithHTTPClient creates a new DcimDevicesDeleteParams object |
| 67 | // with the default values initialized, and the ability to set a custom HTTPClient for a request |
| 68 | func NewDcimDevicesDeleteParamsWithHTTPClient(client *http.Client) *DcimDevicesDeleteParams { |
| 69 | var () |
| 70 | return &DcimDevicesDeleteParams{ |
| 71 | HTTPClient: client, |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | /*DcimDevicesDeleteParams contains all the parameters to send to the API endpoint |
| 76 | for the dcim devices delete operation typically these are written to a http.Request |
| 77 | */ |
| 78 | type DcimDevicesDeleteParams struct { |
| 79 | |
| 80 | /*ID |
| 81 | A unique integer value identifying this device. |
| 82 | |
| 83 | */ |
| 84 | ID int64 |
| 85 | |
| 86 | timeout time.Duration |
| 87 | Context context.Context |
| 88 | HTTPClient *http.Client |
| 89 | } |
| 90 | |
| 91 | // WithTimeout adds the timeout to the dcim devices delete params |
| 92 | func (o *DcimDevicesDeleteParams) WithTimeout(timeout time.Duration) *DcimDevicesDeleteParams { |
| 93 | o.SetTimeout(timeout) |
| 94 | return o |
| 95 | } |
| 96 | |
| 97 | // SetTimeout adds the timeout to the dcim devices delete params |
| 98 | func (o *DcimDevicesDeleteParams) SetTimeout(timeout time.Duration) { |
| 99 | o.timeout = timeout |
| 100 | } |
| 101 | |
| 102 | // WithContext adds the context to the dcim devices delete params |
| 103 | func (o *DcimDevicesDeleteParams) WithContext(ctx context.Context) *DcimDevicesDeleteParams { |
| 104 | o.SetContext(ctx) |
| 105 | return o |
| 106 | } |
| 107 | |
| 108 | // SetContext adds the context to the dcim devices delete params |
| 109 | func (o *DcimDevicesDeleteParams) SetContext(ctx context.Context) { |
| 110 | o.Context = ctx |
| 111 | } |
| 112 | |
| 113 | // WithHTTPClient adds the HTTPClient to the dcim devices delete params |
| 114 | func (o *DcimDevicesDeleteParams) WithHTTPClient(client *http.Client) *DcimDevicesDeleteParams { |
| 115 | o.SetHTTPClient(client) |
| 116 | return o |
| 117 | } |
| 118 | |
| 119 | // SetHTTPClient adds the HTTPClient to the dcim devices delete params |
| 120 | func (o *DcimDevicesDeleteParams) SetHTTPClient(client *http.Client) { |
| 121 | o.HTTPClient = client |
| 122 | } |
| 123 | |
| 124 | // WithID adds the id to the dcim devices delete params |
| 125 | func (o *DcimDevicesDeleteParams) WithID(id int64) *DcimDevicesDeleteParams { |
| 126 | o.SetID(id) |
| 127 | return o |
| 128 | } |
| 129 | |
| 130 | // SetID adds the id to the dcim devices delete params |
| 131 | func (o *DcimDevicesDeleteParams) SetID(id int64) { |
| 132 | o.ID = id |
| 133 | } |
| 134 | |
| 135 | // WriteToRequest writes these params to a swagger request |
| 136 | func (o *DcimDevicesDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { |
| 137 | |
| 138 | if err := r.SetTimeout(o.timeout); err != nil { |
| 139 | return err |
| 140 | } |
| 141 | var res []error |
| 142 | |
| 143 | // path param id |
| 144 | if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { |
| 145 | return err |
| 146 | } |
| 147 | |
| 148 | if len(res) > 0 { |
| 149 | return errors.CompositeValidationError(res...) |
| 150 | } |
| 151 | return nil |
| 152 | } |