forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.go
767 lines (717 loc) · 28.5 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
package trafficmanager
// 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 (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/trafficmanager/mgmt/2018-08-01/trafficmanager"
// CheckTrafficManagerRelativeDNSNameAvailabilityParameters parameters supplied to check Traffic Manager
// name operation.
type CheckTrafficManagerRelativeDNSNameAvailabilityParameters struct {
// Name - The name of the resource.
Name *string `json:"name,omitempty"`
// Type - The type of the resource.
Type *string `json:"type,omitempty"`
}
// CloudError an error returned by the Azure Resource Manager
type CloudError struct {
// Error - The content of the error.
Error *CloudErrorBody `json:"error,omitempty"`
}
// CloudErrorBody the content of an error returned by the Azure Resource Manager
type CloudErrorBody struct {
// Code - Error code
Code *string `json:"code,omitempty"`
// Message - Error message
Message *string `json:"message,omitempty"`
// Target - Error target
Target *string `json:"target,omitempty"`
// Details - Error details
Details *[]CloudErrorBody `json:"details,omitempty"`
}
// DeleteOperationResult the result of the request or operation.
type DeleteOperationResult struct {
autorest.Response `json:"-"`
// OperationResult - READ-ONLY; The result of the operation or request.
OperationResult *bool `json:"boolean,omitempty"`
}
// MarshalJSON is the custom marshaler for DeleteOperationResult.
func (dor DeleteOperationResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
return json.Marshal(objectMap)
}
// DNSConfig class containing DNS settings in a Traffic Manager profile.
type DNSConfig struct {
// RelativeName - The relative DNS name provided by this Traffic Manager profile. This value is combined with the DNS domain name used by Azure Traffic Manager to form the fully-qualified domain name (FQDN) of the profile.
RelativeName *string `json:"relativeName,omitempty"`
// Fqdn - READ-ONLY; The fully-qualified domain name (FQDN) of the Traffic Manager profile. This is formed from the concatenation of the RelativeName with the DNS domain used by Azure Traffic Manager.
Fqdn *string `json:"fqdn,omitempty"`
// TTL - The DNS Time-To-Live (TTL), in seconds. This informs the local DNS resolvers and DNS clients how long to cache DNS responses provided by this Traffic Manager profile.
TTL *int64 `json:"ttl,omitempty"`
}
// MarshalJSON is the custom marshaler for DNSConfig.
func (dc DNSConfig) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if dc.RelativeName != nil {
objectMap["relativeName"] = dc.RelativeName
}
if dc.TTL != nil {
objectMap["ttl"] = dc.TTL
}
return json.Marshal(objectMap)
}
// Endpoint class representing a Traffic Manager endpoint.
type Endpoint struct {
autorest.Response `json:"-"`
// EndpointProperties - The properties of the Traffic Manager endpoint.
*EndpointProperties `json:"properties,omitempty"`
// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Endpoint.
func (e Endpoint) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if e.EndpointProperties != nil {
objectMap["properties"] = e.EndpointProperties
}
if e.ID != nil {
objectMap["id"] = e.ID
}
if e.Name != nil {
objectMap["name"] = e.Name
}
if e.Type != nil {
objectMap["type"] = e.Type
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Endpoint struct.
func (e *Endpoint) 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 endpointProperties EndpointProperties
err = json.Unmarshal(*v, &endpointProperties)
if err != nil {
return err
}
e.EndpointProperties = &endpointProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
e.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
e.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
e.Type = &typeVar
}
}
}
return nil
}
// EndpointProperties class representing a Traffic Manager endpoint properties.
type EndpointProperties struct {
// TargetResourceID - The Azure Resource URI of the of the endpoint. Not applicable to endpoints of type 'ExternalEndpoints'.
TargetResourceID *string `json:"targetResourceId,omitempty"`
// Target - The fully-qualified DNS name or IP address of the endpoint. Traffic Manager returns this value in DNS responses to direct traffic to this endpoint.
Target *string `json:"target,omitempty"`
// EndpointStatus - The status of the endpoint. If the endpoint is Enabled, it is probed for endpoint health and is included in the traffic routing method. Possible values include: 'EndpointStatusEnabled', 'EndpointStatusDisabled'
EndpointStatus EndpointStatus `json:"endpointStatus,omitempty"`
// Weight - The weight of this endpoint when using the 'Weighted' traffic routing method. Possible values are from 1 to 1000.
Weight *int64 `json:"weight,omitempty"`
// Priority - The priority of this endpoint when using the 'Priority' traffic routing method. Possible values are from 1 to 1000, lower values represent higher priority. This is an optional parameter. If specified, it must be specified on all endpoints, and no two endpoints can share the same priority value.
Priority *int64 `json:"priority,omitempty"`
// EndpointLocation - Specifies the location of the external or nested endpoints when using the 'Performance' traffic routing method.
EndpointLocation *string `json:"endpointLocation,omitempty"`
// EndpointMonitorStatus - The monitoring status of the endpoint. Possible values include: 'EndpointMonitorStatusCheckingEndpoint', 'EndpointMonitorStatusOnline', 'EndpointMonitorStatusDegraded', 'EndpointMonitorStatusDisabled', 'EndpointMonitorStatusInactive', 'EndpointMonitorStatusStopped'
EndpointMonitorStatus EndpointMonitorStatus `json:"endpointMonitorStatus,omitempty"`
// MinChildEndpoints - The minimum number of endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'.
MinChildEndpoints *int64 `json:"minChildEndpoints,omitempty"`
// MinChildEndpointsIPv4 - The minimum number of IPv4 (DNS record type A) endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'.
MinChildEndpointsIPv4 *int64 `json:"minChildEndpointsIPv4,omitempty"`
// MinChildEndpointsIPv6 - The minimum number of IPv6 (DNS record type AAAA) endpoints that must be available in the child profile in order for the parent profile to be considered available. Only applicable to endpoint of type 'NestedEndpoints'.
MinChildEndpointsIPv6 *int64 `json:"minChildEndpointsIPv6,omitempty"`
// GeoMapping - The list of countries/regions mapped to this endpoint when using the 'Geographic' traffic routing method. Please consult Traffic Manager Geographic documentation for a full list of accepted values.
GeoMapping *[]string `json:"geoMapping,omitempty"`
// Subnets - The list of subnets, IP addresses, and/or address ranges mapped to this endpoint when using the 'Subnet' traffic routing method. An empty list will match all ranges not covered by other endpoints.
Subnets *[]EndpointPropertiesSubnetsItem `json:"subnets,omitempty"`
// CustomHeaders - List of custom headers.
CustomHeaders *[]EndpointPropertiesCustomHeadersItem `json:"customHeaders,omitempty"`
}
// EndpointPropertiesCustomHeadersItem custom header name and value.
type EndpointPropertiesCustomHeadersItem struct {
// Name - Header name.
Name *string `json:"name,omitempty"`
// Value - Header value.
Value *string `json:"value,omitempty"`
}
// EndpointPropertiesSubnetsItem subnet first address, scope, and/or last address.
type EndpointPropertiesSubnetsItem struct {
// First - First address in the subnet.
First *string `json:"first,omitempty"`
// Last - Last address in the subnet.
Last *string `json:"last,omitempty"`
// Scope - Block size (number of leading bits in the subnet mask).
Scope *int32 `json:"scope,omitempty"`
}
// GeographicHierarchy class representing the Geographic hierarchy used with the Geographic traffic routing
// method.
type GeographicHierarchy struct {
autorest.Response `json:"-"`
// GeographicHierarchyProperties - The properties of the Geographic Hierarchy resource.
*GeographicHierarchyProperties `json:"properties,omitempty"`
// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for GeographicHierarchy.
func (gh GeographicHierarchy) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if gh.GeographicHierarchyProperties != nil {
objectMap["properties"] = gh.GeographicHierarchyProperties
}
if gh.ID != nil {
objectMap["id"] = gh.ID
}
if gh.Name != nil {
objectMap["name"] = gh.Name
}
if gh.Type != nil {
objectMap["type"] = gh.Type
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for GeographicHierarchy struct.
func (gh *GeographicHierarchy) 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 geographicHierarchyProperties GeographicHierarchyProperties
err = json.Unmarshal(*v, &geographicHierarchyProperties)
if err != nil {
return err
}
gh.GeographicHierarchyProperties = &geographicHierarchyProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
gh.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
gh.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
gh.Type = &typeVar
}
}
}
return nil
}
// GeographicHierarchyProperties class representing the properties of the Geographic hierarchy used with
// the Geographic traffic routing method.
type GeographicHierarchyProperties struct {
// GeographicHierarchy - The region at the root of the hierarchy from all the regions in the hierarchy can be retrieved.
GeographicHierarchy *Region `json:"geographicHierarchy,omitempty"`
}
// HeatMapEndpoint class which is a sparse representation of a Traffic Manager endpoint.
type HeatMapEndpoint struct {
// ResourceID - The ARM Resource ID of this Traffic Manager endpoint.
ResourceID *string `json:"resourceId,omitempty"`
// EndpointID - A number uniquely identifying this endpoint in query experiences.
EndpointID *int32 `json:"endpointId,omitempty"`
}
// HeatMapModel class representing a Traffic Manager HeatMap.
type HeatMapModel struct {
autorest.Response `json:"-"`
// HeatMapProperties - The properties of the Traffic Manager HeatMap.
*HeatMapProperties `json:"properties,omitempty"`
// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for HeatMapModel.
func (hmm HeatMapModel) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if hmm.HeatMapProperties != nil {
objectMap["properties"] = hmm.HeatMapProperties
}
if hmm.ID != nil {
objectMap["id"] = hmm.ID
}
if hmm.Name != nil {
objectMap["name"] = hmm.Name
}
if hmm.Type != nil {
objectMap["type"] = hmm.Type
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for HeatMapModel struct.
func (hmm *HeatMapModel) 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 heatMapProperties HeatMapProperties
err = json.Unmarshal(*v, &heatMapProperties)
if err != nil {
return err
}
hmm.HeatMapProperties = &heatMapProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
hmm.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
hmm.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
hmm.Type = &typeVar
}
}
}
return nil
}
// HeatMapProperties class representing a Traffic Manager HeatMap properties.
type HeatMapProperties struct {
// StartTime - The beginning of the time window for this HeatMap, inclusive.
StartTime *date.Time `json:"startTime,omitempty"`
// EndTime - The ending of the time window for this HeatMap, exclusive.
EndTime *date.Time `json:"endTime,omitempty"`
// Endpoints - The endpoints used in this HeatMap calculation.
Endpoints *[]HeatMapEndpoint `json:"endpoints,omitempty"`
// TrafficFlows - The traffic flows produced in this HeatMap calculation.
TrafficFlows *[]TrafficFlow `json:"trafficFlows,omitempty"`
}
// MonitorConfig class containing endpoint monitoring settings in a Traffic Manager profile.
type MonitorConfig struct {
// ProfileMonitorStatus - The profile-level monitoring status of the Traffic Manager profile. Possible values include: 'ProfileMonitorStatusCheckingEndpoints', 'ProfileMonitorStatusOnline', 'ProfileMonitorStatusDegraded', 'ProfileMonitorStatusDisabled', 'ProfileMonitorStatusInactive'
ProfileMonitorStatus ProfileMonitorStatus `json:"profileMonitorStatus,omitempty"`
// Protocol - The protocol (HTTP, HTTPS or TCP) used to probe for endpoint health. Possible values include: 'MonitorProtocolHTTP', 'MonitorProtocolHTTPS', 'MonitorProtocolTCP'
Protocol MonitorProtocol `json:"protocol,omitempty"`
// Port - The TCP port used to probe for endpoint health.
Port *int64 `json:"port,omitempty"`
// Path - The path relative to the endpoint domain name used to probe for endpoint health.
Path *string `json:"path,omitempty"`
// IntervalInSeconds - The monitor interval for endpoints in this profile. This is the interval at which Traffic Manager will check the health of each endpoint in this profile.
IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"`
// TimeoutInSeconds - The monitor timeout for endpoints in this profile. This is the time that Traffic Manager allows endpoints in this profile to response to the health check.
TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"`
// ToleratedNumberOfFailures - The number of consecutive failed health check that Traffic Manager tolerates before declaring an endpoint in this profile Degraded after the next failed health check.
ToleratedNumberOfFailures *int64 `json:"toleratedNumberOfFailures,omitempty"`
// CustomHeaders - List of custom headers.
CustomHeaders *[]MonitorConfigCustomHeadersItem `json:"customHeaders,omitempty"`
// ExpectedStatusCodeRanges - List of expected status code ranges.
ExpectedStatusCodeRanges *[]MonitorConfigExpectedStatusCodeRangesItem `json:"expectedStatusCodeRanges,omitempty"`
}
// MonitorConfigCustomHeadersItem custom header name and value.
type MonitorConfigCustomHeadersItem struct {
// Name - Header name.
Name *string `json:"name,omitempty"`
// Value - Header value.
Value *string `json:"value,omitempty"`
}
// MonitorConfigExpectedStatusCodeRangesItem min and max value of a status code range.
type MonitorConfigExpectedStatusCodeRangesItem struct {
// Min - Min status code.
Min *int32 `json:"min,omitempty"`
// Max - Max status code.
Max *int32 `json:"max,omitempty"`
}
// NameAvailability class representing a Traffic Manager Name Availability response.
type NameAvailability struct {
autorest.Response `json:"-"`
// Name - The relative name.
Name *string `json:"name,omitempty"`
// Type - Traffic Manager profile resource type.
Type *string `json:"type,omitempty"`
// NameAvailable - Describes whether the relative name is available or not.
NameAvailable *bool `json:"nameAvailable,omitempty"`
// Reason - The reason why the name is not available, when applicable.
Reason *string `json:"reason,omitempty"`
// Message - Descriptive message that explains why the name is not available, when applicable.
Message *string `json:"message,omitempty"`
}
// Profile class representing a Traffic Manager profile.
type Profile struct {
autorest.Response `json:"-"`
// ProfileProperties - The properties of the Traffic Manager profile.
*ProfileProperties `json:"properties,omitempty"`
// Tags - Resource tags.
Tags map[string]*string `json:"tags"`
// Location - The Azure Region where the resource lives
Location *string `json:"location,omitempty"`
// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Profile.
func (p Profile) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if p.ProfileProperties != nil {
objectMap["properties"] = p.ProfileProperties
}
if p.Tags != nil {
objectMap["tags"] = p.Tags
}
if p.Location != nil {
objectMap["location"] = p.Location
}
if p.ID != nil {
objectMap["id"] = p.ID
}
if p.Name != nil {
objectMap["name"] = p.Name
}
if p.Type != nil {
objectMap["type"] = p.Type
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Profile struct.
func (p *Profile) 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 profileProperties ProfileProperties
err = json.Unmarshal(*v, &profileProperties)
if err != nil {
return err
}
p.ProfileProperties = &profileProperties
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
p.Tags = tags
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
p.Location = &location
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
p.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
p.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
p.Type = &typeVar
}
}
}
return nil
}
// ProfileListResult the list Traffic Manager profiles operation response.
type ProfileListResult struct {
autorest.Response `json:"-"`
// Value - Gets the list of Traffic manager profiles.
Value *[]Profile `json:"value,omitempty"`
}
// ProfileProperties class representing the Traffic Manager profile properties.
type ProfileProperties struct {
// ProfileStatus - The status of the Traffic Manager profile. Possible values include: 'ProfileStatusEnabled', 'ProfileStatusDisabled'
ProfileStatus ProfileStatus `json:"profileStatus,omitempty"`
// TrafficRoutingMethod - The traffic routing method of the Traffic Manager profile. Possible values include: 'TrafficRoutingMethodPerformance', 'TrafficRoutingMethodPriority', 'TrafficRoutingMethodWeighted', 'TrafficRoutingMethodGeographic', 'TrafficRoutingMethodMultiValue', 'TrafficRoutingMethodSubnet'
TrafficRoutingMethod TrafficRoutingMethod `json:"trafficRoutingMethod,omitempty"`
// DNSConfig - The DNS settings of the Traffic Manager profile.
DNSConfig *DNSConfig `json:"dnsConfig,omitempty"`
// MonitorConfig - The endpoint monitoring settings of the Traffic Manager profile.
MonitorConfig *MonitorConfig `json:"monitorConfig,omitempty"`
// Endpoints - The list of endpoints in the Traffic Manager profile.
Endpoints *[]Endpoint `json:"endpoints,omitempty"`
// TrafficViewEnrollmentStatus - Indicates whether Traffic View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null, indicates 'Disabled'. Enabling this feature will increase the cost of the Traffic Manage profile. Possible values include: 'TrafficViewEnrollmentStatusEnabled', 'TrafficViewEnrollmentStatusDisabled'
TrafficViewEnrollmentStatus TrafficViewEnrollmentStatus `json:"trafficViewEnrollmentStatus,omitempty"`
// AllowedEndpointRecordTypes - The list of allowed endpoint record types.
AllowedEndpointRecordTypes *[]AllowedEndpointRecordType `json:"allowedEndpointRecordTypes,omitempty"`
// MaxReturn - Maximum number of endpoints to be returned for MultiValue routing type.
MaxReturn *int64 `json:"maxReturn,omitempty"`
}
// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
// required location and tags
type ProxyResource struct {
// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
Type *string `json:"type,omitempty"`
}
// QueryExperience class representing a Traffic Manager HeatMap query experience properties.
type QueryExperience struct {
// EndpointID - The id of the endpoint from the 'endpoints' array which these queries were routed to.
EndpointID *int32 `json:"endpointId,omitempty"`
// QueryCount - The number of queries originating from this location.
QueryCount *int32 `json:"queryCount,omitempty"`
// Latency - The latency experienced by queries originating from this location.
Latency *float64 `json:"latency,omitempty"`
}
// Region class representing a region in the Geographic hierarchy used with the Geographic traffic routing
// method.
type Region struct {
// Code - The code of the region
Code *string `json:"code,omitempty"`
// Name - The name of the region
Name *string `json:"name,omitempty"`
// Regions - The list of Regions grouped under this Region in the Geographic Hierarchy.
Regions *[]Region `json:"regions,omitempty"`
}
// Resource the core properties of ARM resources
type Resource struct {
// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
Type *string `json:"type,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"`
// Location - The Azure Region where the resource lives
Location *string `json:"location,omitempty"`
// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
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
}
if tr.Location != nil {
objectMap["location"] = tr.Location
}
if tr.ID != nil {
objectMap["id"] = tr.ID
}
if tr.Name != nil {
objectMap["name"] = tr.Name
}
if tr.Type != nil {
objectMap["type"] = tr.Type
}
return json.Marshal(objectMap)
}
// TrafficFlow class representing a Traffic Manager HeatMap traffic flow properties.
type TrafficFlow struct {
// SourceIP - The IP address that this query experience originated from.
SourceIP *string `json:"sourceIp,omitempty"`
// Latitude - The approximate latitude that these queries originated from.
Latitude *float64 `json:"latitude,omitempty"`
// Longitude - The approximate longitude that these queries originated from.
Longitude *float64 `json:"longitude,omitempty"`
// QueryExperiences - The query experiences produced in this HeatMap calculation.
QueryExperiences *[]QueryExperience `json:"queryExperiences,omitempty"`
}
// UserMetricsModel class representing Traffic Manager User Metrics.
type UserMetricsModel struct {
autorest.Response `json:"-"`
// UserMetricsProperties - The properties of the Traffic Manager User Metrics.
*UserMetricsProperties `json:"properties,omitempty"`
// ID - Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{resourceName}
ID *string `json:"id,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Type - The type of the resource. Ex- Microsoft.Network/trafficManagerProfiles.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for UserMetricsModel.
func (umm UserMetricsModel) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if umm.UserMetricsProperties != nil {
objectMap["properties"] = umm.UserMetricsProperties
}
if umm.ID != nil {
objectMap["id"] = umm.ID
}
if umm.Name != nil {
objectMap["name"] = umm.Name
}
if umm.Type != nil {
objectMap["type"] = umm.Type
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for UserMetricsModel struct.
func (umm *UserMetricsModel) 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 userMetricsProperties UserMetricsProperties
err = json.Unmarshal(*v, &userMetricsProperties)
if err != nil {
return err
}
umm.UserMetricsProperties = &userMetricsProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
umm.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
umm.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
umm.Type = &typeVar
}
}
}
return nil
}
// UserMetricsProperties class representing a Traffic Manager Real User Metrics key response.
type UserMetricsProperties struct {
// Key - The key returned by the User Metrics operation.
Key *string `json:"key,omitempty"`
}