github.com/digitalocean/go-netbox@v0.0.2/netbox/client/ipam/ipam_vrfs_read_parameters.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright 2020 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 18 package ipam 19 20 // This file was generated by the swagger tool. 21 // Editing this file might prove futile when you re-run the swagger generate command 22 23 import ( 24 "context" 25 "net/http" 26 "time" 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/strfmt" 32 "github.com/go-openapi/swag" 33 ) 34 35 // NewIpamVrfsReadParams creates a new IpamVrfsReadParams object, 36 // with the default timeout for this client. 37 // 38 // Default values are not hydrated, since defaults are normally applied by the API server side. 39 // 40 // To enforce default values in parameter, use SetDefaults or WithDefaults. 41 func NewIpamVrfsReadParams() *IpamVrfsReadParams { 42 return &IpamVrfsReadParams{ 43 timeout: cr.DefaultTimeout, 44 } 45 } 46 47 // NewIpamVrfsReadParamsWithTimeout creates a new IpamVrfsReadParams object 48 // with the ability to set a timeout on a request. 49 func NewIpamVrfsReadParamsWithTimeout(timeout time.Duration) *IpamVrfsReadParams { 50 return &IpamVrfsReadParams{ 51 timeout: timeout, 52 } 53 } 54 55 // NewIpamVrfsReadParamsWithContext creates a new IpamVrfsReadParams object 56 // with the ability to set a context for a request. 57 func NewIpamVrfsReadParamsWithContext(ctx context.Context) *IpamVrfsReadParams { 58 return &IpamVrfsReadParams{ 59 Context: ctx, 60 } 61 } 62 63 // NewIpamVrfsReadParamsWithHTTPClient creates a new IpamVrfsReadParams object 64 // with the ability to set a custom HTTPClient for a request. 65 func NewIpamVrfsReadParamsWithHTTPClient(client *http.Client) *IpamVrfsReadParams { 66 return &IpamVrfsReadParams{ 67 HTTPClient: client, 68 } 69 } 70 71 /* IpamVrfsReadParams contains all the parameters to send to the API endpoint 72 for the ipam vrfs read operation. 73 74 Typically these are written to a http.Request. 75 */ 76 type IpamVrfsReadParams struct { 77 78 /* ID. 79 80 A unique integer value identifying this VRF. 81 */ 82 ID int64 83 84 timeout time.Duration 85 Context context.Context 86 HTTPClient *http.Client 87 } 88 89 // WithDefaults hydrates default values in the ipam vrfs read params (not the query body). 90 // 91 // All values with no default are reset to their zero value. 92 func (o *IpamVrfsReadParams) WithDefaults() *IpamVrfsReadParams { 93 o.SetDefaults() 94 return o 95 } 96 97 // SetDefaults hydrates default values in the ipam vrfs read params (not the query body). 98 // 99 // All values with no default are reset to their zero value. 100 func (o *IpamVrfsReadParams) SetDefaults() { 101 // no default values defined for this parameter 102 } 103 104 // WithTimeout adds the timeout to the ipam vrfs read params 105 func (o *IpamVrfsReadParams) WithTimeout(timeout time.Duration) *IpamVrfsReadParams { 106 o.SetTimeout(timeout) 107 return o 108 } 109 110 // SetTimeout adds the timeout to the ipam vrfs read params 111 func (o *IpamVrfsReadParams) SetTimeout(timeout time.Duration) { 112 o.timeout = timeout 113 } 114 115 // WithContext adds the context to the ipam vrfs read params 116 func (o *IpamVrfsReadParams) WithContext(ctx context.Context) *IpamVrfsReadParams { 117 o.SetContext(ctx) 118 return o 119 } 120 121 // SetContext adds the context to the ipam vrfs read params 122 func (o *IpamVrfsReadParams) SetContext(ctx context.Context) { 123 o.Context = ctx 124 } 125 126 // WithHTTPClient adds the HTTPClient to the ipam vrfs read params 127 func (o *IpamVrfsReadParams) WithHTTPClient(client *http.Client) *IpamVrfsReadParams { 128 o.SetHTTPClient(client) 129 return o 130 } 131 132 // SetHTTPClient adds the HTTPClient to the ipam vrfs read params 133 func (o *IpamVrfsReadParams) SetHTTPClient(client *http.Client) { 134 o.HTTPClient = client 135 } 136 137 // WithID adds the id to the ipam vrfs read params 138 func (o *IpamVrfsReadParams) WithID(id int64) *IpamVrfsReadParams { 139 o.SetID(id) 140 return o 141 } 142 143 // SetID adds the id to the ipam vrfs read params 144 func (o *IpamVrfsReadParams) SetID(id int64) { 145 o.ID = id 146 } 147 148 // WriteToRequest writes these params to a swagger request 149 func (o *IpamVrfsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 150 151 if err := r.SetTimeout(o.timeout); err != nil { 152 return err 153 } 154 var res []error 155 156 // path param id 157 if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil { 158 return err 159 } 160 161 if len(res) > 0 { 162 return errors.CompositeValidationError(res...) 163 } 164 return nil 165 }