/
servers_advanced_threat_protection_setting_types_gen.go
219 lines (182 loc) · 10.3 KB
/
servers_advanced_threat_protection_setting_types_gen.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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package storage
import (
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// +kubebuilder:rbac:groups=sql.azure.com,resources=serversadvancedthreatprotectionsettings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=sql.azure.com,resources={serversadvancedthreatprotectionsettings/status,serversadvancedthreatprotectionsettings/finalizers},verbs=get;update;patch
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Storage version of v1api20211101.ServersAdvancedThreatProtectionSetting
// Generator information:
// - Generated from: /sql/resource-manager/Microsoft.Sql/stable/2021-11-01/ServerAdvancedThreatProtectionSettings.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/Default
type ServersAdvancedThreatProtectionSetting struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec Servers_AdvancedThreatProtectionSetting_Spec `json:"spec,omitempty"`
Status Servers_AdvancedThreatProtectionSetting_STATUS `json:"status,omitempty"`
}
var _ conditions.Conditioner = &ServersAdvancedThreatProtectionSetting{}
// GetConditions returns the conditions of the resource
func (setting *ServersAdvancedThreatProtectionSetting) GetConditions() conditions.Conditions {
return setting.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (setting *ServersAdvancedThreatProtectionSetting) SetConditions(conditions conditions.Conditions) {
setting.Status.Conditions = conditions
}
var _ genruntime.KubernetesResource = &ServersAdvancedThreatProtectionSetting{}
// AzureName returns the Azure name of the resource (always "Default")
func (setting *ServersAdvancedThreatProtectionSetting) AzureName() string {
return "Default"
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-11-01"
func (setting ServersAdvancedThreatProtectionSetting) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetResourceScope returns the scope of the resource
func (setting *ServersAdvancedThreatProtectionSetting) GetResourceScope() genruntime.ResourceScope {
return genruntime.ResourceScopeResourceGroup
}
// GetSpec returns the specification of this resource
func (setting *ServersAdvancedThreatProtectionSetting) GetSpec() genruntime.ConvertibleSpec {
return &setting.Spec
}
// GetStatus returns the status of this resource
func (setting *ServersAdvancedThreatProtectionSetting) GetStatus() genruntime.ConvertibleStatus {
return &setting.Status
}
// GetSupportedOperations returns the operations supported by the resource
func (setting *ServersAdvancedThreatProtectionSetting) GetSupportedOperations() []genruntime.ResourceOperation {
return []genruntime.ResourceOperation{
genruntime.ResourceOperationGet,
genruntime.ResourceOperationPut,
}
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.Sql/servers/advancedThreatProtectionSettings"
func (setting *ServersAdvancedThreatProtectionSetting) GetType() string {
return "Microsoft.Sql/servers/advancedThreatProtectionSettings"
}
// NewEmptyStatus returns a new empty (blank) status
func (setting *ServersAdvancedThreatProtectionSetting) NewEmptyStatus() genruntime.ConvertibleStatus {
return &Servers_AdvancedThreatProtectionSetting_STATUS{}
}
// Owner returns the ResourceReference of the owner
func (setting *ServersAdvancedThreatProtectionSetting) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(setting.Spec)
return setting.Spec.Owner.AsResourceReference(group, kind)
}
// SetStatus sets the status of this resource
func (setting *ServersAdvancedThreatProtectionSetting) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*Servers_AdvancedThreatProtectionSetting_STATUS); ok {
setting.Status = *st
return nil
}
// Convert status to required version
var st Servers_AdvancedThreatProtectionSetting_STATUS
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
setting.Status = st
return nil
}
// Hub marks that this ServersAdvancedThreatProtectionSetting is the hub type for conversion
func (setting *ServersAdvancedThreatProtectionSetting) Hub() {}
// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (setting *ServersAdvancedThreatProtectionSetting) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: setting.Spec.OriginalVersion,
Kind: "ServersAdvancedThreatProtectionSetting",
}
}
// +kubebuilder:object:root=true
// Storage version of v1api20211101.ServersAdvancedThreatProtectionSetting
// Generator information:
// - Generated from: /sql/resource-manager/Microsoft.Sql/stable/2021-11-01/ServerAdvancedThreatProtectionSettings.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/Default
type ServersAdvancedThreatProtectionSettingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ServersAdvancedThreatProtectionSetting `json:"items"`
}
// Storage version of v1api20211101.Servers_AdvancedThreatProtectionSetting_Spec
type Servers_AdvancedThreatProtectionSetting_Spec struct {
OriginalVersion string `json:"originalVersion,omitempty"`
// +kubebuilder:validation:Required
// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
// reference to a sql.azure.com/Server resource
Owner *genruntime.KnownResourceReference `group:"sql.azure.com" json:"owner,omitempty" kind:"Server"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
State *string `json:"state,omitempty"`
}
var _ genruntime.ConvertibleSpec = &Servers_AdvancedThreatProtectionSetting_Spec{}
// ConvertSpecFrom populates our Servers_AdvancedThreatProtectionSetting_Spec from the provided source
func (setting *Servers_AdvancedThreatProtectionSetting_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
if source == setting {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return source.ConvertSpecTo(setting)
}
// ConvertSpecTo populates the provided destination from our Servers_AdvancedThreatProtectionSetting_Spec
func (setting *Servers_AdvancedThreatProtectionSetting_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
if destination == setting {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return destination.ConvertSpecFrom(setting)
}
// Storage version of v1api20211101.Servers_AdvancedThreatProtectionSetting_STATUS
type Servers_AdvancedThreatProtectionSetting_STATUS struct {
Conditions []conditions.Condition `json:"conditions,omitempty"`
CreationTime *string `json:"creationTime,omitempty"`
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
State *string `json:"state,omitempty"`
SystemData *SystemData_STATUS `json:"systemData,omitempty"`
Type *string `json:"type,omitempty"`
}
var _ genruntime.ConvertibleStatus = &Servers_AdvancedThreatProtectionSetting_STATUS{}
// ConvertStatusFrom populates our Servers_AdvancedThreatProtectionSetting_STATUS from the provided source
func (setting *Servers_AdvancedThreatProtectionSetting_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
if source == setting {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return source.ConvertStatusTo(setting)
}
// ConvertStatusTo populates the provided destination from our Servers_AdvancedThreatProtectionSetting_STATUS
func (setting *Servers_AdvancedThreatProtectionSetting_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
if destination == setting {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return destination.ConvertStatusFrom(setting)
}
// Storage version of v1api20211101.SystemData_STATUS
// Metadata pertaining to creation and last modification of the resource.
type SystemData_STATUS struct {
CreatedAt *string `json:"createdAt,omitempty"`
CreatedBy *string `json:"createdBy,omitempty"`
CreatedByType *string `json:"createdByType,omitempty"`
LastModifiedAt *string `json:"lastModifiedAt,omitempty"`
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
LastModifiedByType *string `json:"lastModifiedByType,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
func init() {
SchemeBuilder.Register(&ServersAdvancedThreatProtectionSetting{}, &ServersAdvancedThreatProtectionSettingList{})
}