/
mongodb_database_throughput_setting_types_gen.go
579 lines (478 loc) · 24.3 KB
/
mongodb_database_throughput_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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20210515storage
import (
"fmt"
v20210515s "github.com/Azure/azure-service-operator/v2/api/documentdb/v1api20210515storage"
"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"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +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 v1beta20210515.MongodbDatabaseThroughputSetting
// Deprecated version of MongodbDatabaseThroughputSetting. Use v1api20210515.MongodbDatabaseThroughputSetting instead
type MongodbDatabaseThroughputSetting struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec `json:"spec,omitempty"`
Status DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS `json:"status,omitempty"`
}
var _ conditions.Conditioner = &MongodbDatabaseThroughputSetting{}
// GetConditions returns the conditions of the resource
func (setting *MongodbDatabaseThroughputSetting) GetConditions() conditions.Conditions {
return setting.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (setting *MongodbDatabaseThroughputSetting) SetConditions(conditions conditions.Conditions) {
setting.Status.Conditions = conditions
}
var _ conversion.Convertible = &MongodbDatabaseThroughputSetting{}
// ConvertFrom populates our MongodbDatabaseThroughputSetting from the provided hub MongodbDatabaseThroughputSetting
func (setting *MongodbDatabaseThroughputSetting) ConvertFrom(hub conversion.Hub) error {
source, ok := hub.(*v20210515s.MongodbDatabaseThroughputSetting)
if !ok {
return fmt.Errorf("expected documentdb/v1api20210515storage/MongodbDatabaseThroughputSetting but received %T instead", hub)
}
return setting.AssignProperties_From_MongodbDatabaseThroughputSetting(source)
}
// ConvertTo populates the provided hub MongodbDatabaseThroughputSetting from our MongodbDatabaseThroughputSetting
func (setting *MongodbDatabaseThroughputSetting) ConvertTo(hub conversion.Hub) error {
destination, ok := hub.(*v20210515s.MongodbDatabaseThroughputSetting)
if !ok {
return fmt.Errorf("expected documentdb/v1api20210515storage/MongodbDatabaseThroughputSetting but received %T instead", hub)
}
return setting.AssignProperties_To_MongodbDatabaseThroughputSetting(destination)
}
var _ genruntime.KubernetesResource = &MongodbDatabaseThroughputSetting{}
// AzureName returns the Azure name of the resource (always "default")
func (setting *MongodbDatabaseThroughputSetting) AzureName() string {
return "default"
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-05-15"
func (setting MongodbDatabaseThroughputSetting) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetResourceScope returns the scope of the resource
func (setting *MongodbDatabaseThroughputSetting) GetResourceScope() genruntime.ResourceScope {
return genruntime.ResourceScopeResourceGroup
}
// GetSpec returns the specification of this resource
func (setting *MongodbDatabaseThroughputSetting) GetSpec() genruntime.ConvertibleSpec {
return &setting.Spec
}
// GetStatus returns the status of this resource
func (setting *MongodbDatabaseThroughputSetting) GetStatus() genruntime.ConvertibleStatus {
return &setting.Status
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/throughputSettings"
func (setting *MongodbDatabaseThroughputSetting) GetType() string {
return "Microsoft.DocumentDB/databaseAccounts/mongodbDatabases/throughputSettings"
}
// NewEmptyStatus returns a new empty (blank) status
func (setting *MongodbDatabaseThroughputSetting) NewEmptyStatus() genruntime.ConvertibleStatus {
return &DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS{}
}
// Owner returns the ResourceReference of the owner
func (setting *MongodbDatabaseThroughputSetting) 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 *MongodbDatabaseThroughputSetting) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS); ok {
setting.Status = *st
return nil
}
// Convert status to required version
var st DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
setting.Status = st
return nil
}
// AssignProperties_From_MongodbDatabaseThroughputSetting populates our MongodbDatabaseThroughputSetting from the provided source MongodbDatabaseThroughputSetting
func (setting *MongodbDatabaseThroughputSetting) AssignProperties_From_MongodbDatabaseThroughputSetting(source *v20210515s.MongodbDatabaseThroughputSetting) error {
// ObjectMeta
setting.ObjectMeta = *source.ObjectMeta.DeepCopy()
// Spec
var spec DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec
err := spec.AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec(&source.Spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec() to populate field Spec")
}
setting.Spec = spec
// Status
var status DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS
err = status.AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS(&source.Status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS() to populate field Status")
}
setting.Status = status
// Invoke the augmentConversionForMongodbDatabaseThroughputSetting interface (if implemented) to customize the conversion
var settingAsAny any = setting
if augmentedSetting, ok := settingAsAny.(augmentConversionForMongodbDatabaseThroughputSetting); ok {
err := augmentedSetting.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_MongodbDatabaseThroughputSetting populates the provided destination MongodbDatabaseThroughputSetting from our MongodbDatabaseThroughputSetting
func (setting *MongodbDatabaseThroughputSetting) AssignProperties_To_MongodbDatabaseThroughputSetting(destination *v20210515s.MongodbDatabaseThroughputSetting) error {
// ObjectMeta
destination.ObjectMeta = *setting.ObjectMeta.DeepCopy()
// Spec
var spec v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec
err := setting.Spec.AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec(&spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec() to populate field Spec")
}
destination.Spec = spec
// Status
var status v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS
err = setting.Status.AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS(&status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS() to populate field Status")
}
destination.Status = status
// Invoke the augmentConversionForMongodbDatabaseThroughputSetting interface (if implemented) to customize the conversion
var settingAsAny any = setting
if augmentedSetting, ok := settingAsAny.(augmentConversionForMongodbDatabaseThroughputSetting); ok {
err := augmentedSetting.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (setting *MongodbDatabaseThroughputSetting) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: setting.Spec.OriginalVersion,
Kind: "MongodbDatabaseThroughputSetting",
}
}
// +kubebuilder:object:root=true
// Storage version of v1beta20210515.MongodbDatabaseThroughputSetting
// Deprecated version of MongodbDatabaseThroughputSetting. Use v1api20210515.MongodbDatabaseThroughputSetting instead
type MongodbDatabaseThroughputSettingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []MongodbDatabaseThroughputSetting `json:"items"`
}
type augmentConversionForMongodbDatabaseThroughputSetting interface {
AssignPropertiesFrom(src *v20210515s.MongodbDatabaseThroughputSetting) error
AssignPropertiesTo(dst *v20210515s.MongodbDatabaseThroughputSetting) error
}
// Storage version of v1beta20210515.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec
type DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec struct {
Location *string `json:"location,omitempty"`
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 documentdb.azure.com/MongodbDatabase resource
Owner *genruntime.KnownResourceReference `group:"documentdb.azure.com" json:"owner,omitempty" kind:"MongodbDatabase"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Resource *ThroughputSettingsResource `json:"resource,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}
var _ genruntime.ConvertibleSpec = &DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec{}
// ConvertSpecFrom populates our DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec from the provided source
func (setting *DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
src, ok := source.(*v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec)
if ok {
// Populate our instance from source
return setting.AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec(src)
}
// Convert to an intermediate form
src = &v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec{}
err := src.ConvertSpecFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
}
// Update our instance from src
err = setting.AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()")
}
return nil
}
// ConvertSpecTo populates the provided destination from our DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec
func (setting *DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
dst, ok := destination.(*v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec)
if ok {
// Populate destination from our instance
return setting.AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec(dst)
}
// Convert to an intermediate form
dst = &v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec{}
err := setting.AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec(dst)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()")
}
// Update dst from our instance
err = dst.ConvertSpecTo(destination)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecTo()")
}
return nil
}
// AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec populates our DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec from the provided source DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec
func (setting *DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec) AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec(source *v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Location
setting.Location = genruntime.ClonePointerToString(source.Location)
// OriginalVersion
setting.OriginalVersion = source.OriginalVersion
// Owner
if source.Owner != nil {
owner := source.Owner.Copy()
setting.Owner = &owner
} else {
setting.Owner = nil
}
// Resource
if source.Resource != nil {
var resource ThroughputSettingsResource
err := resource.AssignProperties_From_ThroughputSettingsResource(source.Resource)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ThroughputSettingsResource() to populate field Resource")
}
setting.Resource = &resource
} else {
setting.Resource = nil
}
// Tags
setting.Tags = genruntime.CloneMapOfStringToString(source.Tags)
// Update the property bag
if len(propertyBag) > 0 {
setting.PropertyBag = propertyBag
} else {
setting.PropertyBag = nil
}
// Invoke the augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec interface (if implemented) to customize the conversion
var settingAsAny any = setting
if augmentedSetting, ok := settingAsAny.(augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec); ok {
err := augmentedSetting.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec populates the provided destination DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec from our DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec
func (setting *DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec) AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec(destination *v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(setting.PropertyBag)
// Location
destination.Location = genruntime.ClonePointerToString(setting.Location)
// OriginalVersion
destination.OriginalVersion = setting.OriginalVersion
// Owner
if setting.Owner != nil {
owner := setting.Owner.Copy()
destination.Owner = &owner
} else {
destination.Owner = nil
}
// Resource
if setting.Resource != nil {
var resource v20210515s.ThroughputSettingsResource
err := setting.Resource.AssignProperties_To_ThroughputSettingsResource(&resource)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_ThroughputSettingsResource() to populate field Resource")
}
destination.Resource = &resource
} else {
destination.Resource = nil
}
// Tags
destination.Tags = genruntime.CloneMapOfStringToString(setting.Tags)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec interface (if implemented) to customize the conversion
var settingAsAny any = setting
if augmentedSetting, ok := settingAsAny.(augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec); ok {
err := augmentedSetting.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1beta20210515.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS
// Deprecated version of DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS. Use v1api20210515.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS instead
type DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS struct {
Conditions []conditions.Condition `json:"conditions,omitempty"`
Id *string `json:"id,omitempty"`
Location *string `json:"location,omitempty"`
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Resource *ThroughputSettingsGetProperties_Resource_STATUS `json:"resource,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Type *string `json:"type,omitempty"`
}
var _ genruntime.ConvertibleStatus = &DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS{}
// ConvertStatusFrom populates our DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS from the provided source
func (setting *DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
src, ok := source.(*v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS)
if ok {
// Populate our instance from source
return setting.AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS(src)
}
// Convert to an intermediate form
src = &v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS{}
err := src.ConvertStatusFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
}
// Update our instance from src
err = setting.AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()")
}
return nil
}
// ConvertStatusTo populates the provided destination from our DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS
func (setting *DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
dst, ok := destination.(*v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS)
if ok {
// Populate destination from our instance
return setting.AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS(dst)
}
// Convert to an intermediate form
dst = &v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS{}
err := setting.AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS(dst)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()")
}
// Update dst from our instance
err = dst.ConvertStatusTo(destination)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusTo()")
}
return nil
}
// AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS populates our DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS from the provided source DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS
func (setting *DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS) AssignProperties_From_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS(source *v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Conditions
setting.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)
// Id
setting.Id = genruntime.ClonePointerToString(source.Id)
// Location
setting.Location = genruntime.ClonePointerToString(source.Location)
// Name
setting.Name = genruntime.ClonePointerToString(source.Name)
// Resource
if source.Resource != nil {
var resource ThroughputSettingsGetProperties_Resource_STATUS
err := resource.AssignProperties_From_ThroughputSettingsGetProperties_Resource_STATUS(source.Resource)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ThroughputSettingsGetProperties_Resource_STATUS() to populate field Resource")
}
setting.Resource = &resource
} else {
setting.Resource = nil
}
// Tags
setting.Tags = genruntime.CloneMapOfStringToString(source.Tags)
// Type
setting.Type = genruntime.ClonePointerToString(source.Type)
// Update the property bag
if len(propertyBag) > 0 {
setting.PropertyBag = propertyBag
} else {
setting.PropertyBag = nil
}
// Invoke the augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS interface (if implemented) to customize the conversion
var settingAsAny any = setting
if augmentedSetting, ok := settingAsAny.(augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS); ok {
err := augmentedSetting.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS populates the provided destination DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS from our DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS
func (setting *DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS) AssignProperties_To_DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS(destination *v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(setting.PropertyBag)
// Conditions
destination.Conditions = genruntime.CloneSliceOfCondition(setting.Conditions)
// Id
destination.Id = genruntime.ClonePointerToString(setting.Id)
// Location
destination.Location = genruntime.ClonePointerToString(setting.Location)
// Name
destination.Name = genruntime.ClonePointerToString(setting.Name)
// Resource
if setting.Resource != nil {
var resource v20210515s.ThroughputSettingsGetProperties_Resource_STATUS
err := setting.Resource.AssignProperties_To_ThroughputSettingsGetProperties_Resource_STATUS(&resource)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_ThroughputSettingsGetProperties_Resource_STATUS() to populate field Resource")
}
destination.Resource = &resource
} else {
destination.Resource = nil
}
// Tags
destination.Tags = genruntime.CloneMapOfStringToString(setting.Tags)
// Type
destination.Type = genruntime.ClonePointerToString(setting.Type)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS interface (if implemented) to customize the conversion
var settingAsAny any = setting
if augmentedSetting, ok := settingAsAny.(augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS); ok {
err := augmentedSetting.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
type augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec interface {
AssignPropertiesFrom(src *v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec) error
AssignPropertiesTo(dst *v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_Spec) error
}
type augmentConversionForDatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS interface {
AssignPropertiesFrom(src *v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS) error
AssignPropertiesTo(dst *v20210515s.DatabaseAccounts_MongodbDatabases_ThroughputSetting_STATUS) error
}
func init() {
SchemeBuilder.Register(&MongodbDatabaseThroughputSetting{}, &MongodbDatabaseThroughputSettingList{})
}