blob: 9e0f8e6c297ff20358c4c2d5d8b25d74eaa4fa0b [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 secrets
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// NewSecretsSecretsUpdateParams creates a new SecretsSecretsUpdateParams object
39// with the default values initialized.
40func NewSecretsSecretsUpdateParams() *SecretsSecretsUpdateParams {
41 var ()
42 return &SecretsSecretsUpdateParams{
43
44 timeout: cr.DefaultTimeout,
45 }
46}
47
48// NewSecretsSecretsUpdateParamsWithTimeout creates a new SecretsSecretsUpdateParams object
49// with the default values initialized, and the ability to set a timeout on a request
50func NewSecretsSecretsUpdateParamsWithTimeout(timeout time.Duration) *SecretsSecretsUpdateParams {
51 var ()
52 return &SecretsSecretsUpdateParams{
53
54 timeout: timeout,
55 }
56}
57
58// NewSecretsSecretsUpdateParamsWithContext creates a new SecretsSecretsUpdateParams object
59// with the default values initialized, and the ability to set a context for a request
60func NewSecretsSecretsUpdateParamsWithContext(ctx context.Context) *SecretsSecretsUpdateParams {
61 var ()
62 return &SecretsSecretsUpdateParams{
63
64 Context: ctx,
65 }
66}
67
68// NewSecretsSecretsUpdateParamsWithHTTPClient creates a new SecretsSecretsUpdateParams object
69// with the default values initialized, and the ability to set a custom HTTPClient for a request
70func NewSecretsSecretsUpdateParamsWithHTTPClient(client *http.Client) *SecretsSecretsUpdateParams {
71 var ()
72 return &SecretsSecretsUpdateParams{
73 HTTPClient: client,
74 }
75}
76
77/*SecretsSecretsUpdateParams contains all the parameters to send to the API endpoint
78for the secrets secrets update operation typically these are written to a http.Request
79*/
80type SecretsSecretsUpdateParams struct {
81
82 /*Data*/
83 Data *models.WritableSecret
84 /*ID
85 A unique integer value identifying this secret.
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 secrets secrets update params
96func (o *SecretsSecretsUpdateParams) WithTimeout(timeout time.Duration) *SecretsSecretsUpdateParams {
97 o.SetTimeout(timeout)
98 return o
99}
100
101// SetTimeout adds the timeout to the secrets secrets update params
102func (o *SecretsSecretsUpdateParams) SetTimeout(timeout time.Duration) {
103 o.timeout = timeout
104}
105
106// WithContext adds the context to the secrets secrets update params
107func (o *SecretsSecretsUpdateParams) WithContext(ctx context.Context) *SecretsSecretsUpdateParams {
108 o.SetContext(ctx)
109 return o
110}
111
112// SetContext adds the context to the secrets secrets update params
113func (o *SecretsSecretsUpdateParams) SetContext(ctx context.Context) {
114 o.Context = ctx
115}
116
117// WithHTTPClient adds the HTTPClient to the secrets secrets update params
118func (o *SecretsSecretsUpdateParams) WithHTTPClient(client *http.Client) *SecretsSecretsUpdateParams {
119 o.SetHTTPClient(client)
120 return o
121}
122
123// SetHTTPClient adds the HTTPClient to the secrets secrets update params
124func (o *SecretsSecretsUpdateParams) SetHTTPClient(client *http.Client) {
125 o.HTTPClient = client
126}
127
128// WithData adds the data to the secrets secrets update params
129func (o *SecretsSecretsUpdateParams) WithData(data *models.WritableSecret) *SecretsSecretsUpdateParams {
130 o.SetData(data)
131 return o
132}
133
134// SetData adds the data to the secrets secrets update params
135func (o *SecretsSecretsUpdateParams) SetData(data *models.WritableSecret) {
136 o.Data = data
137}
138
139// WithID adds the id to the secrets secrets update params
140func (o *SecretsSecretsUpdateParams) WithID(id int64) *SecretsSecretsUpdateParams {
141 o.SetID(id)
142 return o
143}
144
145// SetID adds the id to the secrets secrets update params
146func (o *SecretsSecretsUpdateParams) SetID(id int64) {
147 o.ID = id
148}
149
150// WriteToRequest writes these params to a swagger request
151func (o *SecretsSecretsUpdateParams) 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}