blob: 200dc0a29d9cdfa32dad598e1eceebb2de8f570b [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
32 strfmt "github.com/go-openapi/strfmt"
33
34 "github.com/digitalocean/go-netbox/netbox/models"
35)
36
37// NewDcimManufacturersCreateParams creates a new DcimManufacturersCreateParams object
38// with the default values initialized.
39func NewDcimManufacturersCreateParams() *DcimManufacturersCreateParams {
40 var ()
41 return &DcimManufacturersCreateParams{
42
43 timeout: cr.DefaultTimeout,
44 }
45}
46
47// NewDcimManufacturersCreateParamsWithTimeout creates a new DcimManufacturersCreateParams object
48// with the default values initialized, and the ability to set a timeout on a request
49func NewDcimManufacturersCreateParamsWithTimeout(timeout time.Duration) *DcimManufacturersCreateParams {
50 var ()
51 return &DcimManufacturersCreateParams{
52
53 timeout: timeout,
54 }
55}
56
57// NewDcimManufacturersCreateParamsWithContext creates a new DcimManufacturersCreateParams object
58// with the default values initialized, and the ability to set a context for a request
59func NewDcimManufacturersCreateParamsWithContext(ctx context.Context) *DcimManufacturersCreateParams {
60 var ()
61 return &DcimManufacturersCreateParams{
62
63 Context: ctx,
64 }
65}
66
67// NewDcimManufacturersCreateParamsWithHTTPClient creates a new DcimManufacturersCreateParams object
68// with the default values initialized, and the ability to set a custom HTTPClient for a request
69func NewDcimManufacturersCreateParamsWithHTTPClient(client *http.Client) *DcimManufacturersCreateParams {
70 var ()
71 return &DcimManufacturersCreateParams{
72 HTTPClient: client,
73 }
74}
75
76/*DcimManufacturersCreateParams contains all the parameters to send to the API endpoint
77for the dcim manufacturers create operation typically these are written to a http.Request
78*/
79type DcimManufacturersCreateParams struct {
80
81 /*Data*/
82 Data *models.Manufacturer
83
84 timeout time.Duration
85 Context context.Context
86 HTTPClient *http.Client
87}
88
89// WithTimeout adds the timeout to the dcim manufacturers create params
90func (o *DcimManufacturersCreateParams) WithTimeout(timeout time.Duration) *DcimManufacturersCreateParams {
91 o.SetTimeout(timeout)
92 return o
93}
94
95// SetTimeout adds the timeout to the dcim manufacturers create params
96func (o *DcimManufacturersCreateParams) SetTimeout(timeout time.Duration) {
97 o.timeout = timeout
98}
99
100// WithContext adds the context to the dcim manufacturers create params
101func (o *DcimManufacturersCreateParams) WithContext(ctx context.Context) *DcimManufacturersCreateParams {
102 o.SetContext(ctx)
103 return o
104}
105
106// SetContext adds the context to the dcim manufacturers create params
107func (o *DcimManufacturersCreateParams) SetContext(ctx context.Context) {
108 o.Context = ctx
109}
110
111// WithHTTPClient adds the HTTPClient to the dcim manufacturers create params
112func (o *DcimManufacturersCreateParams) WithHTTPClient(client *http.Client) *DcimManufacturersCreateParams {
113 o.SetHTTPClient(client)
114 return o
115}
116
117// SetHTTPClient adds the HTTPClient to the dcim manufacturers create params
118func (o *DcimManufacturersCreateParams) SetHTTPClient(client *http.Client) {
119 o.HTTPClient = client
120}
121
122// WithData adds the data to the dcim manufacturers create params
123func (o *DcimManufacturersCreateParams) WithData(data *models.Manufacturer) *DcimManufacturersCreateParams {
124 o.SetData(data)
125 return o
126}
127
128// SetData adds the data to the dcim manufacturers create params
129func (o *DcimManufacturersCreateParams) SetData(data *models.Manufacturer) {
130 o.Data = data
131}
132
133// WriteToRequest writes these params to a swagger request
134func (o *DcimManufacturersCreateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
135
136 if err := r.SetTimeout(o.timeout); err != nil {
137 return err
138 }
139 var res []error
140
141 if o.Data != nil {
142 if err := r.SetBodyParam(o.Data); err != nil {
143 return err
144 }
145 }
146
147 if len(res) > 0 {
148 return errors.CompositeValidationError(res...)
149 }
150 return nil
151}