-
Notifications
You must be signed in to change notification settings - Fork 822
/
models.go
5516 lines (5174 loc) · 206 KB
/
models.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
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package sql
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/gofrs/uuid"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/sql/mgmt/2014-04-01/sql"
// Advisor database Advisor.
type Advisor struct {
autorest.Response `json:"-"`
// Kind - READ-ONLY; Resource kind.
Kind *string `json:"kind,omitempty"`
// Location - READ-ONLY; Resource location.
Location *string `json:"location,omitempty"`
// AdvisorProperties - Resource properties.
*AdvisorProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Advisor.
func (a Advisor) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if a.AdvisorProperties != nil {
objectMap["properties"] = a.AdvisorProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Advisor struct.
func (a *Advisor) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "kind":
if v != nil {
var kind string
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
a.Kind = &kind
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
a.Location = &location
}
case "properties":
if v != nil {
var advisorProperties AdvisorProperties
err = json.Unmarshal(*v, &advisorProperties)
if err != nil {
return err
}
a.AdvisorProperties = &advisorProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
a.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
a.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
a.Type = &typeVar
}
}
}
return nil
}
// AdvisorListResult represents the response to a list advisors request.
type AdvisorListResult struct {
autorest.Response `json:"-"`
// Value - The list of advisors.
Value *[]Advisor `json:"value,omitempty"`
}
// AdvisorProperties properties for a Database, Server or Elastic Pool Advisor.
type AdvisorProperties struct {
// AdvisorStatus - READ-ONLY; Gets the status of availability of this advisor to customers. Possible values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Possible values include: 'GA', 'PublicPreview', 'LimitedPublicPreview', 'PrivatePreview'
AdvisorStatus AdvisorStatus `json:"advisorStatus,omitempty"`
// AutoExecuteValue - Gets the auto-execute status (whether to let the system execute the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Possible values include: 'Enabled', 'Disabled', 'Default'
AutoExecuteValue AutoExecuteStatus `json:"autoExecuteValue,omitempty"`
// RecommendationsStatus - READ-ONLY; Gets that status of recommendations for this advisor and reason for not having any recommendations. Possible values include, but are not limited to, 'Ok' (Recommendations available), LowActivity (not enough workload to analyze), 'DbSeemsTuned' (Database is doing well), etc.
RecommendationsStatus *string `json:"recommendationsStatus,omitempty"`
// LastChecked - READ-ONLY; Gets the time when the current resource was analyzed for recommendations by this advisor.
LastChecked *date.Time `json:"lastChecked,omitempty"`
}
// MarshalJSON is the custom marshaler for AdvisorProperties.
func (ap AdvisorProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ap.AutoExecuteValue != "" {
objectMap["autoExecuteValue"] = ap.AutoExecuteValue
}
return json.Marshal(objectMap)
}
// CheckNameAvailabilityRequest a request to check whether the specified name for a resource is available.
type CheckNameAvailabilityRequest struct {
// Name - The name whose availability is to be checked.
Name *string `json:"name,omitempty"`
// Type - The type of resource that is used as the scope of the availability check.
Type *string `json:"type,omitempty"`
}
// CheckNameAvailabilityResponse a response indicating whether the specified name for a resource is
// available.
type CheckNameAvailabilityResponse struct {
autorest.Response `json:"-"`
// Available - READ-ONLY; True if the name is available, otherwise false.
Available *bool `json:"available,omitempty"`
// Message - READ-ONLY; A message explaining why the name is unavailable. Will be null if the name is available.
Message *string `json:"message,omitempty"`
// Name - READ-ONLY; The name whose availability was checked.
Name *string `json:"name,omitempty"`
// Reason - READ-ONLY; The reason code explaining why the name is unavailable. Will be null if the name is available. Possible values include: 'Invalid', 'AlreadyExists'
Reason CheckNameAvailabilityReason `json:"reason,omitempty"`
}
// MarshalJSON is the custom marshaler for CheckNameAvailabilityResponse.
func (cnar CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Database represents a database.
type Database struct {
autorest.Response `json:"-"`
// Kind - READ-ONLY; Kind of database. This is metadata used for the Azure portal experience.
Kind *string `json:"kind,omitempty"`
// DatabaseProperties - The properties representing the resource.
*DatabaseProperties `json:"properties,omitempty"`
// Location - Resource location.
Location *string `json:"location,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// ID - READ-ONLY; Resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Database.
func (d Database) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if d.DatabaseProperties != nil {
objectMap["properties"] = d.DatabaseProperties
}
if d.Location != nil {
objectMap["location"] = d.Location
}
if d.Tags != nil {
objectMap["tags"] = d.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Database struct.
func (d *Database) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "kind":
if v != nil {
var kind string
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
d.Kind = &kind
}
case "properties":
if v != nil {
var databaseProperties DatabaseProperties
err = json.Unmarshal(*v, &databaseProperties)
if err != nil {
return err
}
d.DatabaseProperties = &databaseProperties
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
d.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
d.Tags = tags
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
d.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
d.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
d.Type = &typeVar
}
}
}
return nil
}
// DatabaseConnectionPolicy a database connection policy.
type DatabaseConnectionPolicy struct {
autorest.Response `json:"-"`
// Kind - READ-ONLY; Resource kind.
Kind *string `json:"kind,omitempty"`
// Location - READ-ONLY; Resource location.
Location *string `json:"location,omitempty"`
// DatabaseConnectionPolicyProperties - Resource properties.
*DatabaseConnectionPolicyProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for DatabaseConnectionPolicy.
func (dcp DatabaseConnectionPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dcp.DatabaseConnectionPolicyProperties != nil {
objectMap["properties"] = dcp.DatabaseConnectionPolicyProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for DatabaseConnectionPolicy struct.
func (dcp *DatabaseConnectionPolicy) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "kind":
if v != nil {
var kind string
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
dcp.Kind = &kind
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
dcp.Location = &location
}
case "properties":
if v != nil {
var databaseConnectionPolicyProperties DatabaseConnectionPolicyProperties
err = json.Unmarshal(*v, &databaseConnectionPolicyProperties)
if err != nil {
return err
}
dcp.DatabaseConnectionPolicyProperties = &databaseConnectionPolicyProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
dcp.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
dcp.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
dcp.Type = &typeVar
}
}
}
return nil
}
// DatabaseConnectionPolicyProperties properties of a database connection policy.
type DatabaseConnectionPolicyProperties struct {
// SecurityEnabledAccess - The state of security access.
SecurityEnabledAccess *string `json:"securityEnabledAccess,omitempty"`
// ProxyDNSName - The fully qualified host name of the auditing proxy.
ProxyDNSName *string `json:"proxyDnsName,omitempty"`
// ProxyPort - The port number of the auditing proxy.
ProxyPort *string `json:"proxyPort,omitempty"`
// Visibility - The visibility of the auditing proxy.
Visibility *string `json:"visibility,omitempty"`
// UseServerDefault - Whether server default is enabled or disabled.
UseServerDefault *string `json:"useServerDefault,omitempty"`
// RedirectionState - The state of proxy redirection.
RedirectionState *string `json:"redirectionState,omitempty"`
// State - The connection policy state.
State *string `json:"state,omitempty"`
}
// DatabaseListResult represents the response to a list database request.
type DatabaseListResult struct {
autorest.Response `json:"-"`
// Value - The list of databases housed in the server.
Value *[]Database `json:"value,omitempty"`
}
// DatabaseProperties represents the properties of a database.
type DatabaseProperties struct {
// Collation - The collation of the database. If createMode is not Default, this value is ignored.
Collation *string `json:"collation,omitempty"`
// CreationDate - READ-ONLY; The creation date of the database (ISO8601 format).
CreationDate *date.Time `json:"creationDate,omitempty"`
// ContainmentState - READ-ONLY; The containment state of the database.
ContainmentState *int64 `json:"containmentState,omitempty"`
// CurrentServiceObjectiveID - READ-ONLY; The current service level objective ID of the database. This is the ID of the service level objective that is currently active.
CurrentServiceObjectiveID *uuid.UUID `json:"currentServiceObjectiveId,omitempty"`
// DatabaseID - READ-ONLY; The ID of the database.
DatabaseID *uuid.UUID `json:"databaseId,omitempty"`
// EarliestRestoreDate - READ-ONLY; This records the earliest start date and time that restore is available for this database (ISO8601 format).
EarliestRestoreDate *date.Time `json:"earliestRestoreDate,omitempty"`
// CreateMode - Specifies the mode of database creation.
// Default: regular database creation.
// Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
// OnlineSecondary/NonReadableSecondary: creates a database as a (readable or nonreadable) secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
// PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
// Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
// Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
// RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
// Copy, NonReadableSecondary, OnlineSecondary and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition. Possible values include: 'CreateModeCopy', 'CreateModeDefault', 'CreateModeNonReadableSecondary', 'CreateModeOnlineSecondary', 'CreateModePointInTimeRestore', 'CreateModeRecovery', 'CreateModeRestore', 'CreateModeRestoreLongTermRetentionBackup'
CreateMode CreateMode `json:"createMode,omitempty"`
// SourceDatabaseID - Conditional. If createMode is Copy, NonReadableSecondary, OnlineSecondary, PointInTimeRestore, Recovery, or Restore, then this value is required. Specifies the resource ID of the source database. If createMode is NonReadableSecondary or OnlineSecondary, the name of the source database must be the same as the new database being created.
SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"`
// SourceDatabaseDeletionDate - Conditional. If createMode is Restore and sourceDatabaseId is the deleted database's original resource id when it existed (as opposed to its current restorable dropped database id), then this value is required. Specifies the time that the database was deleted.
SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"`
// RestorePointInTime - Conditional. If createMode is PointInTimeRestore, this value is required. If createMode is Restore, this value is optional. Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database. Must be greater than or equal to the source database's earliestRestoreDate value.
RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"`
// RecoveryServicesRecoveryPointResourceID - Conditional. If createMode is RestoreLongTermRetentionBackup, then this value is required. Specifies the resource ID of the recovery point to restore from.
RecoveryServicesRecoveryPointResourceID *string `json:"recoveryServicesRecoveryPointResourceId,omitempty"`
// Edition - The edition of the database. The DatabaseEditions enumeration contains all the valid editions. If createMode is NonReadableSecondary or OnlineSecondary, this value is ignored.
//
// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
//
// ```azurecli
// az sql db list-editions -l <location> -o table
// ````
//
// ```powershell
// Get-AzSqlServerServiceObjective -Location <location>
// ````
// . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale'
Edition DatabaseEdition `json:"edition,omitempty"`
// MaxSizeBytes - The max size of the database expressed in bytes. If createMode is not Default, this value is ignored. To see possible values, query the capabilities API (/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationID}/capabilities) referred to by operationId: "Capabilities_ListByLocation."
MaxSizeBytes *string `json:"maxSizeBytes,omitempty"`
// RequestedServiceObjectiveID - The configured service level objective ID of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of currentServiceObjectiveId property. If requestedServiceObjectiveId and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveId overrides the value of requestedServiceObjectiveName.
//
// The list of SKUs may vary by region and support offer. To determine the service objective ids that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API.
RequestedServiceObjectiveID *uuid.UUID `json:"requestedServiceObjectiveId,omitempty"`
// RequestedServiceObjectiveName - The name of the configured service level objective of the database. This is the service level objective that is in the process of being applied to the database. Once successfully updated, it will match the value of serviceLevelObjective property.
//
// The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
//
// ```azurecli
// az sql db list-editions -l <location> -o table
// ````
//
// ```powershell
// Get-AzSqlServerServiceObjective -Location <location>
// ````
// . Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool'
RequestedServiceObjectiveName ServiceObjectiveName `json:"requestedServiceObjectiveName,omitempty"`
// ServiceLevelObjective - READ-ONLY; The current service level objective of the database. Possible values include: 'ServiceObjectiveNameSystem', 'ServiceObjectiveNameSystem0', 'ServiceObjectiveNameSystem1', 'ServiceObjectiveNameSystem2', 'ServiceObjectiveNameSystem3', 'ServiceObjectiveNameSystem4', 'ServiceObjectiveNameSystem2L', 'ServiceObjectiveNameSystem3L', 'ServiceObjectiveNameSystem4L', 'ServiceObjectiveNameFree', 'ServiceObjectiveNameBasic', 'ServiceObjectiveNameS0', 'ServiceObjectiveNameS1', 'ServiceObjectiveNameS2', 'ServiceObjectiveNameS3', 'ServiceObjectiveNameS4', 'ServiceObjectiveNameS6', 'ServiceObjectiveNameS7', 'ServiceObjectiveNameS9', 'ServiceObjectiveNameS12', 'ServiceObjectiveNameP1', 'ServiceObjectiveNameP2', 'ServiceObjectiveNameP3', 'ServiceObjectiveNameP4', 'ServiceObjectiveNameP6', 'ServiceObjectiveNameP11', 'ServiceObjectiveNameP15', 'ServiceObjectiveNamePRS1', 'ServiceObjectiveNamePRS2', 'ServiceObjectiveNamePRS4', 'ServiceObjectiveNamePRS6', 'ServiceObjectiveNameDW100', 'ServiceObjectiveNameDW200', 'ServiceObjectiveNameDW300', 'ServiceObjectiveNameDW400', 'ServiceObjectiveNameDW500', 'ServiceObjectiveNameDW600', 'ServiceObjectiveNameDW1000', 'ServiceObjectiveNameDW1200', 'ServiceObjectiveNameDW1000c', 'ServiceObjectiveNameDW1500', 'ServiceObjectiveNameDW1500c', 'ServiceObjectiveNameDW2000', 'ServiceObjectiveNameDW2000c', 'ServiceObjectiveNameDW3000', 'ServiceObjectiveNameDW2500c', 'ServiceObjectiveNameDW3000c', 'ServiceObjectiveNameDW6000', 'ServiceObjectiveNameDW5000c', 'ServiceObjectiveNameDW6000c', 'ServiceObjectiveNameDW7500c', 'ServiceObjectiveNameDW10000c', 'ServiceObjectiveNameDW15000c', 'ServiceObjectiveNameDW30000c', 'ServiceObjectiveNameDS100', 'ServiceObjectiveNameDS200', 'ServiceObjectiveNameDS300', 'ServiceObjectiveNameDS400', 'ServiceObjectiveNameDS500', 'ServiceObjectiveNameDS600', 'ServiceObjectiveNameDS1000', 'ServiceObjectiveNameDS1200', 'ServiceObjectiveNameDS1500', 'ServiceObjectiveNameDS2000', 'ServiceObjectiveNameElasticPool'
ServiceLevelObjective ServiceObjectiveName `json:"serviceLevelObjective,omitempty"`
// Status - READ-ONLY; The status of the database.
Status *string `json:"status,omitempty"`
// ElasticPoolName - The name of the elastic pool the database is in. If elasticPoolName and requestedServiceObjectiveName are both updated, the value of requestedServiceObjectiveName is ignored. Not supported for DataWarehouse edition.
ElasticPoolName *string `json:"elasticPoolName,omitempty"`
// DefaultSecondaryLocation - READ-ONLY; The default secondary region for this database.
DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"`
// ServiceTierAdvisors - READ-ONLY; The list of service tier advisors for this database. Expanded property
ServiceTierAdvisors *[]ServiceTierAdvisor `json:"serviceTierAdvisors,omitempty"`
// TransparentDataEncryption - READ-ONLY; The transparent data encryption info for this database.
TransparentDataEncryption *[]TransparentDataEncryption `json:"transparentDataEncryption,omitempty"`
// RecommendedIndex - READ-ONLY; The recommended indices for this database.
RecommendedIndex *[]RecommendedIndex `json:"recommendedIndex,omitempty"`
// FailoverGroupID - READ-ONLY; The resource identifier of the failover group containing this database.
FailoverGroupID *string `json:"failoverGroupId,omitempty"`
// ReadScale - Conditional. If the database is a geo-secondary, readScale indicates whether read-only connections are allowed to this database or not. Not supported for DataWarehouse edition. Possible values include: 'ReadScaleEnabled', 'ReadScaleDisabled'
ReadScale ReadScale `json:"readScale,omitempty"`
// SampleName - Indicates the name of the sample schema to apply when creating this database. If createMode is not Default, this value is ignored. Not supported for DataWarehouse edition. Possible values include: 'AdventureWorksLT'
SampleName SampleName `json:"sampleName,omitempty"`
// ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
ZoneRedundant *bool `json:"zoneRedundant,omitempty"`
}
// MarshalJSON is the custom marshaler for DatabaseProperties.
func (dp DatabaseProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dp.Collation != nil {
objectMap["collation"] = dp.Collation
}
if dp.CreateMode != "" {
objectMap["createMode"] = dp.CreateMode
}
if dp.SourceDatabaseID != nil {
objectMap["sourceDatabaseId"] = dp.SourceDatabaseID
}
if dp.SourceDatabaseDeletionDate != nil {
objectMap["sourceDatabaseDeletionDate"] = dp.SourceDatabaseDeletionDate
}
if dp.RestorePointInTime != nil {
objectMap["restorePointInTime"] = dp.RestorePointInTime
}
if dp.RecoveryServicesRecoveryPointResourceID != nil {
objectMap["recoveryServicesRecoveryPointResourceId"] = dp.RecoveryServicesRecoveryPointResourceID
}
if dp.Edition != "" {
objectMap["edition"] = dp.Edition
}
if dp.MaxSizeBytes != nil {
objectMap["maxSizeBytes"] = dp.MaxSizeBytes
}
if dp.RequestedServiceObjectiveID != nil {
objectMap["requestedServiceObjectiveId"] = dp.RequestedServiceObjectiveID
}
if dp.RequestedServiceObjectiveName != "" {
objectMap["requestedServiceObjectiveName"] = dp.RequestedServiceObjectiveName
}
if dp.ElasticPoolName != nil {
objectMap["elasticPoolName"] = dp.ElasticPoolName
}
if dp.ReadScale != "" {
objectMap["readScale"] = dp.ReadScale
}
if dp.SampleName != "" {
objectMap["sampleName"] = dp.SampleName
}
if dp.ZoneRedundant != nil {
objectMap["zoneRedundant"] = dp.ZoneRedundant
}
return json.Marshal(objectMap)
}
// DatabasesCreateImportOperationFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type DatabasesCreateImportOperationFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DatabasesClient) (ImportExportResponse, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DatabasesCreateImportOperationFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DatabasesCreateImportOperationFuture.Result.
func (future *DatabasesCreateImportOperationFuture) result(client DatabasesClient) (ier ImportExportResponse, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ier.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateImportOperationFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent {
ier, err = client.CreateImportOperationResponder(ier.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesCreateImportOperationFuture", "Result", ier.Response.Response, "Failure responding to request")
}
}
return
}
// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type DatabasesCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DatabasesClient) (Database, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DatabasesCreateOrUpdateFuture.Result.
func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (d Database, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
d.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("sql.DatabasesCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
d, err = client.CreateOrUpdateResponder(d.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
}
}
return
}
// DatabaseSecurityAlertPolicy contains information about a database Threat Detection policy.
type DatabaseSecurityAlertPolicy struct {
autorest.Response `json:"-"`
// Location - The geo-location where the resource lives
Location *string `json:"location,omitempty"`
// Kind - READ-ONLY; Resource kind.
Kind *string `json:"kind,omitempty"`
// DatabaseSecurityAlertPolicyProperties - Properties of the security alert policy.
*DatabaseSecurityAlertPolicyProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for DatabaseSecurityAlertPolicy.
func (dsap DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dsap.Location != nil {
objectMap["location"] = dsap.Location
}
if dsap.DatabaseSecurityAlertPolicyProperties != nil {
objectMap["properties"] = dsap.DatabaseSecurityAlertPolicyProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for DatabaseSecurityAlertPolicy struct.
func (dsap *DatabaseSecurityAlertPolicy) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
dsap.Location = &location
}
case "kind":
if v != nil {
var kind string
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
dsap.Kind = &kind
}
case "properties":
if v != nil {
var databaseSecurityAlertPolicyProperties DatabaseSecurityAlertPolicyProperties
err = json.Unmarshal(*v, &databaseSecurityAlertPolicyProperties)
if err != nil {
return err
}
dsap.DatabaseSecurityAlertPolicyProperties = &databaseSecurityAlertPolicyProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
dsap.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
dsap.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
dsap.Type = &typeVar
}
}
}
return nil
}
// DatabaseSecurityAlertPolicyProperties properties for a database Threat Detection policy.
type DatabaseSecurityAlertPolicyProperties struct {
// State - Specifies the state of the policy. If state is Enabled, storageEndpoint and storageAccountAccessKey are required. Possible values include: 'SecurityAlertPolicyStateNew', 'SecurityAlertPolicyStateEnabled', 'SecurityAlertPolicyStateDisabled'
State SecurityAlertPolicyState `json:"state,omitempty"`
// DisabledAlerts - Specifies the semicolon-separated list of alerts that are disabled, or empty string to disable no alerts. Possible values: Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; Data_Exfiltration; Unsafe_Action.
DisabledAlerts *string `json:"disabledAlerts,omitempty"`
// EmailAddresses - Specifies the semicolon-separated list of e-mail addresses to which the alert is sent.
EmailAddresses *string `json:"emailAddresses,omitempty"`
// EmailAccountAdmins - Specifies that the alert is sent to the account administrators. Possible values include: 'SecurityAlertPolicyEmailAccountAdminsEnabled', 'SecurityAlertPolicyEmailAccountAdminsDisabled'
EmailAccountAdmins SecurityAlertPolicyEmailAccountAdmins `json:"emailAccountAdmins,omitempty"`
// StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. If state is Enabled, storageEndpoint is required.
StorageEndpoint *string `json:"storageEndpoint,omitempty"`
// StorageAccountAccessKey - Specifies the identifier key of the Threat Detection audit storage account. If state is Enabled, storageAccountAccessKey is required.
StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"`
// RetentionDays - Specifies the number of days to keep in the Threat Detection audit logs.
RetentionDays *int32 `json:"retentionDays,omitempty"`
// UseServerDefault - Specifies whether to use the default server policy. Possible values include: 'SecurityAlertPolicyUseServerDefaultEnabled', 'SecurityAlertPolicyUseServerDefaultDisabled'
UseServerDefault SecurityAlertPolicyUseServerDefault `json:"useServerDefault,omitempty"`
}
// DatabasesExportFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type DatabasesExportFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DatabasesClient) (ImportExportResponse, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DatabasesExportFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DatabasesExportFuture.Result.
func (future *DatabasesExportFuture) result(client DatabasesClient) (ier ImportExportResponse, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ier.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("sql.DatabasesExportFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent {
ier, err = client.ExportResponder(ier.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesExportFuture", "Result", ier.Response.Response, "Failure responding to request")
}
}
return
}
// DatabasesImportFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type DatabasesImportFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DatabasesClient) (ImportExportResponse, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DatabasesImportFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DatabasesImportFuture.Result.
func (future *DatabasesImportFuture) result(client DatabasesClient) (ier ImportExportResponse, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ier.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("sql.DatabasesImportFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if ier.Response.Response, err = future.GetResult(sender); err == nil && ier.Response.Response.StatusCode != http.StatusNoContent {
ier, err = client.ImportResponder(ier.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesImportFuture", "Result", ier.Response.Response, "Failure responding to request")
}
}
return
}
// DatabasesPauseFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type DatabasesPauseFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DatabasesClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DatabasesPauseFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DatabasesPauseFuture.Result.
func (future *DatabasesPauseFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesPauseFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("sql.DatabasesPauseFuture")
return
}
ar.Response = future.Response()
return
}
// DatabasesResumeFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type DatabasesResumeFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DatabasesClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DatabasesResumeFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DatabasesResumeFuture.Result.
func (future *DatabasesResumeFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesResumeFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("sql.DatabasesResumeFuture")
return
}
ar.Response = future.Response()
return
}
// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type DatabasesUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(DatabasesClient) (Database, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *DatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
var azFuture azure.Future
if err := json.Unmarshal(body, &azFuture); err != nil {
return err
}
future.FutureAPI = &azFuture
future.Result = future.result
return nil
}
// result is the default implementation for DatabasesUpdateFuture.Result.
func (future *DatabasesUpdateFuture) result(client DatabasesClient) (d Database, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
d.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("sql.DatabasesUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
d, err = client.UpdateResponder(d.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "sql.DatabasesUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
}
}
return
}
// DatabaseTableAuditingPolicy a database table auditing policy.
type DatabaseTableAuditingPolicy struct {
autorest.Response `json:"-"`
// Kind - READ-ONLY; Resource kind.
Kind *string `json:"kind,omitempty"`
// Location - READ-ONLY; Resource location.
Location *string `json:"location,omitempty"`
// DatabaseTableAuditingPolicyProperties - Resource properties.
*DatabaseTableAuditingPolicyProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource ID.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for DatabaseTableAuditingPolicy.
func (dtap DatabaseTableAuditingPolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dtap.DatabaseTableAuditingPolicyProperties != nil {
objectMap["properties"] = dtap.DatabaseTableAuditingPolicyProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for DatabaseTableAuditingPolicy struct.
func (dtap *DatabaseTableAuditingPolicy) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "kind":
if v != nil {
var kind string
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
dtap.Kind = &kind
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
dtap.Location = &location
}