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