forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
815 lines (755 loc) · 26.4 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
package powerplatform
// 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"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/powerplatform/mgmt/2020-10-30/powerplatform"
// EnterprisePolicy definition of the EnterprisePolicy.
type EnterprisePolicy struct {
autorest.Response `json:"-"`
// Identity - The identity of the EnterprisePolicy.
Identity *EnterprisePolicyIdentity `json:"identity,omitempty"`
// Properties - The properties that define configuration for the enterprise policy
*Properties `json:"properties,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// ID - READ-ONLY; ARM resource id of the EnterprisePolicy.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the EnterprisePolicy.
Name *string `json:"name,omitempty"`
// Location - READ-ONLY; Region where the EnterprisePolicy is located.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for EnterprisePolicy.
func (ep EnterprisePolicy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ep.Identity != nil {
objectMap["identity"] = ep.Identity
}
if ep.Properties != nil {
objectMap["properties"] = ep.Properties
}
if ep.Tags != nil {
objectMap["tags"] = ep.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for EnterprisePolicy struct.
func (ep *EnterprisePolicy) 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 "identity":
if v != nil {
var identity EnterprisePolicyIdentity
err = json.Unmarshal(*v, &identity)
if err != nil {
return err
}
ep.Identity = &identity
}
case "properties":
if v != nil {
var properties Properties
err = json.Unmarshal(*v, &properties)
if err != nil {
return err
}
ep.Properties = &properties
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ep.Tags = tags
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ep.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ep.Name = &name
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ep.Location = &location
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ep.Type = &typeVar
}
}
}
return nil
}
// EnterprisePolicyIdentity the identity of the EnterprisePolicy.
type EnterprisePolicyIdentity struct {
// SystemAssignedIdentityPrincipalID - READ-ONLY; The principal id of EnterprisePolicy identity.
SystemAssignedIdentityPrincipalID *string `json:"systemAssignedIdentityPrincipalId,omitempty"`
// TenantID - READ-ONLY; The tenant id associated with the EnterprisePolicy.
TenantID *string `json:"tenantId,omitempty"`
// Type - The type of identity used for the EnterprisePolicy. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity. Possible values include: 'SystemAssigned', 'None'
Type ResourceIdentityType `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for EnterprisePolicyIdentity.
func (epi EnterprisePolicyIdentity) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if epi.Type != "" {
objectMap["type"] = epi.Type
}
return json.Marshal(objectMap)
}
// EnterprisePolicyList the response of the list EnterprisePolicy operation.
type EnterprisePolicyList struct {
autorest.Response `json:"-"`
// Value - Result of the list EnterprisePolicy operation.
Value *[]EnterprisePolicy `json:"value,omitempty"`
}
// ErrorResponse ARM error response body.
type ErrorResponse struct {
// Error - Details about the error.
Error *ErrorResponseBody `json:"error,omitempty"`
}
// ErrorResponseBody an error response from the PowerPlatform service.
type ErrorResponseBody struct {
// Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
Code *string `json:"code,omitempty"`
// Message - A message describing the error, intended to be suitable for display in a user interface.
Message *string `json:"message,omitempty"`
// Target - The target of the particular error. For example, the name of the property in error.
Target *string `json:"target,omitempty"`
}
// KeyProperties url and version of the KeyVault Secret
type KeyProperties struct {
// Name - The identifier of the key vault key used to encrypt data.
Name *string `json:"name,omitempty"`
// Version - The version of the identity which will be used to access key vault.
Version *string `json:"version,omitempty"`
}
// KeyVaultProperties settings concerning key vault encryption for a configuration store.
type KeyVaultProperties struct {
// ID - Uri of KeyVault
ID *string `json:"id,omitempty"`
// Key - Identity of the secret that includes name and version.
Key *KeyProperties `json:"key,omitempty"`
// Status - The state of onboarding, which only appears in the response. Possible values include: 'Enabled', 'Disabled', 'NotConfigured'
Status Status `json:"status,omitempty"`
}
// Operation powerPlatform REST API operation
type Operation struct {
// Name - Operation name: For ex. providers/Microsoft.PowerPlatform/enterprisePolicies/write or read
Name *string `json:"name,omitempty"`
// IsDataAction - Indicates whether the operation is a data action
IsDataAction *string `json:"isDataAction,omitempty"`
// Display - Provider, Resource, Operation and description values.
Display *OperationDisplay `json:"display,omitempty"`
// OperationProperties - Provider, Resource, Operation and description values.
*OperationProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for Operation.
func (o Operation) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if o.Name != nil {
objectMap["name"] = o.Name
}
if o.IsDataAction != nil {
objectMap["isDataAction"] = o.IsDataAction
}
if o.Display != nil {
objectMap["display"] = o.Display
}
if o.OperationProperties != nil {
objectMap["properties"] = o.OperationProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Operation struct.
func (o *Operation) 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 "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
o.Name = &name
}
case "isDataAction":
if v != nil {
var isDataAction string
err = json.Unmarshal(*v, &isDataAction)
if err != nil {
return err
}
o.IsDataAction = &isDataAction
}
case "display":
if v != nil {
var display OperationDisplay
err = json.Unmarshal(*v, &display)
if err != nil {
return err
}
o.Display = &display
}
case "properties":
if v != nil {
var operationProperties OperationProperties
err = json.Unmarshal(*v, &operationProperties)
if err != nil {
return err
}
o.OperationProperties = &operationProperties
}
}
}
return nil
}
// OperationDisplay provider, Resource, Operation and description values.
type OperationDisplay struct {
// Provider - Service provider: Microsoft.PowerPlatform
Provider *string `json:"provider,omitempty"`
// Resource - Resource on which the operation is performed.
Resource *string `json:"resource,omitempty"`
// Operation - Operation type: Read, write, delete, etc.
Operation *string `json:"operation,omitempty"`
// Description - Description about operation.
Description *string `json:"description,omitempty"`
}
// OperationList the response model for the list of PowerPlatform operations
type OperationList struct {
autorest.Response `json:"-"`
// Value - List of PowerPlatform operations supported by the PowerPlatform resource provider.
Value *[]Operation `json:"value,omitempty"`
}
// OperationProperties provider, Resource, Operation and description values.
type OperationProperties struct {
// StatusCode - Service provider: Microsoft.PowerPlatform
StatusCode *string `json:"statusCode,omitempty"`
}
// PrivateEndpoint the Private Endpoint resource.
type PrivateEndpoint struct {
// ID - READ-ONLY; The ARM identifier for Private Endpoint
ID *string `json:"id,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateEndpoint.
func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// PrivateEndpointConnection a private endpoint connection
type PrivateEndpointConnection struct {
autorest.Response `json:"-"`
// PrivateEndpointConnectionProperties - Resource properties.
*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
// ID - READ-ONLY; ARM resource id of the EnterprisePolicy.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the EnterprisePolicy.
Name *string `json:"name,omitempty"`
// Location - READ-ONLY; Region where the EnterprisePolicy is located.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if pec.PrivateEndpointConnectionProperties != nil {
objectMap["properties"] = pec.PrivateEndpointConnectionProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
func (pec *PrivateEndpointConnection) 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 "properties":
if v != nil {
var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
if err != nil {
return err
}
pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
pec.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
pec.Name = &name
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
pec.Location = &location
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
pec.Type = &typeVar
}
}
}
return nil
}
// PrivateEndpointConnectionListResult a list of private endpoint connections
type PrivateEndpointConnectionListResult struct {
autorest.Response `json:"-"`
// Value - Array of private endpoint connections
Value *[]PrivateEndpointConnection `json:"value,omitempty"`
}
// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties.
type PrivateEndpointConnectionProperties struct {
// PrivateEndpoint - The resource of private end point.
PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
// ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed'
ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
}
// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
// of a long-running operation.
type PrivateEndpointConnectionsCreateOrUpdateFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) 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 PrivateEndpointConnectionsCreateOrUpdateFuture.Result.
func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "powerplatform.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
pec.Response.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("powerplatform.PrivateEndpointConnectionsCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent {
pec, err = client.CreateOrUpdateResponder(pec.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "powerplatform.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request")
}
}
return
}
// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type PrivateEndpointConnectionsDeleteFuture struct {
azure.FutureAPI
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
Result func(PrivateEndpointConnectionsClient) (autorest.Response, error)
}
// UnmarshalJSON is the custom unmarshaller for CreateFuture.
func (future *PrivateEndpointConnectionsDeleteFuture) 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 PrivateEndpointConnectionsDeleteFuture.Result.
func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "powerplatform.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
ar.Response = future.Response()
err = azure.NewAsyncOpIncompleteError("powerplatform.PrivateEndpointConnectionsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// PrivateLinkResource a private link resource
type PrivateLinkResource struct {
autorest.Response `json:"-"`
// PrivateLinkResourceProperties - Resource properties.
*PrivateLinkResourceProperties `json:"properties,omitempty"`
// ID - READ-ONLY; ARM resource id of the EnterprisePolicy.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the EnterprisePolicy.
Name *string `json:"name,omitempty"`
// Location - READ-ONLY; Region where the EnterprisePolicy is located.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateLinkResource.
func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if plr.PrivateLinkResourceProperties != nil {
objectMap["properties"] = plr.PrivateLinkResourceProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
func (plr *PrivateLinkResource) 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 "properties":
if v != nil {
var privateLinkResourceProperties PrivateLinkResourceProperties
err = json.Unmarshal(*v, &privateLinkResourceProperties)
if err != nil {
return err
}
plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
plr.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
plr.Name = &name
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
plr.Location = &location
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
plr.Type = &typeVar
}
}
}
return nil
}
// PrivateLinkResourceListResult a list of private link resources
type PrivateLinkResourceListResult struct {
autorest.Response `json:"-"`
// Value - Array of private link resources
Value *[]PrivateLinkResource `json:"value,omitempty"`
}
// PrivateLinkResourceProperties properties of a private link resource.
type PrivateLinkResourceProperties struct {
// GroupID - READ-ONLY; The private link resource group id.
GroupID *string `json:"groupId,omitempty"`
// RequiredMembers - READ-ONLY; The private link resource required member names.
RequiredMembers *[]string `json:"requiredMembers,omitempty"`
// SystemData - Metadata for the private link resource.
SystemData *SystemData `json:"systemData,omitempty"`
}
// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if plrp.SystemData != nil {
objectMap["systemData"] = plrp.SystemData
}
return json.Marshal(objectMap)
}
// PrivateLinkServiceConnectionState a collection of information about the state of the connection between
// service consumer and provider.
type PrivateLinkServiceConnectionState struct {
// Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected'
Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
// Description - The reason for approval/rejection of the connection.
Description *string `json:"description,omitempty"`
// ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer.
ActionsRequired *string `json:"actionsRequired,omitempty"`
}
// Properties the properties that define configuration for the enterprise policy.
type Properties struct {
// Lockbox - Settings concerning lockbox.
Lockbox *PropertiesLockbox `json:"lockbox,omitempty"`
// Encryption - The encryption settings for a configuration store.
Encryption *PropertiesEncryption `json:"encryption,omitempty"`
// SystemData - Metadata pertaining to creation and last modification of the resource.
SystemData *SystemData `json:"systemData,omitempty"`
}
// PropertiesEncryption the encryption settings for a configuration store.
type PropertiesEncryption struct {
// KeyVaultProperties - Key vault properties.
KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
}
// PropertiesLockbox settings concerning lockbox.
type PropertiesLockbox struct {
// Status - lockbox configuration. Possible values include: 'Enabled', 'Disabled', 'NotConfigured'
Status Status `json:"status,omitempty"`
}
// ProxyResource ARM proxy resource.
type ProxyResource struct {
// ID - READ-ONLY; ARM resource id of the EnterprisePolicy.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the EnterprisePolicy.
Name *string `json:"name,omitempty"`
// Location - READ-ONLY; Region where the EnterprisePolicy is located.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for ProxyResource.
func (pr ProxyResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Resource the core properties of ARM resources
type Resource struct {
// ID - READ-ONLY; ARM resource id of the EnterprisePolicy.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the EnterprisePolicy.
Name *string `json:"name,omitempty"`
// Location - READ-ONLY; Region where the EnterprisePolicy is located.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// Subnet a subnet
type Subnet struct {
autorest.Response `json:"-"`
// SubnetProperties - Resource properties.
*SubnetProperties `json:"properties,omitempty"`
// ID - READ-ONLY; ARM resource id of the EnterprisePolicy.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the EnterprisePolicy.
Name *string `json:"name,omitempty"`
// Location - READ-ONLY; Region where the EnterprisePolicy is located.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Subnet.
func (s Subnet) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if s.SubnetProperties != nil {
objectMap["properties"] = s.SubnetProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Subnet struct.
func (s *Subnet) 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 "properties":
if v != nil {
var subnetProperties SubnetProperties
err = json.Unmarshal(*v, &subnetProperties)
if err != nil {
return err
}
s.SubnetProperties = &subnetProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
s.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
s.Name = &name
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
s.Location = &location
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
s.Type = &typeVar
}
}
}
return nil
}
// SubnetEndpointProperty endpoint of the subnet.
type SubnetEndpointProperty struct {
// ID - Resource id of the subnet.
ID *string `json:"id,omitempty"`
}
// SubnetListResult a list of subnets
type SubnetListResult struct {
autorest.Response `json:"-"`
// Value - Array of subnets
Value *[]Subnet `json:"value,omitempty"`
}
// SubnetProperties properties of a subnet.
type SubnetProperties struct {
// Subnet - Endpoint of the subnet.
Subnet *SubnetEndpointProperty `json:"subnet,omitempty"`
// Status - Connection State of the subnet. Possible values include: 'Enabled', 'Disabled', 'NotConfigured'
Status Status `json:"status,omitempty"`
// SystemData - Metadata for the subnet.
SystemData *SystemData `json:"systemData,omitempty"`
}
// SystemData metadata pertaining to creation and last modification of the resource.
type SystemData struct {
// CreatedBy - The identity that created the resource.
CreatedBy *string `json:"createdBy,omitempty"`
// CreatedByType - The type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
CreatedByType CreatedByType `json:"createdByType,omitempty"`
// CreatedAt - The timestamp of resource creation (UTC).
CreatedAt *date.Time `json:"createdAt,omitempty"`
// LastModifiedBy - The identity that last modified the resource.
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
// LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key'
LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"`
// LastModifiedAt - The type of identity that last modified the resource.
LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"`
}
// TrackedResource the resource model definition for a ARM tracked top level resource
type TrackedResource struct {
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// ID - READ-ONLY; ARM resource id of the EnterprisePolicy.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the EnterprisePolicy.
Name *string `json:"name,omitempty"`
// Location - READ-ONLY; Region where the EnterprisePolicy is located.
Location *string `json:"location,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for TrackedResource.
func (tr TrackedResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if tr.Tags != nil {
objectMap["tags"] = tr.Tags
}
return json.Marshal(objectMap)
}