/
get_clusters_by_age_parameters.go
132 lines (107 loc) · 3.49 KB
/
get_clusters_by_age_parameters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-swagger/go-swagger/client"
"github.com/go-swagger/go-swagger/errors"
strfmt "github.com/go-swagger/go-swagger/strfmt"
)
// NewGetClustersByAgeParams creates a new GetClustersByAgeParams object
// with the default values initialized.
func NewGetClustersByAgeParams() *GetClustersByAgeParams {
var ()
return &GetClustersByAgeParams{}
}
/*GetClustersByAgeParams contains all the parameters to send to the API endpoint
for the get clusters by age operation typically these are written to a http.Request
*/
type GetClustersByAgeParams struct {
/*CheckedInAfter*/
CheckedInAfter *strfmt.DateTime
/*CheckedInBefore*/
CheckedInBefore *strfmt.DateTime
/*CreatedAfter*/
CreatedAfter *strfmt.DateTime
/*CreatedBefore*/
CreatedBefore *strfmt.DateTime
}
// WithCheckedInAfter adds the checkedInAfter to the get clusters by age params
func (o *GetClustersByAgeParams) WithCheckedInAfter(checkedInAfter *strfmt.DateTime) *GetClustersByAgeParams {
o.CheckedInAfter = checkedInAfter
return o
}
// WithCheckedInBefore adds the checkedInBefore to the get clusters by age params
func (o *GetClustersByAgeParams) WithCheckedInBefore(checkedInBefore *strfmt.DateTime) *GetClustersByAgeParams {
o.CheckedInBefore = checkedInBefore
return o
}
// WithCreatedAfter adds the createdAfter to the get clusters by age params
func (o *GetClustersByAgeParams) WithCreatedAfter(createdAfter *strfmt.DateTime) *GetClustersByAgeParams {
o.CreatedAfter = createdAfter
return o
}
// WithCreatedBefore adds the createdBefore to the get clusters by age params
func (o *GetClustersByAgeParams) WithCreatedBefore(createdBefore *strfmt.DateTime) *GetClustersByAgeParams {
o.CreatedBefore = createdBefore
return o
}
// WriteToRequest writes these params to a swagger request
func (o *GetClustersByAgeParams) WriteToRequest(r client.Request, reg strfmt.Registry) error {
var res []error
if o.CheckedInAfter != nil {
// query param checked_in_after
var qrCheckedInAfter strfmt.DateTime
if o.CheckedInAfter != nil {
qrCheckedInAfter = *o.CheckedInAfter
}
qCheckedInAfter := qrCheckedInAfter.String()
if qCheckedInAfter != "" {
if err := r.SetQueryParam("checked_in_after", qCheckedInAfter); err != nil {
return err
}
}
}
if o.CheckedInBefore != nil {
// query param checked_in_before
var qrCheckedInBefore strfmt.DateTime
if o.CheckedInBefore != nil {
qrCheckedInBefore = *o.CheckedInBefore
}
qCheckedInBefore := qrCheckedInBefore.String()
if qCheckedInBefore != "" {
if err := r.SetQueryParam("checked_in_before", qCheckedInBefore); err != nil {
return err
}
}
}
if o.CreatedAfter != nil {
// query param created_after
var qrCreatedAfter strfmt.DateTime
if o.CreatedAfter != nil {
qrCreatedAfter = *o.CreatedAfter
}
qCreatedAfter := qrCreatedAfter.String()
if qCreatedAfter != "" {
if err := r.SetQueryParam("created_after", qCreatedAfter); err != nil {
return err
}
}
}
if o.CreatedBefore != nil {
// query param created_before
var qrCreatedBefore strfmt.DateTime
if o.CreatedBefore != nil {
qrCreatedBefore = *o.CreatedBefore
}
qCreatedBefore := qrCreatedBefore.String()
if qCreatedBefore != "" {
if err := r.SetQueryParam("created_before", qCreatedBefore); err != nil {
return err
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}