-
Notifications
You must be signed in to change notification settings - Fork 806
/
models.go
3070 lines (2769 loc) · 104 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 peering
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// 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/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/peering/mgmt/2020-01-01-preview/peering"
// ConnectionState enumerates the values for connection state.
type ConnectionState string
const (
// Active ...
Active ConnectionState = "Active"
// Approved ...
Approved ConnectionState = "Approved"
// None ...
None ConnectionState = "None"
// PendingApproval ...
PendingApproval ConnectionState = "PendingApproval"
// ProvisioningCompleted ...
ProvisioningCompleted ConnectionState = "ProvisioningCompleted"
// ProvisioningFailed ...
ProvisioningFailed ConnectionState = "ProvisioningFailed"
// ProvisioningStarted ...
ProvisioningStarted ConnectionState = "ProvisioningStarted"
// Validating ...
Validating ConnectionState = "Validating"
)
// PossibleConnectionStateValues returns an array of possible values for the ConnectionState const type.
func PossibleConnectionStateValues() []ConnectionState {
return []ConnectionState{Active, Approved, None, PendingApproval, ProvisioningCompleted, ProvisioningFailed, ProvisioningStarted, Validating}
}
// DirectPeeringType enumerates the values for direct peering type.
type DirectPeeringType string
const (
// Cdn ...
Cdn DirectPeeringType = "Cdn"
// Edge ...
Edge DirectPeeringType = "Edge"
// Internal ...
Internal DirectPeeringType = "Internal"
// Ix ...
Ix DirectPeeringType = "Ix"
// IxRs ...
IxRs DirectPeeringType = "IxRs"
// Transit ...
Transit DirectPeeringType = "Transit"
)
// PossibleDirectPeeringTypeValues returns an array of possible values for the DirectPeeringType const type.
func PossibleDirectPeeringTypeValues() []DirectPeeringType {
return []DirectPeeringType{Cdn, Edge, Internal, Ix, IxRs, Transit}
}
// Family enumerates the values for family.
type Family string
const (
// Direct ...
Direct Family = "Direct"
// Exchange ...
Exchange Family = "Exchange"
)
// PossibleFamilyValues returns an array of possible values for the Family const type.
func PossibleFamilyValues() []Family {
return []Family{Direct, Exchange}
}
// Kind enumerates the values for kind.
type Kind string
const (
// KindDirect ...
KindDirect Kind = "Direct"
// KindExchange ...
KindExchange Kind = "Exchange"
)
// PossibleKindValues returns an array of possible values for the Kind const type.
func PossibleKindValues() []Kind {
return []Kind{KindDirect, KindExchange}
}
// LearnedType enumerates the values for learned type.
type LearnedType string
const (
// LearnedTypeNone ...
LearnedTypeNone LearnedType = "None"
// LearnedTypeViaServiceProvider ...
LearnedTypeViaServiceProvider LearnedType = "ViaServiceProvider"
// LearnedTypeViaSession ...
LearnedTypeViaSession LearnedType = "ViaSession"
)
// PossibleLearnedTypeValues returns an array of possible values for the LearnedType const type.
func PossibleLearnedTypeValues() []LearnedType {
return []LearnedType{LearnedTypeNone, LearnedTypeViaServiceProvider, LearnedTypeViaSession}
}
// PrefixValidationState enumerates the values for prefix validation state.
type PrefixValidationState string
const (
// PrefixValidationStateFailed ...
PrefixValidationStateFailed PrefixValidationState = "Failed"
// PrefixValidationStateInvalid ...
PrefixValidationStateInvalid PrefixValidationState = "Invalid"
// PrefixValidationStateNone ...
PrefixValidationStateNone PrefixValidationState = "None"
// PrefixValidationStatePending ...
PrefixValidationStatePending PrefixValidationState = "Pending"
// PrefixValidationStateUnknown ...
PrefixValidationStateUnknown PrefixValidationState = "Unknown"
// PrefixValidationStateVerified ...
PrefixValidationStateVerified PrefixValidationState = "Verified"
// PrefixValidationStateWarning ...
PrefixValidationStateWarning PrefixValidationState = "Warning"
)
// PossiblePrefixValidationStateValues returns an array of possible values for the PrefixValidationState const type.
func PossiblePrefixValidationStateValues() []PrefixValidationState {
return []PrefixValidationState{PrefixValidationStateFailed, PrefixValidationStateInvalid, PrefixValidationStateNone, PrefixValidationStatePending, PrefixValidationStateUnknown, PrefixValidationStateVerified, PrefixValidationStateWarning}
}
// ProvisioningState enumerates the values for provisioning state.
type ProvisioningState string
const (
// Deleting ...
Deleting ProvisioningState = "Deleting"
// Failed ...
Failed ProvisioningState = "Failed"
// Succeeded ...
Succeeded ProvisioningState = "Succeeded"
// Updating ...
Updating ProvisioningState = "Updating"
)
// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
func PossibleProvisioningStateValues() []ProvisioningState {
return []ProvisioningState{Deleting, Failed, Succeeded, Updating}
}
// Role enumerates the values for role.
type Role string
const (
// RoleNoc ...
RoleNoc Role = "Noc"
// RoleOther ...
RoleOther Role = "Other"
// RolePolicy ...
RolePolicy Role = "Policy"
// RoleService ...
RoleService Role = "Service"
// RoleTechnical ...
RoleTechnical Role = "Technical"
)
// PossibleRoleValues returns an array of possible values for the Role const type.
func PossibleRoleValues() []Role {
return []Role{RoleNoc, RoleOther, RolePolicy, RoleService, RoleTechnical}
}
// SessionAddressProvider enumerates the values for session address provider.
type SessionAddressProvider string
const (
// Microsoft ...
Microsoft SessionAddressProvider = "Microsoft"
// Peer ...
Peer SessionAddressProvider = "Peer"
)
// PossibleSessionAddressProviderValues returns an array of possible values for the SessionAddressProvider const type.
func PossibleSessionAddressProviderValues() []SessionAddressProvider {
return []SessionAddressProvider{Microsoft, Peer}
}
// SessionStateV4 enumerates the values for session state v4.
type SessionStateV4 string
const (
// SessionStateV4Active ...
SessionStateV4Active SessionStateV4 = "Active"
// SessionStateV4Connect ...
SessionStateV4Connect SessionStateV4 = "Connect"
// SessionStateV4Established ...
SessionStateV4Established SessionStateV4 = "Established"
// SessionStateV4Idle ...
SessionStateV4Idle SessionStateV4 = "Idle"
// SessionStateV4None ...
SessionStateV4None SessionStateV4 = "None"
// SessionStateV4OpenConfirm ...
SessionStateV4OpenConfirm SessionStateV4 = "OpenConfirm"
// SessionStateV4OpenReceived ...
SessionStateV4OpenReceived SessionStateV4 = "OpenReceived"
// SessionStateV4OpenSent ...
SessionStateV4OpenSent SessionStateV4 = "OpenSent"
// SessionStateV4PendingAdd ...
SessionStateV4PendingAdd SessionStateV4 = "PendingAdd"
// SessionStateV4PendingRemove ...
SessionStateV4PendingRemove SessionStateV4 = "PendingRemove"
// SessionStateV4PendingUpdate ...
SessionStateV4PendingUpdate SessionStateV4 = "PendingUpdate"
)
// PossibleSessionStateV4Values returns an array of possible values for the SessionStateV4 const type.
func PossibleSessionStateV4Values() []SessionStateV4 {
return []SessionStateV4{SessionStateV4Active, SessionStateV4Connect, SessionStateV4Established, SessionStateV4Idle, SessionStateV4None, SessionStateV4OpenConfirm, SessionStateV4OpenReceived, SessionStateV4OpenSent, SessionStateV4PendingAdd, SessionStateV4PendingRemove, SessionStateV4PendingUpdate}
}
// SessionStateV6 enumerates the values for session state v6.
type SessionStateV6 string
const (
// SessionStateV6Active ...
SessionStateV6Active SessionStateV6 = "Active"
// SessionStateV6Connect ...
SessionStateV6Connect SessionStateV6 = "Connect"
// SessionStateV6Established ...
SessionStateV6Established SessionStateV6 = "Established"
// SessionStateV6Idle ...
SessionStateV6Idle SessionStateV6 = "Idle"
// SessionStateV6None ...
SessionStateV6None SessionStateV6 = "None"
// SessionStateV6OpenConfirm ...
SessionStateV6OpenConfirm SessionStateV6 = "OpenConfirm"
// SessionStateV6OpenReceived ...
SessionStateV6OpenReceived SessionStateV6 = "OpenReceived"
// SessionStateV6OpenSent ...
SessionStateV6OpenSent SessionStateV6 = "OpenSent"
// SessionStateV6PendingAdd ...
SessionStateV6PendingAdd SessionStateV6 = "PendingAdd"
// SessionStateV6PendingRemove ...
SessionStateV6PendingRemove SessionStateV6 = "PendingRemove"
// SessionStateV6PendingUpdate ...
SessionStateV6PendingUpdate SessionStateV6 = "PendingUpdate"
)
// PossibleSessionStateV6Values returns an array of possible values for the SessionStateV6 const type.
func PossibleSessionStateV6Values() []SessionStateV6 {
return []SessionStateV6{SessionStateV6Active, SessionStateV6Connect, SessionStateV6Established, SessionStateV6Idle, SessionStateV6None, SessionStateV6OpenConfirm, SessionStateV6OpenReceived, SessionStateV6OpenSent, SessionStateV6PendingAdd, SessionStateV6PendingRemove, SessionStateV6PendingUpdate}
}
// Size enumerates the values for size.
type Size string
const (
// Free ...
Free Size = "Free"
// Metered ...
Metered Size = "Metered"
// Unlimited ...
Unlimited Size = "Unlimited"
)
// PossibleSizeValues returns an array of possible values for the Size const type.
func PossibleSizeValues() []Size {
return []Size{Free, Metered, Unlimited}
}
// Tier enumerates the values for tier.
type Tier string
const (
// Basic ...
Basic Tier = "Basic"
// Premium ...
Premium Tier = "Premium"
)
// PossibleTierValues returns an array of possible values for the Tier const type.
func PossibleTierValues() []Tier {
return []Tier{Basic, Premium}
}
// ValidationState enumerates the values for validation state.
type ValidationState string
const (
// ValidationStateApproved ...
ValidationStateApproved ValidationState = "Approved"
// ValidationStateFailed ...
ValidationStateFailed ValidationState = "Failed"
// ValidationStateNone ...
ValidationStateNone ValidationState = "None"
// ValidationStatePending ...
ValidationStatePending ValidationState = "Pending"
)
// PossibleValidationStateValues returns an array of possible values for the ValidationState const type.
func PossibleValidationStateValues() []ValidationState {
return []ValidationState{ValidationStateApproved, ValidationStateFailed, ValidationStateNone, ValidationStatePending}
}
// BandwidthOffer the properties that define a peering bandwidth offer.
type BandwidthOffer struct {
// OfferName - The name of the bandwidth offer.
OfferName *string `json:"offerName,omitempty"`
// ValueInMbps - The value of the bandwidth offer in Mbps.
ValueInMbps *int32 `json:"valueInMbps,omitempty"`
}
// BgpSession the properties that define a BGP session.
type BgpSession struct {
// SessionPrefixV4 - The IPv4 prefix that contains both ends' IPv4 addresses.
SessionPrefixV4 *string `json:"sessionPrefixV4,omitempty"`
// SessionPrefixV6 - The IPv6 prefix that contains both ends' IPv6 addresses.
SessionPrefixV6 *string `json:"sessionPrefixV6,omitempty"`
// MicrosoftSessionIPv4Address - The IPv4 session address on Microsoft's end.
MicrosoftSessionIPv4Address *string `json:"microsoftSessionIPv4Address,omitempty"`
// MicrosoftSessionIPv6Address - The IPv6 session address on Microsoft's end.
MicrosoftSessionIPv6Address *string `json:"microsoftSessionIPv6Address,omitempty"`
// PeerSessionIPv4Address - The IPv4 session address on peer's end.
PeerSessionIPv4Address *string `json:"peerSessionIPv4Address,omitempty"`
// PeerSessionIPv6Address - The IPv6 session address on peer's end.
PeerSessionIPv6Address *string `json:"peerSessionIPv6Address,omitempty"`
// SessionStateV4 - READ-ONLY; The state of the IPv4 session. Possible values include: 'SessionStateV4None', 'SessionStateV4Idle', 'SessionStateV4Connect', 'SessionStateV4Active', 'SessionStateV4OpenSent', 'SessionStateV4OpenConfirm', 'SessionStateV4OpenReceived', 'SessionStateV4Established', 'SessionStateV4PendingAdd', 'SessionStateV4PendingUpdate', 'SessionStateV4PendingRemove'
SessionStateV4 SessionStateV4 `json:"sessionStateV4,omitempty"`
// SessionStateV6 - READ-ONLY; The state of the IPv6 session. Possible values include: 'SessionStateV6None', 'SessionStateV6Idle', 'SessionStateV6Connect', 'SessionStateV6Active', 'SessionStateV6OpenSent', 'SessionStateV6OpenConfirm', 'SessionStateV6OpenReceived', 'SessionStateV6Established', 'SessionStateV6PendingAdd', 'SessionStateV6PendingUpdate', 'SessionStateV6PendingRemove'
SessionStateV6 SessionStateV6 `json:"sessionStateV6,omitempty"`
// MaxPrefixesAdvertisedV4 - The maximum number of prefixes advertised over the IPv4 session.
MaxPrefixesAdvertisedV4 *int32 `json:"maxPrefixesAdvertisedV4,omitempty"`
// MaxPrefixesAdvertisedV6 - The maximum number of prefixes advertised over the IPv6 session.
MaxPrefixesAdvertisedV6 *int32 `json:"maxPrefixesAdvertisedV6,omitempty"`
// Md5AuthenticationKey - The MD5 authentication key of the session.
Md5AuthenticationKey *string `json:"md5AuthenticationKey,omitempty"`
}
// CheckServiceProviderAvailabilityInput class for CheckServiceProviderAvailabilityInput
type CheckServiceProviderAvailabilityInput struct {
// PeeringServiceLocation - Gets or sets the peering service location.
PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"`
// PeeringServiceProvider - Gets or sets the peering service provider.
PeeringServiceProvider *string `json:"peeringServiceProvider,omitempty"`
}
// ContactDetail the contact detail class.
type ContactDetail struct {
// Role - The role of the contact. Possible values include: 'RoleNoc', 'RolePolicy', 'RoleTechnical', 'RoleService', 'RoleOther'
Role Role `json:"role,omitempty"`
// Email - The e-mail address of the contact.
Email *string `json:"email,omitempty"`
// Phone - The phone number of the contact.
Phone *string `json:"phone,omitempty"`
}
// DirectConnection the properties that define a direct connection.
type DirectConnection struct {
// BandwidthInMbps - The bandwidth of the connection.
BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`
// ProvisionedBandwidthInMbps - READ-ONLY; The bandwidth that is actually provisioned.
ProvisionedBandwidthInMbps *int32 `json:"provisionedBandwidthInMbps,omitempty"`
// SessionAddressProvider - The field indicating if Microsoft provides session ip addresses. Possible values include: 'Microsoft', 'Peer'
SessionAddressProvider SessionAddressProvider `json:"sessionAddressProvider,omitempty"`
// UseForPeeringService - The flag that indicates whether or not the connection is used for peering service.
UseForPeeringService *bool `json:"useForPeeringService,omitempty"`
// PeeringDBFacilityID - The PeeringDB.com ID of the facility at which the connection has to be set up.
PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`
// ConnectionState - READ-ONLY; The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active'
ConnectionState ConnectionState `json:"connectionState,omitempty"`
// BgpSession - The BGP session associated with the connection.
BgpSession *BgpSession `json:"bgpSession,omitempty"`
// ConnectionIdentifier - The unique identifier (GUID) for the connection.
ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"`
// ErrorMessage - READ-ONLY; The error message related to the connection state, if any.
ErrorMessage *string `json:"errorMessage,omitempty"`
}
// DirectPeeringFacility the properties that define a direct peering facility.
type DirectPeeringFacility struct {
// Address - The address of the direct peering facility.
Address *string `json:"address,omitempty"`
// DirectPeeringType - The type of the direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs'
DirectPeeringType DirectPeeringType `json:"directPeeringType,omitempty"`
// PeeringDBFacilityID - The PeeringDB.com ID of the facility.
PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`
// PeeringDBFacilityLink - The PeeringDB.com URL of the facility.
PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"`
}
// ErrorResponse the error response that indicates why an operation has failed.
type ErrorResponse struct {
// Code - READ-ONLY; The error code.
Code *string `json:"code,omitempty"`
// Message - READ-ONLY; The error message.
Message *string `json:"message,omitempty"`
}
// ExchangeConnection the properties that define an exchange connection.
type ExchangeConnection struct {
// PeeringDBFacilityID - The PeeringDB.com ID of the facility at which the connection has to be set up.
PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`
// ConnectionState - READ-ONLY; The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active'
ConnectionState ConnectionState `json:"connectionState,omitempty"`
// BgpSession - The BGP session associated with the connection.
BgpSession *BgpSession `json:"bgpSession,omitempty"`
// ConnectionIdentifier - The unique identifier (GUID) for the connection.
ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"`
// ErrorMessage - READ-ONLY; The error message related to the connection state, if any.
ErrorMessage *string `json:"errorMessage,omitempty"`
}
// ExchangePeeringFacility the properties that define an exchange peering facility.
type ExchangePeeringFacility struct {
// ExchangeName - The name of the exchange peering facility.
ExchangeName *string `json:"exchangeName,omitempty"`
// BandwidthInMbps - The bandwidth of the connection between Microsoft and the exchange peering facility.
BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"`
// MicrosoftIPv4Address - The IPv4 address of Microsoft at the exchange peering facility.
MicrosoftIPv4Address *string `json:"microsoftIPv4Address,omitempty"`
// MicrosoftIPv6Address - The IPv6 address of Microsoft at the exchange peering facility.
MicrosoftIPv6Address *string `json:"microsoftIPv6Address,omitempty"`
// FacilityIPv4Prefix - The IPv4 prefixes associated with the exchange peering facility.
FacilityIPv4Prefix *string `json:"facilityIPv4Prefix,omitempty"`
// FacilityIPv6Prefix - The IPv6 prefixes associated with the exchange peering facility.
FacilityIPv6Prefix *string `json:"facilityIPv6Prefix,omitempty"`
// PeeringDBFacilityID - The PeeringDB.com ID of the facility.
PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"`
// PeeringDBFacilityLink - The PeeringDB.com URL of the facility.
PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"`
}
// ListResult the paginated list of peerings.
type ListResult struct {
autorest.Response `json:"-"`
// Value - The list of peerings.
Value *[]Model `json:"value,omitempty"`
// NextLink - The link to fetch the next page of peerings.
NextLink *string `json:"nextLink,omitempty"`
}
// ListResultIterator provides access to a complete listing of Model values.
type ListResultIterator struct {
i int
page ListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter ListResultIterator) Response() ListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter ListResultIterator) Value() Model {
if !iter.page.NotDone() {
return Model{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ListResultIterator type.
func NewListResultIterator(page ListResultPage) ListResultIterator {
return ListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (lr ListResult) IsEmpty() bool {
return lr.Value == nil || len(*lr.Value) == 0
}
// listResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) {
if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(lr.NextLink)))
}
// ListResultPage contains a page of Model values.
type ListResultPage struct {
fn func(context.Context, ListResult) (ListResult, error)
lr ListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *ListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
next, err := page.fn(ctx, page.lr)
if err != nil {
return err
}
page.lr = next
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *ListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ListResultPage) NotDone() bool {
return !page.lr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ListResultPage) Response() ListResult {
return page.lr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page ListResultPage) Values() []Model {
if page.lr.IsEmpty() {
return nil
}
return *page.lr.Value
}
// Creates a new instance of the ListResultPage type.
func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage {
return ListResultPage{fn: getNextPage}
}
// Location peering location is where connectivity could be established to the Microsoft Cloud Edge.
type Location struct {
// Kind - The kind of peering that the peering location supports. Possible values include: 'KindDirect', 'KindExchange'
Kind Kind `json:"kind,omitempty"`
// LocationProperties - The properties that define a peering location.
*LocationProperties `json:"properties,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// ID - READ-ONLY; The ID of the resource.
ID *string `json:"id,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Location.
func (l Location) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if l.Kind != "" {
objectMap["kind"] = l.Kind
}
if l.LocationProperties != nil {
objectMap["properties"] = l.LocationProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Location struct.
func (l *Location) 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 Kind
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
l.Kind = kind
}
case "properties":
if v != nil {
var locationProperties LocationProperties
err = json.Unmarshal(*v, &locationProperties)
if err != nil {
return err
}
l.LocationProperties = &locationProperties
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
l.Name = &name
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
l.ID = &ID
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
l.Type = &typeVar
}
}
}
return nil
}
// LocationListResult the paginated list of peering locations.
type LocationListResult struct {
autorest.Response `json:"-"`
// Value - The list of peering locations.
Value *[]Location `json:"value,omitempty"`
// NextLink - The link to fetch the next page of peering locations.
NextLink *string `json:"nextLink,omitempty"`
}
// LocationListResultIterator provides access to a complete listing of Location values.
type LocationListResultIterator struct {
i int
page LocationListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *LocationListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LocationListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *LocationListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter LocationListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter LocationListResultIterator) Response() LocationListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter LocationListResultIterator) Value() Location {
if !iter.page.NotDone() {
return Location{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the LocationListResultIterator type.
func NewLocationListResultIterator(page LocationListResultPage) LocationListResultIterator {
return LocationListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (llr LocationListResult) IsEmpty() bool {
return llr.Value == nil || len(*llr.Value) == 0
}
// locationListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (llr LocationListResult) locationListResultPreparer(ctx context.Context) (*http.Request, error) {
if llr.NextLink == nil || len(to.String(llr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(llr.NextLink)))
}
// LocationListResultPage contains a page of Location values.
type LocationListResultPage struct {
fn func(context.Context, LocationListResult) (LocationListResult, error)
llr LocationListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *LocationListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LocationListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
next, err := page.fn(ctx, page.llr)
if err != nil {
return err
}
page.llr = next
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (page *LocationListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page LocationListResultPage) NotDone() bool {
return !page.llr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page LocationListResultPage) Response() LocationListResult {
return page.llr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page LocationListResultPage) Values() []Location {
if page.llr.IsEmpty() {
return nil
}
return *page.llr.Value
}
// Creates a new instance of the LocationListResultPage type.
func NewLocationListResultPage(getNextPage func(context.Context, LocationListResult) (LocationListResult, error)) LocationListResultPage {
return LocationListResultPage{fn: getNextPage}
}
// LocationProperties the properties that define a peering location.
type LocationProperties struct {
// Direct - The properties that define a direct peering location.
Direct *LocationPropertiesDirect `json:"direct,omitempty"`
// Exchange - The properties that define an exchange peering location.
Exchange *LocationPropertiesExchange `json:"exchange,omitempty"`
// PeeringLocation - The name of the peering location.
PeeringLocation *string `json:"peeringLocation,omitempty"`
// Country - The country in which the peering location exists.
Country *string `json:"country,omitempty"`
// AzureRegion - The Azure region associated with the peering location.
AzureRegion *string `json:"azureRegion,omitempty"`
}
// LocationPropertiesDirect the properties that define a direct peering location.
type LocationPropertiesDirect struct {
// PeeringFacilities - The list of direct peering facilities at the peering location.
PeeringFacilities *[]DirectPeeringFacility `json:"peeringFacilities,omitempty"`
// BandwidthOffers - The list of bandwidth offers available at the peering location.
BandwidthOffers *[]BandwidthOffer `json:"bandwidthOffers,omitempty"`
}
// LocationPropertiesExchange the properties that define an exchange peering location.
type LocationPropertiesExchange struct {
// PeeringFacilities - The list of exchange peering facilities at the peering location.
PeeringFacilities *[]ExchangePeeringFacility `json:"peeringFacilities,omitempty"`
}
// Model peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a
// location.
type Model struct {
autorest.Response `json:"-"`
// Sku - The SKU that defines the tier and kind of the peering.
Sku *Sku `json:"sku,omitempty"`
// Kind - The kind of the peering. Possible values include: 'KindDirect', 'KindExchange'
Kind Kind `json:"kind,omitempty"`
// Properties - The properties that define a peering.
*Properties `json:"properties,omitempty"`
// Location - The location of the resource.
Location *string `json:"location,omitempty"`
// Tags - The resource tags.
Tags map[string]*string `json:"tags"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// ID - READ-ONLY; The ID of the resource.
ID *string `json:"id,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Model.
func (mVar Model) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if mVar.Sku != nil {
objectMap["sku"] = mVar.Sku
}
if mVar.Kind != "" {
objectMap["kind"] = mVar.Kind
}
if mVar.Properties != nil {
objectMap["properties"] = mVar.Properties
}
if mVar.Location != nil {
objectMap["location"] = mVar.Location
}
if mVar.Tags != nil {
objectMap["tags"] = mVar.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Model struct.
func (mVar *Model) 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 "sku":
if v != nil {
var sku Sku
err = json.Unmarshal(*v, &sku)
if err != nil {
return err
}
mVar.Sku = &sku
}
case "kind":
if v != nil {
var kind Kind
err = json.Unmarshal(*v, &kind)
if err != nil {
return err
}
mVar.Kind = kind
}
case "properties":
if v != nil {
var properties Properties
err = json.Unmarshal(*v, &properties)
if err != nil {
return err
}
mVar.Properties = &properties
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
mVar.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
mVar.Tags = tags
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
mVar.Name = &name
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
mVar.ID = &ID
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
mVar.Type = &typeVar
}
}
}
return nil
}
// Operation the peering API operation.
type Operation struct {
// Name - READ-ONLY; The name of the operation.
Name *string `json:"name,omitempty"`
// Display - READ-ONLY; The information related to the operation.
Display *OperationDisplayInfo `json:"display,omitempty"`
// IsDataAction - READ-ONLY; The flag that indicates whether the operation applies to data plane.
IsDataAction *bool `json:"isDataAction,omitempty"`
}