blob: 36a52c3483381863cd3daec44ba7267e4a390fbe [file] [log] [blame]
Serge Bazanskicc25bdf2018-10-25 14:02:58 +02001// 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
17package 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
22import (
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 "github.com/digitalocean/go-netbox/netbox/models"
36)
37
38// NewDcimPowerOutletTemplatesPartialUpdateParams creates a new DcimPowerOutletTemplatesPartialUpdateParams object
39// with the default values initialized.
40func NewDcimPowerOutletTemplatesPartialUpdateParams() *DcimPowerOutletTemplatesPartialUpdateParams {
41 var ()
42 return &DcimPowerOutletTemplatesPartialUpdateParams{
43
44 timeout: cr.DefaultTimeout,
45 }
46}
47
48// NewDcimPowerOutletTemplatesPartialUpdateParamsWithTimeout creates a new DcimPowerOutletTemplatesPartialUpdateParams object
49// with the default values initialized, and the ability to set a timeout on a request
50func NewDcimPowerOutletTemplatesPartialUpdateParamsWithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesPartialUpdateParams {
51 var ()
52 return &DcimPowerOutletTemplatesPartialUpdateParams{
53
54 timeout: timeout,
55 }
56}
57
58// NewDcimPowerOutletTemplatesPartialUpdateParamsWithContext creates a new DcimPowerOutletTemplatesPartialUpdateParams object
59// with the default values initialized, and the ability to set a context for a request
60func NewDcimPowerOutletTemplatesPartialUpdateParamsWithContext(ctx context.Context) *DcimPowerOutletTemplatesPartialUpdateParams {
61 var ()
62 return &DcimPowerOutletTemplatesPartialUpdateParams{
63
64 Context: ctx,
65 }
66}
67
68// NewDcimPowerOutletTemplatesPartialUpdateParamsWithHTTPClient creates a new DcimPowerOutletTemplatesPartialUpdateParams object
69// with the default values initialized, and the ability to set a custom HTTPClient for a request
70func NewDcimPowerOutletTemplatesPartialUpdateParamsWithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesPartialUpdateParams {
71 var ()
72 return &DcimPowerOutletTemplatesPartialUpdateParams{
73 HTTPClient: client,
74 }
75}
76
77/*DcimPowerOutletTemplatesPartialUpdateParams contains all the parameters to send to the API endpoint
78for the dcim power outlet templates partial update operation typically these are written to a http.Request
79*/
80type DcimPowerOutletTemplatesPartialUpdateParams struct {
81
82 /*Data*/
83 Data *models.WritablePowerOutletTemplate
84 /*ID
85 A unique integer value identifying this power outlet template.
86
87 */
88 ID int64
89
90 timeout time.Duration
91 Context context.Context
92 HTTPClient *http.Client
93}
94
95// WithTimeout adds the timeout to the dcim power outlet templates partial update params
96func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithTimeout(timeout time.Duration) *DcimPowerOutletTemplatesPartialUpdateParams {
97 o.SetTimeout(timeout)
98 return o
99}
100
101// SetTimeout adds the timeout to the dcim power outlet templates partial update params
102func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetTimeout(timeout time.Duration) {
103 o.timeout = timeout
104}
105
106// WithContext adds the context to the dcim power outlet templates partial update params
107func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithContext(ctx context.Context) *DcimPowerOutletTemplatesPartialUpdateParams {
108 o.SetContext(ctx)
109 return o
110}
111
112// SetContext adds the context to the dcim power outlet templates partial update params
113func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetContext(ctx context.Context) {
114 o.Context = ctx
115}
116
117// WithHTTPClient adds the HTTPClient to the dcim power outlet templates partial update params
118func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithHTTPClient(client *http.Client) *DcimPowerOutletTemplatesPartialUpdateParams {
119 o.SetHTTPClient(client)
120 return o
121}
122
123// SetHTTPClient adds the HTTPClient to the dcim power outlet templates partial update params
124func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetHTTPClient(client *http.Client) {
125 o.HTTPClient = client
126}
127
128// WithData adds the data to the dcim power outlet templates partial update params
129func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithData(data *models.WritablePowerOutletTemplate) *DcimPowerOutletTemplatesPartialUpdateParams {
130 o.SetData(data)
131 return o
132}
133
134// SetData adds the data to the dcim power outlet templates partial update params
135func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetData(data *models.WritablePowerOutletTemplate) {
136 o.Data = data
137}
138
139// WithID adds the id to the dcim power outlet templates partial update params
140func (o *DcimPowerOutletTemplatesPartialUpdateParams) WithID(id int64) *DcimPowerOutletTemplatesPartialUpdateParams {
141 o.SetID(id)
142 return o
143}
144
145// SetID adds the id to the dcim power outlet templates partial update params
146func (o *DcimPowerOutletTemplatesPartialUpdateParams) SetID(id int64) {
147 o.ID = id
148}
149
150// WriteToRequest writes these params to a swagger request
151func (o *DcimPowerOutletTemplatesPartialUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
152
153 if err := r.SetTimeout(o.timeout); err != nil {
154 return err
155 }
156 var res []error
157
158 if o.Data != nil {
159 if err := r.SetBodyParam(o.Data); err != nil {
160 return err
161 }
162 }
163
164 // path param id
165 if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
166 return err
167 }
168
169 if len(res) > 0 {
170 return errors.CompositeValidationError(res...)
171 }
172 return nil
173}