github.com/digitalocean/go-netbox@v0.0.2/netbox/client/extras/extras_reports_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 extras 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 ) 33 34 // NewExtrasReportsReadParams creates a new ExtrasReportsReadParams object, 35 // with the default timeout for this client. 36 // 37 // Default values are not hydrated, since defaults are normally applied by the API server side. 38 // 39 // To enforce default values in parameter, use SetDefaults or WithDefaults. 40 func NewExtrasReportsReadParams() *ExtrasReportsReadParams { 41 return &ExtrasReportsReadParams{ 42 timeout: cr.DefaultTimeout, 43 } 44 } 45 46 // NewExtrasReportsReadParamsWithTimeout creates a new ExtrasReportsReadParams object 47 // with the ability to set a timeout on a request. 48 func NewExtrasReportsReadParamsWithTimeout(timeout time.Duration) *ExtrasReportsReadParams { 49 return &ExtrasReportsReadParams{ 50 timeout: timeout, 51 } 52 } 53 54 // NewExtrasReportsReadParamsWithContext creates a new ExtrasReportsReadParams object 55 // with the ability to set a context for a request. 56 func NewExtrasReportsReadParamsWithContext(ctx context.Context) *ExtrasReportsReadParams { 57 return &ExtrasReportsReadParams{ 58 Context: ctx, 59 } 60 } 61 62 // NewExtrasReportsReadParamsWithHTTPClient creates a new ExtrasReportsReadParams object 63 // with the ability to set a custom HTTPClient for a request. 64 func NewExtrasReportsReadParamsWithHTTPClient(client *http.Client) *ExtrasReportsReadParams { 65 return &ExtrasReportsReadParams{ 66 HTTPClient: client, 67 } 68 } 69 70 /* ExtrasReportsReadParams contains all the parameters to send to the API endpoint 71 for the extras reports read operation. 72 73 Typically these are written to a http.Request. 74 */ 75 type ExtrasReportsReadParams struct { 76 77 // ID. 78 ID string 79 80 timeout time.Duration 81 Context context.Context 82 HTTPClient *http.Client 83 } 84 85 // WithDefaults hydrates default values in the extras reports read params (not the query body). 86 // 87 // All values with no default are reset to their zero value. 88 func (o *ExtrasReportsReadParams) WithDefaults() *ExtrasReportsReadParams { 89 o.SetDefaults() 90 return o 91 } 92 93 // SetDefaults hydrates default values in the extras reports read params (not the query body). 94 // 95 // All values with no default are reset to their zero value. 96 func (o *ExtrasReportsReadParams) SetDefaults() { 97 // no default values defined for this parameter 98 } 99 100 // WithTimeout adds the timeout to the extras reports read params 101 func (o *ExtrasReportsReadParams) WithTimeout(timeout time.Duration) *ExtrasReportsReadParams { 102 o.SetTimeout(timeout) 103 return o 104 } 105 106 // SetTimeout adds the timeout to the extras reports read params 107 func (o *ExtrasReportsReadParams) SetTimeout(timeout time.Duration) { 108 o.timeout = timeout 109 } 110 111 // WithContext adds the context to the extras reports read params 112 func (o *ExtrasReportsReadParams) WithContext(ctx context.Context) *ExtrasReportsReadParams { 113 o.SetContext(ctx) 114 return o 115 } 116 117 // SetContext adds the context to the extras reports read params 118 func (o *ExtrasReportsReadParams) SetContext(ctx context.Context) { 119 o.Context = ctx 120 } 121 122 // WithHTTPClient adds the HTTPClient to the extras reports read params 123 func (o *ExtrasReportsReadParams) WithHTTPClient(client *http.Client) *ExtrasReportsReadParams { 124 o.SetHTTPClient(client) 125 return o 126 } 127 128 // SetHTTPClient adds the HTTPClient to the extras reports read params 129 func (o *ExtrasReportsReadParams) SetHTTPClient(client *http.Client) { 130 o.HTTPClient = client 131 } 132 133 // WithID adds the id to the extras reports read params 134 func (o *ExtrasReportsReadParams) WithID(id string) *ExtrasReportsReadParams { 135 o.SetID(id) 136 return o 137 } 138 139 // SetID adds the id to the extras reports read params 140 func (o *ExtrasReportsReadParams) SetID(id string) { 141 o.ID = id 142 } 143 144 // WriteToRequest writes these params to a swagger request 145 func (o *ExtrasReportsReadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { 146 147 if err := r.SetTimeout(o.timeout); err != nil { 148 return err 149 } 150 var res []error 151 152 // path param id 153 if err := r.SetPathParam("id", o.ID); err != nil { 154 return err 155 } 156 157 if len(res) > 0 { 158 return errors.CompositeValidationError(res...) 159 } 160 return nil 161 }