generated from broadinstitute/golang-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
v2controllers_editable_environment.go
187 lines (143 loc) · 5.43 KB
/
v2controllers_editable_environment.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// V2controllersEditableEnvironment v2controllers editable environment
//
// swagger:model v2controllers.EditableEnvironment
type V2controllersEditableEnvironment struct {
// auto delete
AutoDelete *EnvironmentAutoDelete `json:"autoDelete,omitempty"`
// base domain
BaseDomain *string `json:"baseDomain,omitempty"`
// default cluster
DefaultCluster string `json:"defaultCluster,omitempty"`
// should be the environment branch for live envs. Is usually dev for template/dynamic but not necessarily
DefaultFirecloudDevelopRef *string `json:"defaultFirecloudDevelopRef,omitempty"`
// description
Description string `json:"description,omitempty"`
// helmfile ref
HelmfileRef *string `json:"helmfileRef,omitempty"`
// name prefixes domain
NamePrefixesDomain *bool `json:"namePrefixesDomain,omitempty"`
// Applicable for BEEs only, whether Thelma should render the BEE as "offline" zero replicas (this field is a target state, not a status)
Offline *bool `json:"offline,omitempty"`
// When enabled, the BEE will be slated to go offline around the begin time each day
OfflineScheduleBeginEnabled bool `json:"offlineScheduleBeginEnabled,omitempty"`
// Stored with timezone to determine day of the week
// Format: date-time
OfflineScheduleBeginTime strfmt.DateTime `json:"offlineScheduleBeginTime,omitempty"`
// When enabled, the BEE will be slated to come online around the end time each weekday (each day if weekends enabled)
OfflineScheduleEndEnabled bool `json:"offlineScheduleEndEnabled,omitempty"`
// Stored with timezone to determine day of the week
// Format: date-time
OfflineScheduleEndTime strfmt.DateTime `json:"offlineScheduleEndTime,omitempty"`
// offline schedule end weekends
OfflineScheduleEndWeekends bool `json:"offlineScheduleEndWeekends,omitempty"`
// When creating, will default to you
Owner string `json:"owner,omitempty"`
// pagerduty integration
PagerdutyIntegration string `json:"pagerdutyIntegration,omitempty"`
// Used to protect specific BEEs from deletion (thelma checks this field)
PreventDeletion *bool `json:"preventDeletion,omitempty"`
// requires suitability
RequiresSuitability *bool `json:"requiresSuitability,omitempty"`
}
// Validate validates this v2controllers editable environment
func (m *V2controllersEditableEnvironment) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAutoDelete(formats); err != nil {
res = append(res, err)
}
if err := m.validateOfflineScheduleBeginTime(formats); err != nil {
res = append(res, err)
}
if err := m.validateOfflineScheduleEndTime(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V2controllersEditableEnvironment) validateAutoDelete(formats strfmt.Registry) error {
if swag.IsZero(m.AutoDelete) { // not required
return nil
}
if m.AutoDelete != nil {
if err := m.AutoDelete.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("autoDelete")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("autoDelete")
}
return err
}
}
return nil
}
func (m *V2controllersEditableEnvironment) validateOfflineScheduleBeginTime(formats strfmt.Registry) error {
if swag.IsZero(m.OfflineScheduleBeginTime) { // not required
return nil
}
if err := validate.FormatOf("offlineScheduleBeginTime", "body", "date-time", m.OfflineScheduleBeginTime.String(), formats); err != nil {
return err
}
return nil
}
func (m *V2controllersEditableEnvironment) validateOfflineScheduleEndTime(formats strfmt.Registry) error {
if swag.IsZero(m.OfflineScheduleEndTime) { // not required
return nil
}
if err := validate.FormatOf("offlineScheduleEndTime", "body", "date-time", m.OfflineScheduleEndTime.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validate this v2controllers editable environment based on the context it is used
func (m *V2controllersEditableEnvironment) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := m.contextValidateAutoDelete(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *V2controllersEditableEnvironment) contextValidateAutoDelete(ctx context.Context, formats strfmt.Registry) error {
if m.AutoDelete != nil {
if err := m.AutoDelete.ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("autoDelete")
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("autoDelete")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *V2controllersEditableEnvironment) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *V2controllersEditableEnvironment) UnmarshalBinary(b []byte) error {
var res V2controllersEditableEnvironment
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}